Skip to content

Commit ddc4ba7

Browse files
a3a3elgregkh
authored andcommitted
netfilter: ip6_tables: zero-initialize fragment offset
[ Upstream commit 310e2d4 ] ip6tables only sets the `IP6T_F_PROTO` flag on a rule if a protocol is specified (`-p tcp`, for example). However, if the flag is not set, `ip6_packet_match` doesn't call `ipv6_find_hdr` for the skb, in which case the fragment offset is left uninitialized and a garbage value is passed to each matcher. Signed-off-by: Jeremy Sowden <jeremy@azazel.net> Reviewed-by: Florian Westphal <fw@strlen.de> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent ddf026d commit ddc4ba7

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

net/ipv6/netfilter/ip6_tables.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,7 @@ ip6t_do_table(struct sk_buff *skb,
273273
* things we don't know, ie. tcp syn flag or ports). If the
274274
* rule is also a fragment-specific rule, non-fragments won't
275275
* match it. */
276+
acpar.fragoff = 0;
276277
acpar.hotdrop = false;
277278
acpar.state = state;
278279

0 commit comments

Comments
 (0)