Re: [PATCH v5 3/6] x86/asm: Fix VDSO DWARF generation with kernel IBT enabled

From
Josh Poimboeuf <jpoimboe@kernel.org>
Date
2025-04-23 00:44:41
Also in
lkml
Reply to
Steven Rostedt, 2025-04-22
On Tue, Apr 22, 2025 at 02:34:42PM -0400, Steven Rostedt wrote:
From: Josh Poimboeuf <jpoimboe@kernel.org>

The DWARF .cfi_startproc annotation needs to be at the very beginning of
a function.  But with kernel IBT that doesn't happen as ENDBR is
sneakily embedded in SYM_FUNC_START.  As a result the DWARF unwinding
info is wrong at the beginning of all the VDSO functions.

Fix it by adding CFI_STARTPROC and CFI_ENDPROC to SYM_FUNC_START_* and
SYM_FUNC_END respectively.  Note this only affects VDSO, as the CFI_*
macros are empty for the kernel proper.

Fixes: c4691712b546 ("x86/linkage: Add ENDBR to SYM_FUNC_START*()")
Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
[ Fixed rebased issues. May need extra review ]
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
---
Changes since v4: https://lore.kernel.org/all/5c7992c111adee94e242fbca2b3e64ab8e96e595.1737511963.git.jpoimboe@kernel.org/ (local)

- Rebased to latest kernel which had changes to the ENDBR caused by:
  582077c94052 ("x86/cfi: Clean up linkage")
The code looks good, though that bug was already fixed up by
582077c94052 ("x86/cfi: Clean up linkage").  So this is really just a
cleanup now.  The "Fixes" tag can be removed, with the commit log
something like: 

Add CFI_STARTPROC and CFI_ENDPROC annotations to the SYM_FUNC_* macros
so the VDSO asm functions don't need to add them manually.  Note this
only affects VDSO, the CFI_* macros are empty for the kernel proper.

-- 
Josh
Thread (9 messages) 9 messages, 2 authors, last reply 2025-04-23
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help