]> git.hungrycats.org Git - linux/commitdiff
[NETFILTER]: Missing skb->len check in ip_conntrack_proto_tcp.c:tcp_packet().
authorHarald Welte <laforge@netfilter.org>
Mon, 14 Jun 2004 10:25:21 +0000 (03:25 -0700)
committerHideaki Yoshifuji <yoshfuji@linux-ipv6.org>
Mon, 14 Jun 2004 10:25:21 +0000 (03:25 -0700)
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: Harald Welte <laforge@netfilter.org>
Signed-off-by: David S. Miller <davem@redhat.com>
net/ipv4/netfilter/ip_conntrack_proto_tcp.c

index 9bcb718eca165aae6ccbf65acf28a325e39a46b4..1cc796556f27672a22bcdb8a5e4d565227232c3e 100644 (file)
@@ -177,6 +177,8 @@ static int tcp_packet(struct ip_conntrack *conntrack,
 
        if (skb_copy_bits(skb, skb->nh.iph->ihl * 4, &tcph, sizeof(tcph)) != 0)
                return -1;
+       if (skb->len < skb->nh.iph->ihl * 4 + tcph.doff * 4)
+               return -1;
 
        /* If only reply is a RST, we can consider ourselves not to
           have an established connection: this is a fairly common