x86/alternative: Report missing return thunk details
PATCH 1/1 x86/alternative: Report missing return thunk details
Debugging missing return thunks is easier if we can see where they're happening.
Suggested-by Peter Zijlstra <[email protected]>
Cc Peter Zijlstra <[email protected]>
Signed-off-by Kees Cook <[email protected]>
--- arch/x86/kernel/alternative.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
arch/x86/kernel/alternative.c +3 -1
@@ -555,7 +555,9 @@ void __init_or_module noinline apply_returns(s32 *start, s32 *end) dest = addr + insn.length + insn.immediate.value;if (__static_call_fixup (addr, op, dest) || -WARN_ON_ONCE (dest != &__x86_return_thunk)) +WARN_ONCE (dest != &__x86_return_thunk, +"missing return thunk: %pS-%pS: %*ph" , + addr, dest,5 , addr))continue ; DPRINTK("return thunk at: %pS (%px) len: %d to: %pS",
Signature · 1 line
2.32.0
Quoted 17 lines · Kees Cook
Debugging missing return thunks is easier if we can see where they're happening.
Suggested-by Peter Zijlstra <[email protected]>Cc Peter Zijlstra <[email protected]>Signed-off-by Kees Cook <[email protected]>--- arch/x86/kernel/alternative.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)arch/x86/kernel/alternative.c +0
-0
arch/x86/kernel/alternative.c void __init_or_module noinline apply_returns(s32 *start, s32 *end) · line 560
Quoted 7 lines
arch/x86/kernel/alternative.c +3
-1@@ -555,7 +555,9 @@ void __init_or_module noinline apply_returns(s32 *start, s32 *end) dest = addr + insn.length + insn.immediate.value;if (__static_call_fixup (addr, op, dest) || -WARN_ON_ONCE (dest != &__x86_return_thunk)) +WARN_ONCE (dest != &__x86_return_thunk, +"missing return thunk: %pS-%pS: %*ph" , + addr, dest,5 , addr))
String needs a newline?
Signature · 1 line
Josh