linux-stable/drivers/misc/lkdtm
Kristina Martsenko f68022ae0a lkdtm: cfi: Make PAC test work with GCC 7 and 8
The CFI test uses the branch-protection=none compiler attribute to
disable PAC return address protection on a function. While newer GCC
versions support this attribute, older versions (GCC 7 and 8) instead
supported the sign-return-address=none attribute, leading to a build
failure when the test is built with older compilers. Fix it by checking
which attribute is supported and using the correct one.

Fixes: 2e53b877dc ("lkdtm: Add CFI_BACKWARD to test ROP mitigations")
Reported-by: Daniel Díaz <daniel.diaz@linaro.org>
Signed-off-by: Kristina Martsenko <kristina.martsenko@arm.com>
Signed-off-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/all/CAEUSe78kDPxQmQqCWW-_9LCgJDFhAeMoVBFnX9QLx18Z4uT4VQ@mail.gmail.com/
2022-12-14 16:05:09 -08:00
..
Makefile lkdtm: Disable return thunks in rodata.c 2022-07-20 19:24:53 +02:00
bugs.c drivers: lkdtm: fix clang -Wformat warning 2022-07-28 16:20:36 +02:00
cfi.c lkdtm: cfi: Make PAC test work with GCC 7 and 8 2022-12-14 16:05:09 -08:00
core.c lkdtm: Move crashtype definitions into each category 2022-04-12 16:16:48 -07:00
fortify.c lkdtm: Update tests for memcpy() run-time warnings 2022-09-07 16:37:27 -07:00
heap.c lkdtm/heap: Hide allocation size from -Warray-bounds 2022-05-17 14:47:08 -07:00
lkdtm.h lkdtm: Move crashtype definitions into each category 2022-04-12 16:16:48 -07:00
perms.c lkdtm: Move crashtype definitions into each category 2022-04-12 16:16:48 -07:00
powerpc.c lkdtm: Move crashtype definitions into each category 2022-04-12 16:16:48 -07:00
refcount.c lkdtm: Move crashtype definitions into each category 2022-04-12 16:16:48 -07:00
rodata.c lkdtm: don't move ctors to .rodata 2020-12-09 15:51:14 +01:00
stackleak.c Char / Misc / Other smaller driver subsystem updates for 5.19-rc1 2022-06-03 11:36:34 -07:00
usercopy.c treewide: Drop function_nocfi 2022-09-26 10:13:14 -07:00