]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
[PATCH] NETFILTER: nf_conntrack_ipv6: fix crash when handling fragments
authorPatrick McHardy <kaber@trash.net>
Wed, 10 Jan 2007 07:04:47 +0000 (08:04 +0100)
committerChris Wright <chrisw@sous-sol.org>
Mon, 5 Feb 2007 16:31:40 +0000 (08:31 -0800)
When IPv6 connection tracking splits up a defragmented packet into
its original fragments, the packets are taken from a list and are
passed to the network stack with skb->next still set. This causes
dev_hard_start_xmit to treat them as GSO fragments, resulting in
a use after free when connection tracking handles the next fragment.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
net/ipv6/netfilter/nf_conntrack_reasm.c

index bf93c1ea6be9b35cb699378d0352a4fe74724e8b..7745caff8c3bd56e4b6b9513b53f7035595dabc1 100644 (file)
@@ -835,6 +835,8 @@ void nf_ct_frag6_output(unsigned int hooknum, struct sk_buff *skb,
                s->nfct_reasm = skb;
 
                s2 = s->next;
+               s->next = NULL;
+
                NF_HOOK_THRESH(PF_INET6, hooknum, s, in, out, okfn,
                               NF_IP6_PRI_CONNTRACK_DEFRAG + 1);
                s = s2;