lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220429094355.122389-35-chenzhongjin@huawei.com>
Date:   Fri, 29 Apr 2022 17:43:52 +0800
From:   Chen Zhongjin <chenzhongjin@...wei.com>
To:     <linux-kernel@...r.kernel.org>,
        <linux-arm-kernel@...ts.infradead.org>,
        <linux-arch@...r.kernel.org>
CC:     <jthierry@...hat.com>, <catalin.marinas@....com>,
        <will@...nel.org>, <masahiroy@...nel.org>, <jpoimboe@...hat.com>,
        <peterz@...radead.org>, <ycote@...hat.com>,
        <herbert@...dor.apana.org.au>, <mark.rutland@....com>,
        <davem@...emloft.net>, <ardb@...nel.org>, <maz@...nel.org>,
        <tglx@...utronix.de>, <luc.vanoostenryck@...il.com>,
        <chenzhongjin@...wei.com>
Subject: [RFC PATCH v4 34/37] arm64: entry: Annotate valid stack in kernel entry

From: Julien Thierry <jthierry@...hat.com>

When taking an exception/interrupt, add unwind hints to indicate from
which point the stack pointer is known to be valid.

Signed-off-by: Julien Thierry <jthierry@...hat.com>
Signed-off-by: Chen Zhongjin <chenzhongjin@...wei.com>
---
 arch/arm64/kernel/entry.S | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm64/kernel/entry.S b/arch/arm64/kernel/entry.S
index 10fac8f13982..eeb576ec97ba 100644
--- a/arch/arm64/kernel/entry.S
+++ b/arch/arm64/kernel/entry.S
@@ -68,6 +68,7 @@
 	tbnz	x0, #THREAD_SHIFT, 0f
 	sub	x0, sp, x0			// x0'' = sp' - x0' = (sp + x0) - sp = x0
 	sub	sp, sp, x0			// sp'' = sp' - x0 = (sp + x0) - x0 = sp
+	UNWIND_HINT_FUNC sp_offset=S_FRAME_SIZE
 	b	el\el\ht\()_\regsize\()_\label
 
 0:
@@ -100,6 +101,7 @@
 	sub	sp, sp, x0
 	mrs	x0, tpidrro_el0
 #endif
+	UNWIND_HINT_FUNC sp_offset=S_FRAME_SIZE
 	b	el\el\ht\()_\regsize\()_\label
 .org .Lventry_start\@ + 128	// Did we overflow the ventry slot?
 	.endm
-- 
2.17.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ