android_kernel_motorola_sm6375/include
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Kees Cook ed6c8c1fe6 overflow: Allow mixed type arguments
commit d219d2a9a92e39aa92799efe8f2aa21259b6dd82 upstream.

When the check_[op]_overflow() helpers were introduced, all arguments
were required to be the same type to make the fallback macros simpler.
However, now that the fallback macros have been removed[1], it is fine
to allow mixed types, which makes using the helpers much more useful,
as they can be used to test for type-based overflows (e.g. adding two
large ints but storing into a u8), as would be handy in the drm core[2].

Remove the restriction, and add additional self-tests that exercise
some of the mixed-type overflow cases, and double-check for accidental
macro side-effects.

[1] https://git.kernel.org/linus/4eb6bd55cfb22ffc20652732340c4962f3ac9a91
[2] https://lore.kernel.org/lkml/20220824084514.2261614-2-gwan-gyeong.mun@intel.com

Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Cc: Gwan-gyeong Mun <gwan-gyeong.mun@intel.com>
Cc: "Gustavo A. R. Silva" <gustavoars@kernel.org>
Cc: Nick Desaulniers <ndesaulniers@google.com>
Cc: linux-hardening@vger.kernel.org
Reviewed-by: Andrzej Hajda <andrzej.hajda@intel.com>
Reviewed-by: Gwan-gyeong Mun <gwan-gyeong.mun@intel.com>
Tested-by: Gwan-gyeong Mun <gwan-gyeong.mun@intel.com>
Signed-off-by: Kees Cook <keescook@chromium.org>
[florian: Drop changes to lib/test_overflow.c]
Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-03-13 12:42:52 +01:00
..
acpi
asm-generic
clocksource
crypto
drm drm/printer: Allow NULL data in devcoredump printer 2024-11-08 16:20:39 +01:00
dt-bindings
keys
kvm
linux overflow: Allow mixed type arguments 2025-03-13 12:42:52 +01:00
math-emu
media media: rename VFL_TYPE_GRABBER to _VIDEO 2024-03-26 18:22:22 -04:00
misc
net net: add exit_batch_rtnl() method 2025-02-01 18:18:49 +01:00
pcmcia
ras
rdma
scsi
soc soc: fsl: qbman: Add CGR update function 2024-04-13 12:51:27 +02:00
sound
target
trace f2fs: reduce expensive checkpoint trigger frequency 2024-11-08 16:20:32 +01:00
uapi netfilter: Replace zero-length array with flexible-array member 2025-01-09 13:23:35 +01:00
vdso
video
xen xen/xenbus: fix locking 2024-12-14 19:44:47 +01:00