x86/fpu: Hook up PKRU into ptrace()
authorDave Hansen <dave.hansen@linux.intel.com>
Wed, 23 Jun 2021 12:02:19 +0000 (14:02 +0200)
committerBorislav Petkov <bp@suse.de>
Wed, 23 Jun 2021 17:44:24 +0000 (19:44 +0200)
commite84ba47e313dbc097bf859bb6e4f9219883d5f78
tree42558057e84d4b1391640d7fa53606925a2db716
parent9782a712eb971ce483442076e79eb1d8d608646e
x86/fpu: Hook up PKRU into ptrace()

One nice thing about having PKRU be XSAVE-managed is that it gets naturally
exposed into the XSAVE-using ABIs.  Now that XSAVE will not be used to
manage PKRU, these ABIs need to be manually enabled to deal with PKRU.

ptrace() uses copy_uabi_xstate_to_kernel() to collect the tracee's
XSTATE. As PKRU is not in the task's XSTATE buffer, use task->thread.pkru
for filling in up the ptrace buffer.

Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Borislav Petkov <bp@suse.de>
Reviewed-by: Borislav Petkov <bp@suse.de>
Link: https://lkml.kernel.org/r/20210623121456.508770763@linutronix.de
arch/x86/include/asm/fpu/xstate.h
arch/x86/kernel/fpu/regset.c
arch/x86/kernel/fpu/xstate.c