linux/drivers/misc/lkdtm
Mark Rutland f03a50938d lkdtm/stackleak: prevent unexpected stack usage
The lkdtm_STACKLEAK_ERASING() test is instrumentable and runs with IRQs
unmasked, so it's possible for unrelated code to clobber the task stack
and/or manipulate current->lowest_stack while the test is running,
resulting in spurious failures.

The regular stackleak erasing code is non-instrumentable and runs with
IRQs masked, preventing similar issues.

Make the body of the test non-instrumentable, and run it with IRQs
masked, avoiding such spurious failures.

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Cc: Alexander Popov <alex.popov@linux.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Will Deacon <will@kernel.org>
Signed-off-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/20220427173128.2603085-11-mark.rutland@arm.com
2022-05-08 01:33:08 -07:00
..
bugs.c lkdtm: avoid printk() in recursive_loop() 2021-12-16 15:54:37 -08:00
cfi.c lkdtm: Add CONFIG hints in errors where possible 2021-06-24 15:32:08 +02:00
core.c lkdtm: Add a test for function descriptors protection 2022-02-16 23:25:12 +11:00
fortify.c lkdtm/fortify: Swap memcpy() for strncpy() 2022-02-25 12:11:01 +01:00
heap.c lkdtm/heap: Avoid __alloc_size hint warning for VMALLOC_LINEAR_OVERFLOW 2021-08-18 22:28:51 +02:00
lkdtm.h lkdtm: Add a test for function descriptors protection 2022-02-16 23:25:12 +11:00
Makefile Char/Misc and other driver changes for 5.17-rc1 2022-01-14 16:02:28 +01:00
perms.c lkdtm: Add a test for function descriptors protection 2022-02-16 23:25:12 +11:00
powerpc.c lkdtm/powerpc: Add SLB multihit test 2020-12-04 01:01:34 +11:00
refcount.c
rodata.c lkdtm: don't move ctors to .rodata 2020-12-09 15:51:14 +01:00
stackleak.c lkdtm/stackleak: prevent unexpected stack usage 2022-05-08 01:33:08 -07:00
usercopy.c lkdtm: Add CONFIG hints in errors where possible 2021-06-24 15:32:08 +02:00