diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c index 2fdba33..93af749 100644 --- a/arch/x86/kernel/process.c +++ b/arch/x86/kernel/process.c @@ -167,7 +167,8 @@ int copy_thread(unsigned long clone_flags, unsigned long sp, unsigned long arg, * Clone current's PKRU value from hardware. tsk->thread.pkru * is only valid when scheduled out. */ - p->thread.pkru = rdpkru(); + if (cpu_feature_enabled(X86_FEATURE_OSPKE)) + p->thread.pkru = rdpkru(); frame->bx = 0; *childregs = *current_pt_regs();