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  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]
Date:   Mon, 24 Jan 2022 18:47:39 +0100
From:   Ard Biesheuvel <>
Cc:, Ard Biesheuvel <>,
        Nicolas Pitre <>,
        Arnd Bergmann <>,
        Kees Cook <>,
        Keith Packard <>,
        Linus Walleij <>,
        Nick Desaulniers <>,
        Tony Lindgren <>,
        Marc Zyngier <>,
        Vladimir Murzin <>,
        Jesse Taube <>
Subject: [PATCH v5 27/32] ARM: memset: clean up unwind annotations

The memset implementation carves up the code in different sections, each
covered with their own unwind info. In this case, it is done in a way
similar to how the compiler might do it, to disambiguate between parts
where the return address is in LR and the SP is unmodified, and parts
where a stack frame is live, and the unwinder needs to know the size of
the stack frame and the location of the return address within it.

Only the placement of the unwind directives is slightly odd: the stack
pushes are placed in the wrong sections, which may confuse the unwinder
when attempting to unwind with PC pointing at the stack push in

So let's fix this up, by reordering the directives and instructions as

Signed-off-by: Ard Biesheuvel <>
Tested-by: Keith Packard <>
Tested-by: Marc Zyngier <>
Tested-by: Vladimir Murzin <> # ARMv7M
 arch/arm/lib/memset.S | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/arch/arm/lib/memset.S b/arch/arm/lib/memset.S
index 9817cb258c1a..d71ab61430b2 100644
--- a/arch/arm/lib/memset.S
+++ b/arch/arm/lib/memset.S
@@ -28,16 +28,16 @@ UNWIND( .fnstart         )
 	mov	r3, r1
 7:	cmp	r2, #16
 	blt	4f
+UNWIND( .fnend              )
 #if ! CALGN(1)+0
  * We need 2 extra registers for this loop - use r8 and the LR
-	stmfd	sp!, {r8, lr}
-UNWIND( .fnend              )
 UNWIND( .fnstart            )
 UNWIND( .save {r8, lr}      )
+	stmfd	sp!, {r8, lr}
 	mov	r8, r1
 	mov	lr, r3
@@ -66,10 +66,9 @@ UNWIND( .fnend              )
  * whole cache lines at once.
-	stmfd	sp!, {r4-r8, lr}
-UNWIND( .fnend                 )
 UNWIND( .fnstart               )
 UNWIND( .save {r4-r8, lr}      )
+	stmfd	sp!, {r4-r8, lr}
 	mov	r4, r1
 	mov	r5, r3
 	mov	r6, r1

Powered by blists - more mailing lists