[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Wed, 13 Oct 2021 17:22:35 +0200
From: Ard Biesheuvel <ardb@...nel.org>
To: linux-arm-kernel@...ts.infradead.org
Cc: linux-hardening@...r.kernel.org, mark.rutland@....com,
catalin.marinas@....com, will@...nel.org,
Ard Biesheuvel <ardb@...nel.org>
Subject: [RFC PATCH 1/9] arm64: assembler: enable PAC for non-leaf assembler routines
Enable pointer signing and authentication when preserving and restoring
the linker register to/from the stack for assembler routines that use
the frame_push and frame_pop macros to set up their stack frames. This
protects the return address from inadvertent modification while stored
in memory.
Signed-off-by: Ard Biesheuvel <ardb@...nel.org>
---
arch/arm64/include/asm/assembler.h | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/arch/arm64/include/asm/assembler.h b/arch/arm64/include/asm/assembler.h
index 89faca0e740d..ceed84ac4005 100644
--- a/arch/arm64/include/asm/assembler.h
+++ b/arch/arm64/include/asm/assembler.h
@@ -665,6 +665,9 @@ alternative_endif
* for locals.
*/
.macro frame_push, regcount:req, extra
+#ifdef CONFIG_ARM64_PTR_AUTH_KERNEL
+ paciasp
+#endif
__frame st, \regcount, \extra
.endm
@@ -676,6 +679,9 @@ alternative_endif
*/
.macro frame_pop
__frame ld
+#ifdef CONFIG_ARM64_PTR_AUTH_KERNEL
+ autiasp
+#endif
.endm
.macro __frame_regs, reg1, reg2, op, num
--
2.30.2
Powered by blists - more mailing lists