From: Johannes Berg <johannes@sipsolutions.net>
To: "Gustavo A. R. Silva" <gustavoars@kernel.org>
Cc: linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-hardening@vger.kernel.org, Kees Cook <kees@kernel.org>
Subject: Re: [PATCH 3/5][next] uapi: wireless: Avoid -Wflex-array-member-not-at-end warnings
Date: Wed, 16 Oct 2024 11:06:31 +0200 [thread overview]
Message-ID: <e4debfb8fff961e889cf333a95132f5ed6687928.camel@sipsolutions.net> (raw)
In-Reply-To: <d9e9d9c1ade33701172b069e7dea728b063b00ee.1729037131.git.gustavoars@kernel.org>
On Tue, 2024-10-15 at 18:31 -0600, 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.
>
> Address the following warnings by changing the type of the middle struct
> members in various composite structs, which are currently causing trouble,
> from `struct sockaddr` to `struct sockaddr_legacy`. Note that the latter
> struct doesn't contain a flexible-array member.
>
> include/uapi/linux/wireless.h:751:33: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end]
> include/uapi/linux/wireless.h:776:25: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end]
> include/uapi/linux/wireless.h:833:25: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end]
> include/uapi/linux/wireless.h:857:25: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end]
> include/uapi/linux/wireless.h:864:25: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end]
>
> No binary differences are present after these changes.
I don't see how this works if you introduce "struct sockaddr_legacy" in
a non-UAPI header, but then use it in UAPI?!
Also, userspace might have pointers to it or whatnot, and warn/break if
you change the type?
johannes
next prev parent reply other threads:[~2024-10-16 9:06 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-16 0:25 [PATCH 0/5][next] net: Avoid thousands of " Gustavo A. R. Silva
2024-10-16 0:27 ` [PATCH 1/5][next] net: dev: Introduce struct sockaddr_legacy Gustavo A. R. Silva
2024-10-16 3:30 ` Kuniyuki Iwashima
2024-10-22 17:07 ` Gustavo A. R. Silva
2024-10-22 12:13 ` David Laight
2024-10-22 17:30 ` Gustavo A. R. Silva
2024-10-16 0:29 ` [PATCH 2/5][next] nfsd: avoid -Wflex-array-member-not-at-end warnings Gustavo A. R. Silva
2024-10-16 14:16 ` Chuck Lever
2024-10-17 0:51 ` NeilBrown
2024-10-16 0:31 ` [PATCH 3/5][next] uapi: wireless: Avoid " Gustavo A. R. Silva
2024-10-16 9:06 ` Johannes Berg [this message]
2024-10-16 0:32 ` [PATCH 4/5][next] uapi: net: arp: " Gustavo A. R. Silva
2024-10-16 3:44 ` Kuniyuki Iwashima
2024-10-16 12:30 ` Andrew Lunn
2024-10-16 16:45 ` Kees Cook
2024-10-18 18:55 ` Gustavo A. R. Silva
2024-10-16 0:33 ` [PATCH 5/5][next] uapi: net: " Gustavo A. R. Silva
2024-10-16 3:51 ` Kuniyuki Iwashima
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=e4debfb8fff961e889cf333a95132f5ed6687928.camel@sipsolutions.net \
--to=johannes@sipsolutions.net \
--cc=gustavoars@kernel.org \
--cc=kees@kernel.org \
--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
all inboxes | Powered by JetHome®