* [PATCH nf] netfilter: ip6_tables: zero-initialize fragment offset
@ 2021-09-12 21:24 Jeremy Sowden
2021-09-12 23:39 ` Florian Westphal
2021-09-15 15:01 ` Pablo Neira Ayuso
0 siblings, 2 replies; 4+ messages in thread
From: Jeremy Sowden @ 2021-09-12 21:24 UTC (permalink / raw)
To: Pablo Neira Ayuso; +Cc: Netfilter Devel
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>
---
net/ipv6/netfilter/ip6_tables.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/net/ipv6/netfilter/ip6_tables.c b/net/ipv6/netfilter/ip6_tables.c
index de2cf3943b91..a579ea14a69b 100644
--- a/net/ipv6/netfilter/ip6_tables.c
+++ b/net/ipv6/netfilter/ip6_tables.c
@@ -273,6 +273,7 @@ ip6t_do_table(struct sk_buff *skb,
* things we don't know, ie. tcp syn flag or ports). If the
* rule is also a fragment-specific rule, non-fragments won't
* match it. */
+ acpar.fragoff = 0;
acpar.hotdrop = false;
acpar.state = state;
--
2.33.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH nf] netfilter: ip6_tables: zero-initialize fragment offset
2021-09-12 21:24 [PATCH nf] netfilter: ip6_tables: zero-initialize fragment offset Jeremy Sowden
@ 2021-09-12 23:39 ` Florian Westphal
2021-09-13 9:28 ` Jeremy Sowden
2021-09-15 15:01 ` Pablo Neira Ayuso
1 sibling, 1 reply; 4+ messages in thread
From: Florian Westphal @ 2021-09-12 23:39 UTC (permalink / raw)
To: Jeremy Sowden; +Cc: Pablo Neira Ayuso, Netfilter Devel
Jeremy Sowden <jeremy@azazel.net> wrote:
> 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.
Fixes: f7108a20dee44 ("netfilter: xtables: move extension arguments into compound structure (1/6)"
Reviewed-by: Florian Westphal <fw@strlen.de>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH nf] netfilter: ip6_tables: zero-initialize fragment offset
2021-09-12 23:39 ` Florian Westphal
@ 2021-09-13 9:28 ` Jeremy Sowden
0 siblings, 0 replies; 4+ messages in thread
From: Jeremy Sowden @ 2021-09-13 9:28 UTC (permalink / raw)
To: Florian Westphal; +Cc: Pablo Neira Ayuso, Netfilter Devel
[-- Attachment #1: Type: text/plain, Size: 597 bytes --]
On 2021-09-13, at 01:39:00 +0200, Florian Westphal wrote:
> Jeremy Sowden <jeremy@azazel.net> wrote:
> > 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.
>
> Fixes: f7108a20dee44 ("netfilter: xtables: move extension arguments into compound structure (1/6)"
> Reviewed-by: Florian Westphal <fw@strlen.de>
Thanks, Florian.
J.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH nf] netfilter: ip6_tables: zero-initialize fragment offset
2021-09-12 21:24 [PATCH nf] netfilter: ip6_tables: zero-initialize fragment offset Jeremy Sowden
2021-09-12 23:39 ` Florian Westphal
@ 2021-09-15 15:01 ` Pablo Neira Ayuso
1 sibling, 0 replies; 4+ messages in thread
From: Pablo Neira Ayuso @ 2021-09-15 15:01 UTC (permalink / raw)
To: Jeremy Sowden; +Cc: Netfilter Devel
On Sun, Sep 12, 2021 at 10:24:33PM +0100, Jeremy Sowden wrote:
> 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.
Applied, thanks.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2021-09-15 15:01 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-12 21:24 [PATCH nf] netfilter: ip6_tables: zero-initialize fragment offset Jeremy Sowden
2021-09-12 23:39 ` Florian Westphal
2021-09-13 9:28 ` Jeremy Sowden
2021-09-15 15:01 ` Pablo Neira Ayuso
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.