Re: [PATCH] Revert "x86/fpu: Refine and simplify the magic number check during signal return"
From: Chang S. Bae
Date: Wed Apr 29 2026 - 17:44:46 EST
On 4/29/2026 1:44 PM, Andrei Vagin wrote:
Sorry, I don't get your version of ABI.
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.
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