* [PATCH v2][next] tls: Avoid -Wflex-array-member-not-at-end warning
@ 2025-09-23 20:45 Gustavo A. R. Silva
2025-09-24 20:18 ` Sabrina Dubroca
2025-09-25 0:50 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 3+ messages in thread
From: Gustavo A. R. Silva @ 2025-09-23 20:45 UTC (permalink / raw)
To: Sabrina Dubroca, John Fastabend, Jakub Kicinski, David S. Miller,
Eric Dumazet, Paolo Abeni, Simon Horman
Cc: netdev, linux-kernel, Gustavo A. R. Silva, linux-hardening
Remove unused flexible-array member in struct tls_rec and, with this,
fix the following warning:
net/tls/tls.h:131:29: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end]
Also, add a comment to prevent people from adding any members
after struct aead_request, which is a flexible structure --this is
a structure that ends in a flexible-array member.
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
---
Changes in v2:
- Remove unused flex array. (Sabrina Dubroca).
- Update changelog text.
v1:
- Link: https://lore.kernel.org/linux-hardening/aNFfmBLEoDSBSLJe@kspp/
net/tls/tls.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/net/tls/tls.h b/net/tls/tls.h
index 4e077068e6d9..06d462c57284 100644
--- a/net/tls/tls.h
+++ b/net/tls/tls.h
@@ -128,8 +128,9 @@ struct tls_rec {
char aad_space[TLS_AAD_SPACE_SIZE];
u8 iv_data[TLS_MAX_IV_SIZE];
+
+ /* Must be last --ends in a flexible-array member. */
struct aead_request aead_req;
- u8 aead_req_ctx[];
};
int __net_init tls_proc_init(struct net *net);
--
2.43.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v2][next] tls: Avoid -Wflex-array-member-not-at-end warning
2025-09-23 20:45 [PATCH v2][next] tls: Avoid -Wflex-array-member-not-at-end warning Gustavo A. R. Silva
@ 2025-09-24 20:18 ` Sabrina Dubroca
2025-09-25 0:50 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: Sabrina Dubroca @ 2025-09-24 20:18 UTC (permalink / raw)
To: Gustavo A. R. Silva
Cc: John Fastabend, Jakub Kicinski, David S. Miller, Eric Dumazet,
Paolo Abeni, Simon Horman, netdev, linux-kernel, linux-hardening
Thanks for the updated patch.
A process nit: the correct subject prefix for this type of work within
networking would be [PATCH net-next v2] (indicating it targets the
"net-next" tree).
2025-09-23, 22:45:10 +0200, Gustavo A. R. Silva wrote:
> Remove unused flexible-array member in struct tls_rec and, with this,
> fix the following warning:
>
> net/tls/tls.h:131:29: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end]
>
> Also, add a comment to prevent people from adding any members
> after struct aead_request, which is a flexible structure --this is
> a structure that ends in a flexible-array member.
Once that warning is enabled, re-adding a field after aead_req will
not be allowed by the compiler, right? The comment is probably not
really needed, but since there are "must be first" comments all over
include/net, I guess it's useful.
Reviewed-by: Sabrina Dubroca <sd@queasysnail.net>
--
Sabrina
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2][next] tls: Avoid -Wflex-array-member-not-at-end warning
2025-09-23 20:45 [PATCH v2][next] tls: Avoid -Wflex-array-member-not-at-end warning Gustavo A. R. Silva
2025-09-24 20:18 ` Sabrina Dubroca
@ 2025-09-25 0:50 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-09-25 0:50 UTC (permalink / raw)
To: Gustavo A. R. Silva
Cc: sd, john.fastabend, kuba, davem, edumazet, pabeni, horms, netdev,
linux-kernel, linux-hardening
Hello:
This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Tue, 23 Sep 2025 22:45:10 +0200 you wrote:
> Remove unused flexible-array member in struct tls_rec and, with this,
> fix the following warning:
>
> net/tls/tls.h:131:29: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end]
>
> Also, add a comment to prevent people from adding any members
> after struct aead_request, which is a flexible structure --this is
> a structure that ends in a flexible-array member.
>
> [...]
Here is the summary with links:
- [v2,next] tls: Avoid -Wflex-array-member-not-at-end warning
https://git.kernel.org/netdev/net-next/c/b6db19d1df8a
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-09-25 0:50 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-23 20:45 [PATCH v2][next] tls: Avoid -Wflex-array-member-not-at-end warning Gustavo A. R. Silva
2025-09-24 20:18 ` Sabrina Dubroca
2025-09-25 0:50 ` patchwork-bot+netdevbpf
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).