]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
bridge: Pull ip header into skb->data before looking into ip header.
authorSarveshwar Bandi <sarveshwar.bandi@emulex.com>
Wed, 10 Oct 2012 01:15:01 +0000 (01:15 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 14 Feb 2013 18:49:07 +0000 (10:49 -0800)
[ Upstream commit 6caab7b0544e83e6c160b5e80f5a4a7dd69545c7 ]

If lower layer driver leaves the ip header in the skb fragment, it needs to
be first pulled into skb->data before inspecting ip header length or ip version
number.

Signed-off-by: Sarveshwar Bandi <sarveshwar.bandi@emulex.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/bridge/br_netfilter.c

index d7f49b63ab0fd17b82828f60278b5f8a99664a1d..e54ef82fdad761b6ddca437d43c7bdcd3a5327ac 100644 (file)
@@ -254,6 +254,9 @@ static int br_parse_ip_options(struct sk_buff *skb)
        struct net_device *dev = skb->dev;
        u32 len;
 
+       if (!pskb_may_pull(skb, sizeof(struct iphdr)))
+               goto inhdr_error;
+
        iph = ip_hdr(skb);
        opt = &(IPCB(skb)->opt);