Re: [PATCH v4 04/10] x86/traps: Allow custom fixups in handle_bug()

Kees Cook
2025-02-24T18:59:25Z

On Mon, Feb 24, 2025 at 01:37:07PM +0100, Peter Zijlstra wrote:
> The normal fixup in handle_bug() is simply continuing at the next
> instruction. However upcomming 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.
>
> Additinoally, have handle_cfi_failure() remember the regs->ip value it

typo above, if you want to tweak that in your tree.

> starts with for reporting.
>
> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>

Thanks for the added comment, my future brain will appreciate it. :)

Reviewed-by: Kees Cook <kees@kernel.org>

--
Kees Cook