[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1531436398.2965.18.camel@intel.com>
Date: Thu, 12 Jul 2018 15:59:58 -0700
From: Yu-cheng Yu <yu-cheng.yu@...el.com>
To: Dave Hansen <dave.hansen@...ux.intel.com>, x86@...nel.org,
"H. Peter Anvin" <hpa@...or.com>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, linux-kernel@...r.kernel.org,
linux-doc@...r.kernel.org, linux-mm@...ck.org,
linux-arch@...r.kernel.org, linux-api@...r.kernel.org,
Arnd Bergmann <arnd@...db.de>,
Andy Lutomirski <luto@...capital.net>,
Balbir Singh <bsingharora@...il.com>,
Cyrill Gorcunov <gorcunov@...il.com>,
Florian Weimer <fweimer@...hat.com>,
"H.J. Lu" <hjl.tools@...il.com>, Jann Horn <jannh@...gle.com>,
Jonathan Corbet <corbet@....net>,
Kees Cook <keescook@...omiun.org>,
Mike Kravetz <mike.kravetz@...cle.com>,
Nadav Amit <nadav.amit@...il.com>,
Oleg Nesterov <oleg@...hat.com>, Pavel Machek <pavel@....cz>,
Peter Zijlstra <peterz@...radead.org>,
"Ravi V. Shankar" <ravi.v.shankar@...el.com>,
Vedvyas Shanbhogue <vedvyas.shanbhogue@...el.com>
Subject: Re: [RFC PATCH v2 18/27] x86/cet/shstk: Introduce WRUSS instruction
On Tue, 2018-07-10 at 16:48 -0700, Dave Hansen wrote:
> >
> > +/*
> > + * WRUSS is a kernel instrcution and but writes to user
> > + * shadow stack memory. When a fault occurs, both
> > + * X86_PF_USER and X86_PF_SHSTK are set.
> > + */
> > +static int is_wruss(struct pt_regs *regs, unsigned long error_code)
> > +{
> > + return (((error_code & (X86_PF_USER | X86_PF_SHSTK)) ==
> > + (X86_PF_USER | X86_PF_SHSTK)) && !user_mode(regs));
> > +}
> I thought X86_PF_USER was set based on the mode in which the fault
> occurred. Does this mean that the architecture of this bit is different
> now?
Yes.
> That seems like something we need to call out if so. It also means we
> need to update the SDM because some of the text is wrong.
It needs to mention the WRUSS case.
>
> >
> > static void
> > show_fault_oops(struct pt_regs *regs, unsigned long error_code,
> > unsigned long address)
> > @@ -848,7 +859,7 @@ __bad_area_nosemaphore(struct pt_regs *regs, unsigned long error_code,
> > struct task_struct *tsk = current;
> >
> > /* User mode accesses just cause a SIGSEGV */
> > - if (error_code & X86_PF_USER) {
> > + if ((error_code & X86_PF_USER) && !is_wruss(regs, error_code)) {
> > /*
> > * It's possible to have interrupts off here:
> > */
> This needs commenting about why is_wruss() is special.
Ok.
Powered by blists - more mailing lists