[PATCH 03/11] objtool: Add asm version of STACK_FRAME_NON_STANDARD
Yuxuan Luo
yuxuan.luo at canonical.com
Wed Apr 17 23:53:53 UTC 2024
From: Josh Poimboeuf <jpoimboe at redhat.com>
To be used for adding asm functions to the ignore list. The "aw" is
needed to help the ELF section metadata match GCC-created sections.
Otherwise the linker creates duplicate sections instead of combining
them.
Signed-off-by: Josh Poimboeuf <jpoimboe at redhat.com>
Link: https://lore.kernel.org/r/8faa476f9a5ac89af27944ec184c89f95f3c6c49.1611263462.git.jpoimboe@redhat.com
(backported from commit 081df94301e317e84c3413686043987da2c3e39d)
[yuxuan.luo: applied changes for include/linux/objtool.h to
include/linux/frame.h.
]
CVE-2024-2201
Signed-off-by: Yuxuan Luo <yuxuan.luo at canonical.com>
---
include/linux/frame.h | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/include/linux/frame.h b/include/linux/frame.h
index d946adb5de178..7046eeeece9b5 100644
--- a/include/linux/frame.h
+++ b/include/linux/frame.h
@@ -29,13 +29,22 @@
.long 999b; \
.popsection;
+.macro STACK_FRAME_NON_STANDARD func:req
+ .pushsection .discard.func_stack_frame_non_standard, "aw"
+ .long \func - .
+ .popsection
+.endm
#endif /* __ASSEMBLY__ */
#else /* !CONFIG_STACK_VALIDATION */
#define STACK_FRAME_NON_STANDARD(func)
-#define ANNOTATE_INTRA_FUNCTION_CALL
+#ifdef __ASSEMBLY__
+#define ANNOTATE_INTRA_FUNCTION_CALL
+.macro STACK_FRAME_NON_STANDARD func:req
+.endm
+#endif /* __ASSEMBLY__ */
#endif /* CONFIG_STACK_VALIDATION */
#endif /* _LINUX_FRAME_H */
--
2.34.1
More information about the kernel-team
mailing list