summaryrefslogtreecommitdiff
path: root/include/uapi/linux
diff options
context:
space:
mode:
authorEric Woudstra <ericwouds@gmail.com>2026-02-24 16:50:30 +0100
committerJakub Kicinski <kuba@kernel.org>2026-02-25 19:25:08 -0800
commit7717fbb14028be5735acb911aeb7553b7c662418 (patch)
tree442fd021ae60fd99c48ec242e5a7277176dd3f6c /include/uapi/linux
parent8debe7a22309497f42fb963494833b9abd446328 (diff)
downloadlwn-7717fbb14028be5735acb911aeb7553b7c662418.tar.gz
lwn-7717fbb14028be5735acb911aeb7553b7c662418.zip
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 'include/uapi/linux')
-rw-r--r--include/uapi/linux/if_pppox.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/uapi/linux/if_pppox.h b/include/uapi/linux/if_pppox.h
index 9abd80dcc46f..29b804aa7474 100644
--- a/include/uapi/linux/if_pppox.h
+++ b/include/uapi/linux/if_pppox.h
@@ -122,7 +122,9 @@ struct sockaddr_pppol2tpv3in6 {
struct pppoe_tag {
__be16 tag_type;
__be16 tag_len;
+#ifndef __KERNEL__
char tag_data[];
+#endif
} __attribute__ ((packed));
/* Tag identifiers */
@@ -150,7 +152,9 @@ struct pppoe_hdr {
__u8 code;
__be16 sid;
__be16 length;
+#ifndef __KERNEL__
struct pppoe_tag tag[];
+#endif
} __packed;
/* Length of entire PPPoE + PPP header */