Re: [PATCH] Revert "x86/fpu: Refine and simplify the magic number check during signal return"
"Chang S. Bae" <[email protected]> Wed, 29 Apr 2026 14:44:25 -0700
| Newsgroups | dev.linux.lists.criu,org.kernel.vger.linux-kernel,org.kernel.vger.stable |
|---|---|
| Message-ID | <[email protected]> |
On 4/29/2026 1:44 PM, Andrei Vagin wrote:
>
> Enforcing validation against 'fpstate->user_size' instead of the frame's
> own 'fx_sw->xstate_size' changes the kernel ABI, it isn't strengthen the
> sanity check logic. When user-space supplies a valid, self-consistent
> frame with an explicit size that older kernels accepted, and the updated
> logic rejects it, which triggers a userspace regression.
Sorry, I don't get your version of ABI.
Eventually, XRSTOR will execute to restore the state. The kernel tracks
each task's requested feature bitmap (RFBM), which determines the size.
As describe SDM Vol.1, Section 13.13:
An execution of an instruction in the XSAVE feature set may access
any byte of any state component on which that execution operates even
when saving a state component is omitted ...
Given this, the kernel must ensure the backing memory is valid and
sufficient. So this consistency does matter.
Thanks,
Chang