[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <6529a46e-ae83-5ff2-0152-1d5783f271c3@intel.com>
Date: Wed, 5 Sep 2018 14:35:41 -0700
From: Dave Hansen <dave.hansen@...el.com>
To: Andy Lutomirski <luto@...nel.org>
Cc: Sean Christopherson <sean.j.christopherson@...el.com>,
LKML <linux-kernel@...r.kernel.org>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>,
"H. Peter Anvin" <hpa@...or.com>, X86 ML <x86@...nel.org>,
Jann Horn <jannh@...gle.com>
Subject: Re: [PATCH] x86/pkeys: Explicitly treat PK #PF on kernel address as a
bad area
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.
Powered by blists - more mailing lists