lkml.org 
[lkml]   [2022]   [Feb]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH V8 26/44] x86/fault: Print PKS MSR on fault
On Tue, Feb 01, 2022 at 10:13:40AM -0800, Edgecombe, Rick P wrote:
> On Thu, 2022-01-27 at 09:54 -0800, ira.weiny@intel.com wrote:
> > + if (error_code & X86_PF_PK)
> > + pks_dump_fault_info(regs);
> > +
>
> If the kernel makes an errant accesses to a userspace address with PKU
> enabled and the usersapce page marked AD, it should oops and get here,
> but will the X86_PF_PK bit be set even if smap is the real cause? Per
> the SDM, it sounds like it would:
> "
> For accesses to user-mode addresses, the flag is set if
> (1) CR4.PKE = 1;
> (2) the linear address has protection key i; and
> (3) the PKRU register (see Section 4.6.2) is such that either
> (a) ADi = 1; or
> (b) the following all hold:
> (i) WDi = 1;
> (ii) the access is a write access; and
> (iii) either CR0.WP = 1 or the access causing the
> page-fault exception was a user-mode access.
> "
>
> ...and then this somewhat confusingly dumps the pks register. Is that
> the real behavior?

Are you suggesting the PKRU should be printed instead or in addition to the
PKS?

AFAICS this really should not present a problem even if the fault is due to a
user pkey violation. It is simply extra information.

Ira

\
 
 \ /
  Last update: 2022-02-18 07:02    [W:0.232 / U:0.188 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site