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: <CAG=TAF7zVCMLj5US0uw-piwBUSmWpmPSPV3Thjbh7_kGsO88hQ@mail.gmail.com>
Date:   Tue, 19 May 2020 17:45:27 -0400
From:   Qian Cai <cai@....pw>
To:     Marco Elver <elver@...gle.com>
Cc:     Peter Zijlstra <peterz@...radead.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        kasan-dev <kasan-dev@...glegroups.com>,
        Will Deacon <will@...nel.org>,
        Thomas Gleixner <tglx@...utronix.de>,
        "Paul E . McKenney" <paulmck@...nel.org>,
        Ingo Molnar <mingo@...nel.org>
Subject: Re: [PATCH] READ_ONCE, WRITE_ONCE, kcsan: Perform checks in __*_ONCE variants

On Tue, May 19, 2020 at 5:26 PM Marco Elver <elver@...gle.com> wrote:
>
> On Tue, 19 May 2020 at 23:10, Qian Cai <cai@....pw> wrote:
> >
> > On Tue, May 12, 2020 at 3:09 PM Peter Zijlstra <peterz@...radead.org> wrote:
> > >
> > > On Tue, May 12, 2020 at 08:38:39PM +0200, Marco Elver wrote:
> > > > diff --git a/include/linux/compiler.h b/include/linux/compiler.h
> > > > index 741c93c62ecf..e902ca5de811 100644
> > > > --- a/include/linux/compiler.h
> > > > +++ b/include/linux/compiler.h
> > > > @@ -224,13 +224,16 @@ void ftrace_likely_update(struct ftrace_likely_data *f, int val,
> > > >   * atomicity or dependency ordering guarantees. Note that this may result
> > > >   * in tears!
> > > >   */
> > > > -#define __READ_ONCE(x)       (*(const volatile __unqual_scalar_typeof(x) *)&(x))
> > > > +#define __READ_ONCE(x)                                                       \
> > > > +({                                                                   \
> > > > +     kcsan_check_atomic_read(&(x), sizeof(x));                       \
> > > > +     data_race((*(const volatile __unqual_scalar_typeof(x) *)&(x))); \
> > > > +})
> > >
> > > NAK
> > >
> > > This will actively insert instrumentation into __READ_ONCE() and I need
> > > it to not have any.
> >
> > Any way to move this forward? Due to linux-next commit 6bcc8f459fe7
> > (locking/atomics: Flip fallbacks and instrumentation), it triggers a
> > lots of KCSAN warnings due to atomic ops are no longer marked.
>
> This is no longer the right solution we believe due to the various
> requirements that Peter also mentioned. See the discussion here:
>     https://lkml.kernel.org/r/CANpmjNOGFqhtDa9wWpXs2kztQsSozbwsuMO5BqqW0c0g0zGfSA@mail.gmail.com
>
> The new solution is here:
>     https://lkml.kernel.org/r/20200515150338.190344-1-elver@google.com
> While it's a little inconvenient that we'll require Clang 11
> (currently available by building yourself from LLVM repo), but until
> we get GCC fixed (my patch there still pending :-/), this is probably
> the right solution going forward.   If possible, please do test!

That would be quite unfortunate. The version here is still gcc-8.3.1
and clang-9.0.1 on RHEL 8.2 here. It will probably need many years to
be able to get the fixed compilers having versions that high. Sigh...
Also, I want to avoid compiling compilers on my own.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ