lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Tue, 9 Feb 2021 12:09:48 -0800
From:   Andy Lutomirski <luto@...nel.org>
To:     Borislav Petkov <bp@...en8.de>
Cc:     Andy Lutomirski <luto@...nel.org>, X86 ML <x86@...nel.org>,
        LKML <linux-kernel@...r.kernel.org>,
        Dave Hansen <dave.hansen@...ux.intel.com>,
        Alexei Starovoitov <ast@...nel.org>,
        Daniel Borkmann <daniel@...earbox.net>,
        Yonghong Song <yhs@...com>,
        Masami Hiramatsu <mhiramat@...nel.org>,
        Peter Zijlstra <peterz@...radead.org>
Subject: Re: [PATCH 07/11] x86/fault: Split the OOPS code out from no_context()

On Wed, Feb 3, 2021 at 10:56 AM Borislav Petkov <bp@...en8.de> wrote:
>
> On Sun, Jan 31, 2021 at 09:24:38AM -0800, Andy Lutomirski wrote:
> > Not all callers of no_context() want to run exception fixups.
> > Separate the OOPS code out from the fixup code in no_context().
> >
> > Cc: Dave Hansen <dave.hansen@...ux.intel.com>
> > Cc: Peter Zijlstra <peterz@...radead.org>
> > Signed-off-by: Andy Lutomirski <luto@...nel.org>
> > ---
> >  arch/x86/mm/fault.c | 116 +++++++++++++++++++++++---------------------
> >  1 file changed, 62 insertions(+), 54 deletions(-)
> >
> > diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c
> > index 1939e546beae..6f43d080e1e8 100644
> > --- a/arch/x86/mm/fault.c
> > +++ b/arch/x86/mm/fault.c
> > @@ -618,53 +618,20 @@ static void set_signal_archinfo(unsigned long address,
> >  }
> >
> >  static noinline void
> > -no_context(struct pt_regs *regs, unsigned long error_code,
> > -        unsigned long address, int signal, int si_code)
> > +page_fault_oops(struct pt_regs *regs, unsigned long error_code,
>
> Not sure about this name - it still tries to recover:
> efi_recover_from_page_fault().
>
> Judging by where it is called, maybe no_context_tail() or
> no_context_oops() or no_context_finish_me_already()...
>
> Yah, I haz no better idea. :-\
>
> ...
>
> > @@ -739,6 +692,61 @@ no_context(struct pt_regs *regs, unsigned long error_code,
> >       oops_end(flags, regs, sig);
> >  }
> >
> > +static noinline void
> > +no_context(struct pt_regs *regs, unsigned long error_code,
> > +        unsigned long address, int signal, int si_code)
> > +{
> > +     if (user_mode(regs)) {
> > +             /*
> > +              * This is an implicit supervisor-mode access from user
> > +              * mode.  Bypass all the kernel-mode recovery code and just
> > +              * OOPS.
> > +              */
> > +             goto oops;
>
> Just do
>
>                 return page_fault_oops(...);
>
> here and get rid of the label.

I'm going to skip this one, because that code is deleted later in the
series, and fixing it here just adds more churn.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ