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: <CAMuHMdUwt9_zU_2ytSMOoB1VJqZYwonHTZd-bSzpXxRwj2+XfA@mail.gmail.com>
Date: Tue, 24 Sep 2024 20:30:30 +0200
From: Geert Uytterhoeven <geert@...ux-m68k.org>
To: Miguel Ojeda <miguel.ojeda.sandonis@...il.com>
Cc: Tony Ambardar <tony.ambardar@...il.com>, Daniel Borkmann <daniel@...earbox.net>, 
	Miguel Ojeda <ojeda@...nel.org>, Jiri Olsa <jolsa@...nel.org>, 
	Andrew Morton <akpm@...ux-foundation.org>, Arnd Bergmann <arnd@...db.de>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] compiler-gcc.h: Disable __retain on gcc-11

Hi Miguel,

On Tue, Sep 24, 2024 at 7:21 PM Miguel Ojeda
<miguel.ojeda.sandonis@...il.com> wrote:
> On Tue, Sep 24, 2024 at 3:55 PM Geert Uytterhoeven
> <geert+renesas@...der.be> wrote:
> > All my gcc-11 compilers (Ubuntu 11.4.0-1ubuntu1~22.04) claim to support
> > the __retain__ attribute, but only riscv64-linux-gnu-gcc-11 and
> > x86_64-linux-gnu-gcc-11 (not x86_64-linux-gnux32-gcc-11!) actually do.
> > The arm-linux-gnueabi-gcc-11.5.0 compiler from kernel.org crosstool
> > fails in the same way:
> >
> >     error: ‘retain’ attribute ignored [-Werror=attributes]
>
> That appears to be the case indeed:
>
>     https://godbolt.org/z/78Gj94vMW
>
> The `.section` does not get emitted, so the warning appears to be
> right, but we cannot trust `__has_attribute` for this :(
>
> > Fixes: 0a5d3258d7c97295 ("compiler_types.h: Define __retain for __attribute__((__retain__))")
>
> Nit: 12 char hash.

I should really update and resend my patch to sync all (different) values and
ranges spread across the Linux kernel documentation. And didn't we reach
2^24 objects in git a while ago, so conflicts are imminent?

> > +/*
> > + * Most 11.x compilers claim to support it, but only riscv64-linux-gnu-gcc and
> > + * x86_64-linux-gnu-gcc actually do.
> > + */
>
> Just to confirm: did you try all? If not, perhaps we should say "at
> least X does not work" instead.

What's your definition of "all"? ;-)

  1. All compilers available on Ubuntu 22.04LTS:

      aarch64-linux-gnu-gcc-11
      alpha-linux-gnu-gcc-11
      arm-linux-gnueabi-gcc-11
      arm-linux-gnueabihf-gcc-11
      hppa64-linux-gnu-gcc-11
      hppa-linux-gnu-gcc-11
      i686-linux-gnu-gcc-11
      m68k-linux-gnu-gcc-11
      powerpc64le-linux-gnu-gcc-11
      powerpc64-linux-gnu-gcc-11
      powerpc-linux-gnu-gcc-11
      riscv64-linux-gnu-gcc-11
      s390x-linux-gnu-gcc-11
      sh4-linux-gnu-gcc-11
      sparc64-linux-gnu-gcc-11
      x86_64-linux-gnu-gcc-11
      x86_64-linux-gnux32-gcc-11

  2. A few from kernel.org crosstool:

      ia64-linux-gcc-11.1.0
      sh2eb-linux-muslfdpic-gcc-11.2.0
      arm-linux-gnueabi-gcc-11.5.0

  3. A compiler from the J-Core folks:

      sh2eb-linux-muslfdpic-gcc-11.2.0

> > +#if GCC_VERSION < 120000
> > +#undef __retain
> > +#define __retain
> > +#endif
>
> Should this go into the conditional in `compiler_types.h` instead? And
> perhaps the `__has__attribute` test removed for GCC?

AFAIK, the gcc-specifics are in compiler-gcc.h...

> Even if we keep it here, I think at least a comment there should be
> added, since it says GCC >= 11 supports it, which can be confusing if
> one is not aware of this other thing in this file.

Fair enough....

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@...ux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ