From: Kees Cook <kees@kernel.org>
To: "Gustavo A. R. Silva" <gustavoars@kernel.org>
Cc: Johannes Berg <johannes@sipsolutions.net>,
Jeff Johnson <jjohnson@kernel.org>,
linux-wireless@vger.kernel.org, ath12k@lists.infradead.org,
linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org
Subject: Re: [PATCH][next] wifi: ath12k: core.h: Avoid -Wflex-array-member-not-at-end warnings
Date: Mon, 7 Apr 2025 11:39:34 -0700 [thread overview]
Message-ID: <202504071138.98D5B6E@keescook> (raw)
In-Reply-To: <Z8-Snz86Xfwdlyd7@kspp>
On Tue, Mar 11, 2025 at 12:02:15PM +1030, Gustavo A. R. Silva wrote:
> -Wflex-array-member-not-at-end was introduced in GCC-14, and we are
> getting ready to enable it, globally.
>
> Move the conflicting declaration to the end of the structure. Notice
> that `struct ieee80211_chanctx_conf` is a flexible structure --a
> structure that contains a flexible-array member.
>
> Fix 30 of the following warnings:
>
> drivers/net/wireless/ath/ath12k/core.h:298:39: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end]
>
> Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Hi, just checking in on this patch. Is some adjustment needed for this
to land?
Thanks!
-Kees
> ---
> drivers/net/wireless/ath/ath12k/core.h | 8 +++++++-
> 1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/wireless/ath/ath12k/core.h b/drivers/net/wireless/ath/ath12k/core.h
> index 3fac4f00d383..d6b4c4d2c400 100644
> --- a/drivers/net/wireless/ath/ath12k/core.h
> +++ b/drivers/net/wireless/ath/ath12k/core.h
> @@ -295,7 +295,6 @@ struct ath12k_link_vif {
> int txpower;
> bool rsnie_present;
> bool wpaie_present;
> - struct ieee80211_chanctx_conf chanctx;
> u8 vdev_stats_id;
> u32 punct_bitmap;
> u8 link_id;
> @@ -303,6 +302,13 @@ struct ath12k_link_vif {
> struct ath12k_rekey_data rekey_data;
>
> u8 current_cntdown_counter;
> +
> + /* Must be last - ends in a flexible-array member.
> + *
> + * FIXME: Driver should not copy struct ieee80211_chanctx_conf,
> + * especially because it has a flexible array. Find a better way.
> + */
> + struct ieee80211_chanctx_conf chanctx;
> };
>
> struct ath12k_vif {
> --
> 2.43.0
>
--
Kees Cook
next prev parent reply other threads:[~2025-04-07 18:39 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-11 1:32 [PATCH][next] wifi: ath12k: core.h: Avoid -Wflex-array-member-not-at-end warnings Gustavo A. R. Silva
2025-04-07 18:39 ` Kees Cook [this message]
2025-04-07 18:45 ` Jeff Johnson
2025-04-07 20:29 ` Kees Cook
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202504071138.98D5B6E@keescook \
--to=kees@kernel.org \
--cc=ath12k@lists.infradead.org \
--cc=gustavoars@kernel.org \
--cc=jjohnson@kernel.org \
--cc=johannes@sipsolutions.net \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).