diff options
author | Sarveshwar Bandi <sarveshwar.bandi@emulex.com> | 2012-10-10 01:15:01 +0000 |
---|---|---|
committer | Ben Hutchings <ben@decadent.org.uk> | 2013-02-20 03:15:39 +0000 |
commit | 335c3391c34f5a607ca63d606f9b2d9f747bab4a (patch) | |
tree | 9d8a4a139d87e9fabad2f3c7eba91f5fde207ac0 /net/bridge | |
parent | f507e6ef54020383b4012778606f84b1e22f4667 (diff) | |
download | linux-rt-335c3391c34f5a607ca63d606f9b2d9f747bab4a.tar.gz |
bridge: Pull ip header into skb->data before looking into ip header.
[ 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: Ben Hutchings <ben@decadent.org.uk>
Diffstat (limited to 'net/bridge')
-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 577ea5df8282..7c1745d3b4b6 100644 --- a/net/bridge/br_netfilter.c +++ b/net/bridge/br_netfilter.c @@ -245,6 +245,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); |