]> www.infradead.org Git - users/jedix/linux-maple.git/commit
x86/traps: Allow custom fixups in handle_bug()
authorPeter Zijlstra <peterz@infradead.org>
Mon, 24 Feb 2025 12:37:07 +0000 (13:37 +0100)
committerIngo Molnar <mingo@kernel.org>
Wed, 26 Feb 2025 11:22:39 +0000 (12:22 +0100)
commite33d805a1005bf7b8a5a53559c81a8e17f0b981b
tree465a6d08da0467b990a94b5f88883836daa300ab
parent2e044911be75ce3321c5b3d10205ac0b54f8cb92
x86/traps: Allow custom fixups in handle_bug()

The normal fixup in handle_bug() is simply continuing at the next
instruction. However upcoming patches make this the wrong thing, so
allow handlers (specifically handle_cfi_failure()) to over-ride
regs->ip.

The callchain is such that the fixup needs to be done before it is
determined if the exception is fatal, as such, revert any changes in
that case.

Additionally, have handle_cfi_failure() remember the regs->ip value it
starts with for reporting.

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Reviewed-by: Kees Cook <kees@kernel.org>
Link: https://lore.kernel.org/r/20250224124200.275223080@infradead.org
arch/x86/kernel/cfi.c
arch/x86/kernel/traps.c