OpenCloudOS-Kernel/drivers/misc/lkdtm
Kees Cook 1fc82121d0 lkdtm: Disable CFI checking for perms functions
[ Upstream commit fb28a8862dc4b5bf8e44578338f35d9c6c68339d ]

The EXEC_RODATA test plays a lot of tricks to live in the .rodata section,
and once again ran into objtool's (completely reasonable) assumptions
that executable code should live in an executable section. However, this
manifested only under CONFIG_CFI_CLANG=y, as one of the .cfi_sites was
pointing into the .rodata section.

Since we're testing non-CFI execution properties in perms.c (and
rodata.c), we can disable CFI for the involved functions, and remove the
CFI arguments from rodata.c entirely.

Reported-by: kernel test robot <oliver.sang@intel.com>
Closes: https://lore.kernel.org/oe-lkp/202308301532.d7acf63e-oliver.sang@intel.com
Fixes: 6342a20efb ("objtool: Add elf_create_section_pair()")
Link: https://lore.kernel.org/r/20240430234953.work.760-kees@kernel.org
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-06-12 11:11:34 +02:00
..
Makefile lkdtm: Disable CFI checking for perms functions 2024-06-12 11:11:34 +02:00
bugs.c lkdtm: Add FAM_BOUNDS test for __counted_by 2023-08-17 16:46:35 -07: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: replace ll_rw_block with submit_bh 2023-05-31 20:26:57 +01:00
fortify.c lkdtm: Update tests for memcpy() run-time warnings 2022-09-07 16:37:27 -07:00
heap.c fortify: Use __builtin_dynamic_object_size() when available 2023-01-05 12:08:29 -08:00
lkdtm.h lkdtm: Move crashtype definitions into each category 2022-04-12 16:16:48 -07:00
perms.c lkdtm: Disable CFI checking for perms functions 2024-06-12 11:11:34 +02: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 lkdtm/stackleak: Fix noinstr violation 2023-04-14 16:08:26 +02:00
usercopy.c treewide: Drop function_nocfi 2022-09-26 10:13:14 -07:00