lkml.org 
[lkml]   [2018]   [Sep]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] x86/pkeys: Explicitly treat PK #PF on kernel address as a bad area
From
Date
On 09/04/2018 02:27 PM, Andy Lutomirski wrote:
> Also, I doubt it matters right here, but !X86_PF_USER isn't quite the
> same thing as "originating from kernel code" -- it can also be user
> code that does a CPL0 access due to exception delivery or access to a
> descriptor table. Which you saw plenty of times while debugging
> PTI... :) I doubt any of those should be spurious, though.

Yeah, you're talking about "implicit supervisor access". Right?

I definitely saw those during KAISER/KPTI development. But, it's
probably worth noting that the code that we have that _looks_ for these:

> /*
> * It's safe to allow irq's after cr2 has been saved and the
> * vmalloc fault has been handled.
> *
> * User-mode registers count as a user access even for any
> * potential system fault or CPU buglet:
> */
> if (user_mode(regs)) {
> local_irq_enable();
> error_code |= X86_PF_USER;
> flags |= FAULT_FLAG_USER;

is in the user address space handling portion of the code. So, it's
really not useful for any of the _known_ implicit supervisor-mode
accesses. I think it can only get triggered in the case of hardware or
software bugs.

\
 
 \ /
  Last update: 2018-09-05 23:37    [W:1.118 / U:0.168 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site