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
| ||
|
Message-ID: <20250317120849.347f9a26@jic23-huawei> Date: Mon, 17 Mar 2025 12:08:49 +0000 From: Jonathan Cameron <jic23@...nel.org> To: Tzung-Bi Shih <tzungbi@...nel.org> Cc: "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: proximity: cros_ec_mkbp_proximity: Avoid -Wflex-array-member-not-at-end warning On Mon, 17 Mar 2025 01:36:58 +0000 Tzung-Bi Shih <tzungbi@...nel.org> wrote: > On Mon, Mar 17, 2025 at 11:25:40AM +1030, Gustavo A. R. Silva wrote: > > static int cros_ec_mkbp_proximity_query(struct cros_ec_device *ec_dev, > > int *state) > > { > > - struct { > > - struct cros_ec_command msg; > > - union { > > - struct ec_params_mkbp_info params; > > - u32 switches; > > - }; > > - } __packed buf = { }; > > - struct ec_params_mkbp_info *params = &buf.params; > > - struct cros_ec_command *msg = &buf.msg; > > - u32 *switches = &buf.switches; > > + DEFINE_RAW_FLEX(struct cros_ec_command, buf, data, sizeof(u32)); > > max(sizeof(struct ec_params_mkbp_info), sizeof(u32))? If not (I assume same reason as previous case), then maybe an assert that sizeof(struct ec_params_mkbp_info) <= sizeof(u32)?
Powered by blists - more mailing lists