diff options
author | Sarveshwar Bandi <sarveshwar.bandi@emulex.com> | 2012-10-10 01:15:01 +0000 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-02-14 10:47:37 -0800 |
commit | 98df2584aaa730220adc29a7fbfa1c551fee5930 (patch) | |
tree | d92888383102ec6d850f6d1863a4e59f454e9c67 | |
parent | 9f557574821b44a87d95756bf53f1b7fb76eb4d4 (diff) | |
download | linux-rt-98df2584aaa730220adc29a7fbfa1c551fee5930.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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-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 3dc7f5446a9d..c3d0729f971e 100644 --- a/net/bridge/br_netfilter.c +++ b/net/bridge/br_netfilter.c @@ -233,6 +233,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); |