Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Ubuntu Kernel Team (http://www.linux-archive.org/ubuntu-kernel-team/)
-   -   bridge: Pull ip header into skb->data before looking into ip header. (http://www.linux-archive.org/ubuntu-kernel-team/711420-bridge-pull-ip-header-into-skb-data-before-looking-into-ip-header.html)

Jesse Sung 10-11-2012 07:50 AM

bridge: Pull ip header into skb->data before looking into ip header.
 
From: Sarveshwar Bandi <sarveshwar.bandi@emulex.com>

BugLink: https://launchpad.net/bugs/1065150

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>
(cherry picked from commit 6caab7b0544e83e6c160b5e80f5a4a7dd69545c7 net.git)

Signed-off-by: Wen-chien Jesse Sung <jesse.sung@canonical.com>
---
net/bridge/br_netfilter.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/net/bridge/br_netfilter.c b/net/bridge/br_netfilter.c
index 577ea5d..7c1745d 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);

--
1.7.9.5


--
kernel-team mailing list
kernel-team@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/kernel-team


All times are GMT. The time now is 10:08 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.