mirror of
https://github.com/torvalds/linux.git
synced 2024-11-10 22:21:40 +00:00
e10aea105e
The out-of-bounds test allocates an object that is three bytes too short
in order to validate the bounds checking. Starting with gcc-14, this
causes a compile-time warning as gcc has grown smart enough to understand
the sizeof() logic:
mm/kasan/kasan_test.c: In function 'kmalloc_oob_16':
mm/kasan/kasan_test.c:443:14: error: allocation of insufficient size '13' for type 'struct <anonymous>' with size '16' [-Werror=alloc-size]
443 | ptr1 = kmalloc(sizeof(*ptr1) - 3, GFP_KERNEL);
| ^
Hide the actual computation behind a RELOC_HIDE() that ensures
the compiler misses the intentional bug.
Link: https://lkml.kernel.org/r/20240212111609.869266-1-arnd@kernel.org
Fixes:
|
||
---|---|---|
.. | ||
common.c | ||
generic.c | ||
hw_tags.c | ||
init.c | ||
kasan_test_module.c | ||
kasan_test.c | ||
kasan.h | ||
Makefile | ||
quarantine.c | ||
report_generic.c | ||
report_hw_tags.c | ||
report_sw_tags.c | ||
report_tags.c | ||
report.c | ||
shadow.c | ||
sw_tags.c | ||
tags.c |