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: <20200610084605.GB6844@myrica>
Date:   Wed, 10 Jun 2020 10:46:05 +0200
From:   Jean-Philippe Brucker <jean-philippe@...aro.org>
To:     Andrii Nakryiko <andriin@...com>
Cc:     bpf@...r.kernel.org, netdev@...r.kernel.org, ast@...com,
        daniel@...earbox.net, andrii.nakryiko@...il.com, kernel-team@...com
Subject: Re: [PATCH bpf] libbpf: handle GCC noreturn-turned-volatile quirk

On Tue, Jun 09, 2020 at 10:23:35PM -0700, Andrii Nakryiko wrote:
> Handle a GCC quirk of emitting extra volatile modifier in DWARF (and
> subsequently preserved in BTF by pahole) for function pointers marked as
> __attribute__((noreturn)). This was the way to mark such functions before GCC
> 2.5 added noreturn attribute. Drop such func_proto modifiers, similarly to how
> it's done for array (also to handle GCC quirk/bug).
> 
> Such volatile attribute is emitted by GCC only, so existing selftests can't
> express such test. Simple repro is like this (compiled with GCC + BTF
> generated by pahole):
> 
>   struct my_struct {
>       void __attribute__((noreturn)) (*fn)(int);
>   };
>   struct my_struct a;
> 
> Without this fix, output will be:
> 
> struct my_struct {
>     voidvolatile  (*fn)(int);
> };
> 
> With the fix:
> 
> struct my_struct {
>     void (*fn)(int);
> };
> 
> Reported-by: Jean-Philippe Brucker <jean-philippe@...aro.org>
> Fixes: 351131b51c7a ("libbpf: add btf_dump API for BTF-to-C conversion")
> Signed-off-by: Andrii Nakryiko <andriin@...com>

Thanks, this fixes the issue I was seeing with the arm64 vmlinux

Tested-by: Jean-Philippe Brucker <jean-philippe@...aro.org>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ