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: <Ym/wvdBuvFuHzw15@hirez.programming.kicks-ass.net>
Date:   Mon, 2 May 2022 16:54:53 +0200
From:   Peter Zijlstra <peterz@...radead.org>
To:     Marco Elver <elver@...gle.com>
Cc:     x86@...nel.org, jpoimboe@...hat.com, linux-kernel@...r.kernel.org,
        jbaron@...mai.com, rostedt@...dmis.org, ardb@...nel.org,
        kernel test robot <lkp@...el.com>
Subject: Re: [PATCH v2 3/3] jump_label,noinstr: Avoid instrumentation for
 JUMP_LABEL=n builds

On Mon, May 02, 2022 at 03:25:14PM +0200, Marco Elver wrote:
> On Mon, May 02, 2022 at 03:09PM +0200, Peter Zijlstra wrote:
> > 
> > Subject: jump_label,noinstr: Avoid instrumentation for JUMP_LABEL=n builds
> > From: Peter Zijlstra <peterz@...radead.org>
> > Date: Mon May  2 12:30:20 CEST 2022
> > 
> > When building x86_64 with JUMP_LABEL=n it's possible for
> > instrumentation to sneak into noinstr:
> > 
> > vmlinux.o: warning: objtool: exit_to_user_mode+0x14: call to static_key_count.constprop.0() leaves .noinstr.text section
> > vmlinux.o: warning: objtool: syscall_exit_to_user_mode+0x2d: call to static_key_count.constprop.0() leaves .noinstr.text section
> > vmlinux.o: warning: objtool: irqentry_exit_to_user_mode+0x1b: call to static_key_count.constprop.0() leaves .noinstr.text section
> > 
> > Reported-by: kernel test robot <lkp@...el.com>
> > Signed-off-by: Peter Zijlstra (Intel) <peterz@...radead.org>
> > ---
> >  include/linux/jump_label.h |    4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> > 
> > --- a/include/linux/jump_label.h
> > +++ b/include/linux/jump_label.h
> > @@ -256,9 +256,9 @@ extern void static_key_disable_cpuslocke
> >  #include <linux/atomic.h>
> >  #include <linux/bug.h>
> >  
> > -static inline int static_key_count(struct static_key *key)
> > +static __always_inline int static_key_count(struct static_key *key)
> >  {
> > -	return atomic_read(&key->enabled);
> > +	return arch_atomic_read(&key->enabled.count);
> 
> Curious if this compiles - s/.count// ?

It does if you have JUMP_LABEL=y... (-:

*sigh*... how I about I go back to mowing the lawn and try again
later...

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ