[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20220207073350.GB1951@kadam>
Date: Mon, 7 Feb 2022 10:33:50 +0300
From: Dan Carpenter <dan.carpenter@...cle.com>
To: "Gustavo A. R. Silva" <gustavoars@...nel.org>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
linux-staging@...ts.linux.dev, linux-kernel@...r.kernel.org,
linux-hardening@...r.kernel.org
Subject: Re: [PATCH][next] staging: wlan-ng: Replace one-element arrays with
flexible-array members
On Fri, Feb 04, 2022 at 05:30:15PM -0600, Gustavo A. R. Silva wrote:
> There is a regular need in the kernel to provide a way to declare having
> a dynamically sized set of trailing elements in a structure. Kernel code
> should always use “flexible array members”[1] for these cases. The older
> style of one-element or zero-length arrays should no longer be used[2].
>
> This helps with the ongoing efforts to globally enable -Warray-bounds
> and get us closer to being able to tighten the FORTIFY_SOURCE routines
> on memcpy().
>
> This issue was found with the help of Coccinelle and audited and fixed,
> manually.
How are you auditing this manually? I have to re-audit it manually
myself as a reviewer and I'm find it tricky.
> /*-- IBSS Parameter Set ---------------------------*/
> @@ -288,7 +288,7 @@ struct wlan_ie_ibss_parms {
> struct wlan_ie_challenge {
> u8 eid;
> u8 len;
> - u8 challenge[1];
> + u8 challenge[];
> } __packed;
This is dead code. It would have been better to just delete that. I
have a lot of experience at reviewing "Delete Dead Code" patches.
regards,
dan carpenter
Powered by blists - more mailing lists