Re: [PATCH] x86/kexec: Push kjump return address even for non-kjump kexec
From: Dave Hansen
Date: Tue Apr 28 2026 - 10:22:24 EST
On 4/2/26 03:34, David Woodhouse wrote:
> The version of purgatory code shipped by kexec-tools attempts to look
> above the top of its stack to find a return address for a kjump
This is a bug in kexec-tools, right? Has kexec-tools been fixed?
The purgatory code is injected by userspace, so are you kinda asserting
here that the this change in the kernel stack "breaks userspace"?
I guess one little push isn't the end of the world. But, can we please
comment it to this effect:
/*
* Work around a kexec-tools' <version here> purgatory bug that
* accesses the stack one long out of bounds. Push a dummy value
* to make the access harmless and avoid a fault.
*/
Without that, we'll be scratching our heads for the next decade about
what this 0 on the stack does. The comment you suggested tells us what
it is doing, but not why.
It all feels kinda icky though. Our stack is an ABI?!?!?!