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] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 21 Mar 2019 11:05:06 -0700
From:   Andy Lutomirski <luto@...capital.net>
To:     Peter Zijlstra <peterz@...radead.org>
Cc:     Steven Rostedt <rostedt@...dmis.org>,
        Juergen Gross <jgross@...e.com>,
        LKML <linux-kernel@...r.kernel.org>,
        "H. Peter Anvin" <hpa@...or.com>,
        Thomas Gleixner <tglx@...utronix.de>,
        Ingo Molnar <mingo@...nel.org>, Borislav Petkov <bp@...en8.de>,
        Joel Fernandes <joel@...lfernandes.org>,
        He Zhe <zhe.he@...driver.com>,
        Linus Torvalds <torvalds@...ux-foundation.org>
Subject: Re: [RFC][PATCH] tracing/x86: Save CR2 before tracing irqsoff on error_entry

On Thu, Mar 21, 2019 at 10:22 AM Peter Zijlstra <peterz@...radead.org> wrote:
>
> On Thu, Mar 21, 2019 at 09:32:42AM -0400, Steven Rostedt wrote:
> > On Thu, 21 Mar 2019 11:45:17 +0100
> > Peter Zijlstra <peterz@...radead.org> wrote:
> >
> > > -   .if \paranoid
> > > +   .if \read_cr2
> > > +   mov     %cr2, %rdx                      /* XXX paravirt crap */
> > > +   .endif
> > > +
> >
> > I'm guessing this breaks paravirt, as that's one reason I didn't add
> > the read_rc in assembly.
>
> Still completely missing 32bit support.. but this has paravirt bits on.
>
> It changes the read_cr2 stuff to CALLEE_SAVED and implements it in asm
> to only require AX, this means that asm can use it without it clobbering
> all volatile regs.
>
> My compiler also tripped over the KVM asyn pagefault stuff, which I also
> converted to use the new form.
>
> Again, completely untested. And given that the last one just worked,
> this one will _have_ to explode and let the magic smoke out :-)
>

Ugh.

I certainly agree in principle that sticking the CR2 read into the asm
is the right solution.  But this patch makes the spaghetti even more
tangled.  Maybe we can rearrange the code a bit so that the entry
sequence saves at least one register before calling error_entry, so we
can do it the obvious way.

In the long run, I think the right solution is to rewrite even more of
this mess in C.  We really ought to be able to put the IRQ flag
tracing and the context tracking into C code.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ