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]
Message-ID: <20200519082926.GB279861@hirez.programming.kicks-ass.net>
Date:   Tue, 19 May 2020 10:29:26 +0200
From:   Peter Zijlstra <peterz@...radead.org>
To:     Thomas Gleixner <tglx@...utronix.de>
Cc:     LKML <linux-kernel@...r.kernel.org>, x86@...nel.org,
        "Paul E. McKenney" <paulmck@...nel.org>,
        Andy Lutomirski <luto@...nel.org>,
        Alexandre Chartre <alexandre.chartre@...cle.com>,
        Frederic Weisbecker <frederic@...nel.org>,
        Paolo Bonzini <pbonzini@...hat.com>,
        Sean Christopherson <sean.j.christopherson@...el.com>,
        Masami Hiramatsu <mhiramat@...nel.org>,
        Petr Mladek <pmladek@...e.com>,
        Steven Rostedt <rostedt@...dmis.org>,
        Joel Fernandes <joel@...lfernandes.org>,
        Boris Ostrovsky <boris.ostrovsky@...cle.com>,
        Juergen Gross <jgross@...e.com>,
        Brian Gerst <brgerst@...il.com>,
        Mathieu Desnoyers <mathieu.desnoyers@...icios.com>,
        Josh Poimboeuf <jpoimboe@...hat.com>,
        Will Deacon <will@...nel.org>,
        Tom Lendacky <thomas.lendacky@....com>,
        Wei Liu <wei.liu@...nel.org>,
        Michael Kelley <mikelley@...rosoft.com>,
        Jason Chen CJ <jason.cj.chen@...el.com>,
        Zhao Yakui <yakui.zhao@...el.com>
Subject: Re: [patch V6 00/37] x86/entry: Rework leftovers and merge plan

On Mon, May 18, 2020 at 08:53:49PM +0200, Thomas Gleixner wrote:
> Peter Zijlstra <peterz@...radead.org> writes:
> > So on top of you entry-v8-full; I had to chase one of those
> > instrumentation_end() escapes an (extended) basic block chase (again!).
> >  
> > +#ifdef CONFIG_DEBUG_ENTRY
> 
> Why this? We lose the kprobes runtime protection that way.

Oh bugger indeed. I forgot about that :-(

I added the CONFIG_DEBUG_ENTRY dependency to
instrumentation_{begin,end}() because they now emit actual code, and I
figured we shouldn't bother 'production' kernels with all them extra
NOPs.

And then I figured (wrongly!) that since I have that, I might as well
add noinstr to is.

> > +/* Section for code which can't be instrumented at all */
> > +#define noinstr								\
> > +	noinline notrace __attribute((__section__(".noinstr.text")))
> > +
> >  /* Begin/end of an instrumentation safe region */
> > -#define instrumentation_begin() ({						\
> > +#define instrumentation_begin() ({					\
> >  	asm volatile("%c0:\n\t"						\
> >  		     ".pushsection .discard.instr_begin\n\t"		\
> >  		     ".long %c0b - .\n\t"				\
> >  		     ".popsection\n\t" : : "i" (__COUNTER__));
> 
> Nifty.

Yeah, took a bit of fiddling because objtool is a bit weird vs UD2, but
if you order it just right in the WARN thing it works :-)

You want a new delta without the noinstr thing on?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ