]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
um: fix SECCOMP 32bit xstate register restore
authorBenjamin Berg <benjamin.berg@intel.com>
Wed, 4 Jun 2025 08:17:05 +0000 (10:17 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Wed, 4 Jun 2025 09:40:36 +0000 (11:40 +0200)
commit942349413a49670e8bed246e2185fd3a053227be
tree5a41e0747567daae892cc3153211f973add7e1db
parente92e2552858142b60238b9828d802f128e4acccd
um: fix SECCOMP 32bit xstate register restore

There was a typo that caused the extended FP state to be copied into the
wrong location on 32 bit. On 32 bit we only store the xstate internally
as that already contains everything. However, for compatibility, the
mcontext on 32 bit first contains the legacy FP state and then the
xstate.

The code copied the xstate on top of the legacy FP state instead of
using the correct offset. This offset was already calculated in the
xstate_* variables, so simply switch to those to fix the problem.

With this SECCOMP mode works on 32 bit, so lift the restriction.

Fixes: b1e1bd2e6943 ("um: Add helper functions to get/set state for SECCOMP")
Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
Link: https://patch.msgid.link/20250604081705.934112-1-benjamin@sipsolutions.net
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
arch/um/os-Linux/start_up.c
arch/x86/um/os-Linux/mcontext.c