linux-stable/tools/testing/selftests/lkdtm
Ricardo Cañuelo cf77bf6988 selftests/lkdtm: Disable CONFIG_UBSAN_TRAP in test config
The lkdtm selftest config fragment enables CONFIG_UBSAN_TRAP to make the
ARRAY_BOUNDS test kill the calling process when an out-of-bound access
is detected by UBSAN. However, after this [1] commit, UBSAN is triggered
under many new scenarios that weren't detected before, such as in struct
definitions with fixed-size trailing arrays used as flexible arrays. As
a result, CONFIG_UBSAN_TRAP=y has become a very aggressive option to
enable except for specific situations.

`make kselftest-merge` applies CONFIG_UBSAN_TRAP=y to the kernel config
for all selftests, which makes many of them fail because of system hangs
during boot.

This change removes the config option from the lkdtm kselftest and
configures the ARRAY_BOUNDS test to look for UBSAN reports rather than
relying on the calling process being killed.

[1] commit 2d47c6956a ("ubsan: Tighten UBSAN_BOUNDS on GCC")'

Signed-off-by: Ricardo Cañuelo <ricardo.canuelo@collabora.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/20230802063252.1917997-1-ricardo.canuelo@collabora.com
Signed-off-by: Kees Cook <keescook@chromium.org>
2023-09-28 16:39:08 -07:00
..
.gitignore lkdtm: Add REPORT_STACK for checking stack offsets 2021-04-08 14:05:20 +02:00
config selftests/lkdtm: Disable CONFIG_UBSAN_TRAP in test config 2023-09-28 16:39:08 -07:00
Makefile lkdtm: Add REPORT_STACK for checking stack offsets 2021-04-08 14:05:20 +02:00
run.sh selftests/lkdtm: Add way to repeat a test 2021-10-25 09:13:46 +02:00
stack-entropy.sh selftest/lkdtm: Skip stack-entropy test if lkdtm is not available 2021-12-16 15:54:38 -08:00
tests.txt selftests/lkdtm: Disable CONFIG_UBSAN_TRAP in test config 2023-09-28 16:39:08 -07:00