summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorEric Woudstra <ericwouds@gmail.com>2026-02-24 18:50:30 +0300
committerJakub Kicinski <kuba@kernel.org>2026-02-26 06:25:08 +0300
commit7717fbb14028be5735acb911aeb7553b7c662418 (patch)
tree442fd021ae60fd99c48ec242e5a7277176dd3f6c /drivers
parent8debe7a22309497f42fb963494833b9abd446328 (diff)
downloadlinux-7717fbb14028be5735acb911aeb7553b7c662418.tar.xz
net: pppoe: avoid zero-length arrays in struct pppoe_hdr
Jakub Kicinski reported following issue in upcoming patches: W=1 C=1 GCC build gives us: net/bridge/netfilter/nf_conntrack_bridge.c: note: in included file (through ../include/linux/if_pppox.h, ../include/uapi/linux/netfilter_bridge.h, ../include/linux/netfilter_bridge.h): include/uapi/linux/if_pppox.h: 153:29: warning: array of flexible structures sparse doesn't like that hdr has a zero-length array which overlaps proto. The kernel code doesn't currently need those arrays. PPPoE connection is functional after applying this patch. Reviewed-by: Nikolay Aleksandrov <razor@blackwall.org> Reviewed-by: Kees Cook <kees@kernel.org> Signed-off-by: Eric Woudstra <ericwouds@gmail.com> Link: https://patch.msgid.link/20260224155030.106918-1-ericwouds@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/ppp/pppoe.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/ppp/pppoe.c b/drivers/net/ppp/pppoe.c
index 4275b393a454..7900cc3212a5 100644
--- a/drivers/net/ppp/pppoe.c
+++ b/drivers/net/ppp/pppoe.c
@@ -885,7 +885,7 @@ static int pppoe_sendmsg(struct socket *sock, struct msghdr *m,
skb->protocol = cpu_to_be16(ETH_P_PPP_SES);
ph = skb_put(skb, total_len + sizeof(struct pppoe_hdr));
- start = (char *)&ph->tag[0];
+ start = (char *)ph + sizeof(*ph);
error = memcpy_from_msg(start, m, total_len);
if (error < 0) {