Skip to content
Commit 3c1940c5 authored by Kyle Huey's avatar Kyle Huey Committed by Greg Kroah-Hartman
Browse files

x86/fpu: Emulate XRSTOR's behavior if the xfeatures PKRU bit is not set

commit d7e5acea upstream

The hardware XRSTOR instruction resets the PKRU register to its hardware
init value (namely 0) if the PKRU bit is not set in the xfeatures mask.
Emulating that here restores the pre-5.14 behavior for PTRACE_SET_REGSET
with NT_X86_XSTATE, and makes sigreturn (which still uses XRSTOR) and
behave identically.

Fixes: e84ba47e

 ("x86/fpu: Hook up PKRU into ptrace()")
Signed-off-by: default avatarKyle Huey <me@kylehuey.com>
Signed-off-by: default avatarDave Hansen <dave.hansen@linux.intel.com>
Link: https://lore.kernel.org/all/20221115230932.7126-6-khuey%40kylehuey.com
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 3f1c8142
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment