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:   Tue,  5 Jan 2021 16:43:51 -0800
From:   Nick Desaulniers <>
To:     Andy Lutomirski <>,
        Thomas Gleixner <>,
        Ingo Molnar <>, Borislav Petkov <>
Cc:     Nick Desaulniers <>,
        Fangrui Song <>,
        Arnd Bergmann <>,
        Josh Poimboeuf <>,,
        "H. Peter Anvin" <>,
        Nathan Chancellor <>,,
Subject: [PATCH v2] x86/entry: use STB_GLOBAL for register restoring thunk

Arnd found a randconfig that produces the warning:

arch/x86/entry/thunk_64.o: warning: objtool: missing symbol for insn at
offset 0x3e

when building with LLVM_IAS=1 (use Clang's integrated assembler). Josh

  With the LLVM assembler stripping the .text section symbol, objtool
  has no way to reference this code when it generates ORC unwinder
  entries, because this code is outside of any ELF function.

Fangrui notes that this is helpful for reducing images size when
compiling with -ffunction-sections and -fdata-sections. I have observerd
on the order of tens of thousands of symbols for the kernel images built
with those flags. A patch has been authored against GNU binutils to
match this behavior, with a new flag

Use a global symbol for the thunk that way
objtool can generate proper unwind info here with LLVM_IAS=1.

Cc: Fangrui Song <>
Reported-by: Arnd Bergmann <>
Suggested-by: Josh Poimboeuf <>
Acked-by: Josh Poimboeuf <>
Signed-off-by: Nick Desaulniers <>
Changes v1 -> v2:
* Pick up Josh's Ack.
* Add commit message info about -ffunction-sections/-fdata-sections, and
  link to binutils patch.

 arch/x86/entry/thunk_64.S | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/x86/entry/thunk_64.S b/arch/x86/entry/thunk_64.S
index ccd32877a3c4..878816034a73 100644
--- a/arch/x86/entry/thunk_64.S
+++ b/arch/x86/entry/thunk_64.S
@@ -31,7 +31,7 @@ SYM_FUNC_START_NOALIGN(\name)
 	call \func
-	jmp  .L_restore
+	jmp  __thunk_restore
@@ -44,7 +44,7 @@ SYM_FUNC_END(\name)
 	popq %r11
 	popq %r10
 	popq %r9
@@ -56,6 +56,6 @@ SYM_CODE_START_LOCAL_NOALIGN(.L_restore)
 	popq %rdi
 	popq %rbp
-	_ASM_NOKPROBE(.L_restore)
+	_ASM_NOKPROBE(__thunk_restore)

Powered by blists - more mailing lists