Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

x86/percpu: Disable named address spaces for UBSAN_BOOL with KASAN for GCC < 14.2

GCC < 14.2 does not correctly propagate address space qualifiers
with -fsanitize=bool,enum. Together with address sanitizer then
causes that load to be sanitized.

Disable named address spaces for GCC < 14.2 when both, UBSAN_BOOL
and KASAN are enabled.

Reported-by: Matt Fleming <matt@readmodwrite.com>
Signed-off-by: Uros Bizjak <ubizjak@gmail.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Link: https://lore.kernel.org/r/20250227140715.2276353-1-ubizjak@gmail.com
Closes: https://lore.kernel.org/lkml/20241213190119.3449103-1-matt@readmodwrite.com/

authored by

Uros Bizjak and committed by
Ingo Molnar
b6762467 79165720

+11 -9
+11 -9
arch/x86/Kconfig
··· 2441 2441 def_bool $(success,echo 'int __seg_fs fs; int __seg_gs gs;' | $(CC) -x c - -S -o /dev/null) 2442 2442 depends on CC_IS_GCC 2443 2443 2444 + # 2445 + # -fsanitize=kernel-address (KASAN) and -fsanitize=thread (KCSAN) 2446 + # are incompatible with named address spaces with GCC < 13.3 2447 + # (see GCC PR sanitizer/111736 and also PR sanitizer/115172). 2448 + # 2449 + 2444 2450 config CC_HAS_NAMED_AS_FIXED_SANITIZERS 2445 - def_bool CC_IS_GCC && GCC_VERSION >= 130300 2451 + def_bool y 2452 + depends on !(KASAN || KCSAN) || GCC_VERSION >= 130300 2453 + depends on !(UBSAN_BOOL && KASAN) || GCC_VERSION >= 140200 2446 2454 2447 2455 config USE_X86_SEG_SUPPORT 2448 - def_bool y 2449 - depends on CC_HAS_NAMED_AS 2450 - # 2451 - # -fsanitize=kernel-address (KASAN) and -fsanitize=thread 2452 - # (KCSAN) are incompatible with named address spaces with 2453 - # GCC < 13.3 - see GCC PR sanitizer/111736. 2454 - # 2455 - depends on !(KASAN || KCSAN) || CC_HAS_NAMED_AS_FIXED_SANITIZERS 2456 + def_bool CC_HAS_NAMED_AS 2457 + depends on CC_HAS_NAMED_AS_FIXED_SANITIZERS 2456 2458 2457 2459 config CC_HAS_SLS 2458 2460 def_bool $(cc-option,-mharden-sls=all)