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]
Date: Wed, 03 Apr 2024 13:17:05 +0200
From: "Arnd Bergmann" <arnd@...db.de>
To: "Anton Protopopov" <aspsk@...valent.com>,
 "Alexander Lobakin" <aleksander.lobakin@...el.com>
Cc: "Naresh Kamboju" <naresh.kamboju@...aro.org>,
 "open list" <linux-kernel@...r.kernel.org>, lkft-triage@...ts.linaro.org,
 "Linux Regressions" <regressions@...ts.linux.dev>,
 "Anders Roxell" <anders.roxell@...aro.org>,
 "Dan Carpenter" <dan.carpenter@...aro.org>,
 "Daniel Borkmann" <daniel@...earbox.net>, "David Ahern" <dsahern@...nel.org>,
 "Alexei Starovoitov" <ast@...nel.org>,
 "Russell King" <rmk+kernel@...linux.org.uk>,
 "Ard Biesheuvel" <ardb@...nel.org>,
 "Linus Walleij" <linus.walleij@...aro.org>
Subject: Re: include/linux/build_bug.h:78:41: error: static assertion failed: "struct
 bpf_fib_lookup size check"

On Wed, Apr 3, 2024, at 12:09, Anton Protopopov wrote:
> On Wed, Apr 3, 2024 at 11:57 AM Anton Protopopov <aspsk@...valent.com> wrote:
 end.
>>
>> Yeah, I am sending a patch for this right now. Better not to depend on
>> compiler options
>
> One __packed__ was not enough though. The problem was also with the
> union of two __u16's which is padded to be 32 bits when AEABI=n and
> the whole structure is packed (so total size is 66 in this case).

The __packed attribute is easy to misunderstand, in this case you
would need to mark every internal union and struct as well, since
you otherwise run into one or both of these problems:

- an inner aggregate with explicit packing still requires
  32-bit alignment (and padding) for each member, even if the
  outer struct puts it at an unaligned position

- You get a compiler warning if an internal structure
  is follows the normal alignment constraints but is located
  at an unaligned offset, since that violates the alignment
  constraints of the C standard.

      Arnd

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ