aboutsummaryrefslogtreecommitdiff
path: root/net/bridge
diff options
context:
space:
mode:
authorSarveshwar Bandi <sarveshwar.bandi@emulex.com>2012-10-10 01:15:01 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-02-14 10:49:07 -0800
commit94fab0a18e9cbec420c58c7b12b93acf1663c3fd (patch)
tree3257222639a169f5a25876ad2bca46dbddce426b /net/bridge
parentf641de91169472dc398fbd971cef380ad8d0f787 (diff)
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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net/bridge')
-rw-r--r--net/bridge/br_netfilter.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/net/bridge/br_netfilter.c b/net/bridge/br_netfilter.c
index d7f49b63ab0..e54ef82fdad 100644
--- a/net/bridge/br_netfilter.c
+++ b/net/bridge/br_netfilter.c
@@ -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);