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: <aPetqHmBYf63AL3p@horms.kernel.org>
Date: Tue, 21 Oct 2025 16:58:32 +0100
From: Simon Horman <horms@...nel.org>
To: "Gustavo A. R. Silva" <gustavoars@...nel.org>
Cc: "David S. Miller" <davem@...emloft.net>,
	Eric Dumazet <edumazet@...gle.com>,
	Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
	netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
	linux-hardening@...r.kernel.org
Subject: Re: [PATCH][next] net: inet_sock.h: Avoid thousands of
 -Wflex-array-member-not-at-end warnings

On Tue, Oct 21, 2025 at 12:43:30PM +0100, Gustavo A. R. Silva wrote:
> Use the new TRAILING_OVERLAP() helper to fix 2600 of the following
> warnings:
> 
> 2600 ./include/net/inet_sock.h:65:33: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end]
> 
> This helper creates a union between a flexible-array member (FAM)
> and a set of members that would otherwise follow it (in this case
> `char data[40];) This overlays the trailing members (data) onto the FAM
> (__data) while keeping the FAM and the start of MEMBERS aligned.
> 
> The static_assert() ensures this alignment remains, and it's
> intentionally placed inmediately after `struct ip_options_data`
> (no blank line in between).
> 
> Signed-off-by: Gustavo A. R. Silva <gustavoars@...nel.org>
> ---
> 
> I think it's worth mentioning that the introduction of the new
> TRAILING_OVERLAP() helper saves us from making changes like the
> following, for this particular case:
> 
> 	https://lore.kernel.org/linux-hardening/ZzK-n_C2yl8mW2Tz@kspp/

Thanks,

I was able to reproduce a (small) subset of those warnings
and agree that this is a very nice way to address them.

Reviewed-by: Simon Horman <horms@...nel.org>

...

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ