netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] bridge: Pull ip header into skb->data before looking into ip header.
@ 2012-10-10 11:15 sarveshwar.bandi
  2012-10-11  2:53 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: sarveshwar.bandi @ 2012-10-10 11:15 UTC (permalink / raw)
  To: davem; +Cc: netdev, Sarveshwar Bandi

From: Sarveshwar Bandi <sarveshwar.bandi@emulex.com>

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>
---
 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 68e8f36..fe43bc7 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);
 
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] bridge: Pull ip header into skb->data before looking into ip header.
  2012-10-10 11:15 [PATCH] bridge: Pull ip header into skb->data before looking into ip header sarveshwar.bandi
@ 2012-10-11  2:53 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2012-10-11  2:53 UTC (permalink / raw)
  To: sarveshwar.bandi; +Cc: netdev

From: <sarveshwar.bandi@emulex.com>
Date: Wed, 10 Oct 2012 16:45:01 +0530

> From: Sarveshwar Bandi <sarveshwar.bandi@emulex.com>
> 
> 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>

Applied.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-10-11  2:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-10 11:15 [PATCH] bridge: Pull ip header into skb->data before looking into ip header sarveshwar.bandi
2012-10-11  2:53 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).