lkml.org 
[lkml]   [2018]   [Nov]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [RFC PATCH] x86/mm/fault: Allow stack access below %rsp
On Mon, Nov 5, 2018 at 9:20 AM Dave Hansen <dave.hansen@intel.com> wrote:
>
>
> On 11/4/18 9:14 PM, Andy Lutomirski wrote:
> > I should add: if this patch is *not* applied, then I think we'll
> > need to replace the sw_error_code check with user_mode(regs) to avoid
> > an info leak if CET is enabled. Because, with CET, WRUSS will allow
> > a *kernel* mode access (where regs->sp is the kernel stack pointer)
> > with user permissions.
>
> Are you saying that WRUSS, if it faults will set the "user" page fault
> error code bit? I seem to have some rough recollection about it being
> that way, and the shadow-stack spec does say:
>
> paging access control checks will be treated as a user-mode
> shadow stack store
>

I believe so, and it would make sense for it to work this way. I
would love some instructions for directly accessing normal user
memory, too. Maybe a prefix?

> But the SDM says:
>
> For all instruction fetches and most data accesses, this
> distinction is determined by the current privilege level (CPL):
> accesses made while CPL < 3 are supervisor-mode accesses, while
> accesses made while CPL = 3 are user-mode accesses.
>
> It would certainly be ideal if things affecting the core architecture
> like this were in the SDM itself before we merged them. It makes things
> like this a lot easier to figure out.

Agreed. The current documentation situation is not so good.

\
 
 \ /
  Last update: 2018-11-05 20:22    [W:0.046 / U:0.520 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site