diff options
author | Sarveshwar Bandi <sarveshwar.bandi@emulex.com> | 2012-10-10 01:15:01 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-10-10 22:50:45 -0400 |
commit | 6caab7b0544e83e6c160b5e80f5a4a7dd69545c7 (patch) | |
tree | a46d917a1365ab6e2e2367c48f015bee45b20b5b /net | |
parent | 435f08a721919a0027ff4f39f0b51c141c0e2c29 (diff) | |
download | linux-3.10-6caab7b0544e83e6c160b5e80f5a4a7dd69545c7.tar.gz linux-3.10-6caab7b0544e83e6c160b5e80f5a4a7dd69545c7.tar.bz2 linux-3.10-6caab7b0544e83e6c160b5e80f5a4a7dd69545c7.zip |
bridge: Pull ip header into skb->data before looking into ip header.
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>
Diffstat (limited to 'net')
-rw-r--r-- | net/bridge/br_netfilter.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/net/bridge/br_netfilter.c b/net/bridge/br_netfilter.c index 68e8f364bbf..fe43bc7b063 100644 --- a/net/bridge/br_netfilter.c +++ b/net/bridge/br_netfilter.c @@ -265,6 +265,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); |