[patch V3 0/6] x86/fpu: Mop up XSAVES and related damage

From: Thomas Gleixner
Date: Tue Jun 08 2021 - 10:49:28 EST


syszbot reported a warnon for XRSTOR raising #GP:

https://lore.kernel.org/r/0000000000004c453905c30f8334@xxxxxxxxxx

with a syzcaller reproducer and a conclusive bisect result. It took a
while to destill a simple C reproducer out of it which allowed to pin point
the root cause: The recent addition of supervisor XSTATEs broke the signal
restore path for the case where the signal handler wreckaged the XSTATE on
stack because it does not sanitize the XSTATE header which causes a
subsequent XRSTOR to fail and #GP.

The following series addresses the problem and fixes related issues
which were found while inspecting the related changes and testing
signal restore and PKRU.

V2 of this can be found here:

https://lore.kernel.org/r/20210605234742.712464974@xxxxxxxxxxxxx

Changes vs. V2:

- Drop the cleanup patches for now, so the bug fixes make progress

- Fix the PKRU context switch code

- Address review comments

Thanks,

tglx