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]
Message-ID: <CAK8P3a3Cy_WwtJGLF96tXrqT=hYw50NHy+DbaW2=DEbf_iXUeg@mail.gmail.com>
Date:   Thu, 9 Jan 2020 23:18:19 +0100
From:   Arnd Bergmann <arnd@...db.de>
To:     Andrew Morton <akpm@...ux-foundation.org>
Cc:     Masami Hiramatsu <mhiramat@...nel.org>,
        Oleksandr Natalenko <oleksandr@...hat.com>,
        Linux-MM <linux-mm@...ck.org>,
        Arnaldo Carvalho de Melo <acme@...hat.com>,
        Will Deacon <will@...nel.org>,
        Song Liu <songliubraving@...com>,
        Alexey Dobriyan <adobriyan@...il.com>,
        Marc Zyngier <maz@...nel.org>,
        Thomas Gleixner <tglx@...utronix.de>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] kallsyms: work around bogus -Wrestrict warning

On Thu, Jan 9, 2020 at 11:02 PM Andrew Morton <akpm@...ux-foundation.org> wrote:
>
> On Wed, 8 Jan 2020 10:26:02 +0900 Masami Hiramatsu <mhiramat@...nel.org> wrote:
>
> > Hi Arnd,
> >
> > On Tue,  7 Jan 2020 22:40:26 +0100
> > Arnd Bergmann <arnd@...db.de> wrote:
> >
> > > gcc -O3 produces some really odd warnings for this file:
> > >
> > > kernel/kallsyms.c: In function 'sprint_symbol':
> > > kernel/kallsyms.c:369:3: error: 'strcpy' source argument is the same as destination [-Werror=restrict]
> > >    strcpy(buffer, name);
> > >    ^~~~~~~~~~~~~~~~~~~~
> > > kernel/kallsyms.c: In function 'sprint_symbol_no_offset':
> > > kernel/kallsyms.c:369:3: error: 'strcpy' source argument is the same as destination [-Werror=restrict]
> > >    strcpy(buffer, name);
> > >    ^~~~~~~~~~~~~~~~~~~~
> > > kernel/kallsyms.c: In function 'sprint_backtrace':
> > > kernel/kallsyms.c:369:3: error: 'strcpy' source argument is the same as destination [-Werror=restrict]
> > >    strcpy(buffer, name);
> > >    ^~~~~~~~~~~~~~~~~~~~
> > >
> > > This obviously cannot be since it is preceded by an 'if (name != buffer)'
> > > check.
> >
> > Hmm, this looks like a bug in gcc.
>
> Yes, we're getting a lot of such reports.  I don't think current gcc is
> ready for this patch so I'll drop it, sorry.

I've been building with gcc-8 and got around 20 false positive
warnings, three real bugs
and a few files that introduce increased stack usage. I have sent
patches for every one
of these and have a clean randconfig builds again on arm, arm64 and
x86 (a few thousand
so far).

Most of the false-positive warnings are for understandable reasons and easy to
work around, the one above is probably the most blatant screwup by gcc.

My feeling is that we can deal with the warnings here and I wouldn't
mind getting
it enabled in mainline from that perspective, but there are two caveats:

- v5.6 is probably too early since we're close to the merge window and a lot of
  my fixups have not been merged yet

- I have no good estimate of how many runtime failures there will be.
  Oleksandr hasn't found any issues after running with -O3 kernels for
  a longer time, but any significant change to the toolchain likely causes
  problems for somebody.

        Arnd

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ