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: <20250317120447.4fa26083@jic23-huawei>
Date: Mon, 17 Mar 2025 12:04:47 +0000
From: Jonathan Cameron <jic23@...nel.org>
To: "Gustavo A. R. Silva" <gustavo@...eddedor.com>
Cc: Tzung-Bi Shih <tzungbi@...nel.org>, "Gustavo A. R. Silva"
 <gustavoars@...nel.org>, Lars-Peter Clausen <lars@...afoo.de>, Benson Leung
 <bleung@...omium.org>, Guenter Roeck <groeck@...omium.org>,
 linux-iio@...r.kernel.org, chrome-platform@...ts.linux.dev,
 linux-kernel@...r.kernel.org, linux-hardening@...r.kernel.org
Subject: Re: [PATCH][next] iio: cros_ec: Avoid
 -Wflex-array-member-not-at-end warning

On Mon, 17 Mar 2025 15:10:38 +1030
"Gustavo A. R. Silva" <gustavo@...eddedor.com> wrote:

> On 17/03/25 12:02, Tzung-Bi Shih wrote:
> > On Mon, Mar 17, 2025 at 11:24:59AM +1030, Gustavo A. R. Silva wrote:  
> >>   static int cros_ec_get_host_cmd_version_mask(struct cros_ec_device *ec_dev,
> >>   					     u16 cmd_offset, u16 cmd, u32 *mask)
> >>   {
> >> +	DEFINE_RAW_FLEX(struct cros_ec_command, buf, data,
> >> +			sizeof(struct ec_response_get_cmd_versions));  
> > 
> > max(sizeof(struct ec_params_get_cmd_versions),
> >      sizeof(struct ec_response_get_cmd_versions))?  
> 
> I considered that, but DEFINE_RAW_FLEX() complains about it due to the
> 
> _Static_assert(__builtin_constant_p(count),				\
> 		       "onstack flex array members require compile-time const count");
> 
Maybe add an assert that you indeed have the larger of the two + a comment
on why it matters?

> --
> Gustavo
> 


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ