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: <2025012955-hypnotic-patronize-8931@gregkh>
Date: Wed, 29 Jan 2025 06:54:48 +0100
From: Greg KH <gregkh@...uxfoundation.org>
To: "Gustavo A. R. Silva" <gustavoars@...nel.org>
Cc: Dan Carpenter <dan.carpenter@...aro.org>, linux-kernel@...r.kernel.org,
	linux-hardening@...r.kernel.org
Subject: Re: [PATCH v2][next] container_of: add container_first() macro

On Wed, Jan 29, 2025 at 03:56:01PM +1030, Gustavo A. R. Silva wrote:
> This is like container_of_const() but it contains an assert to
> ensure that it's using the first member in the structure.

But why?  If you "know" it's the first member, just do a normal cast.
If you don't, then you probably shouldn't be caring about this anyway,
right?

> 
> Co-developed-by: Dan Carpenter <dan.carpenter@...aro.org>
> Signed-off-by: Dan Carpenter <dan.carpenter@...aro.org>
> Signed-off-by: Gustavo A. R. Silva <gustavoars@...nel.org>
> ---
> 
> I will be using this in my -Wflex-array-member-not-at-end patches. :)

Confused, I'd like to see some users first please.

thanks,

greg k-h

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ