mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: Bandan Das <bandan.das@stratus.com>,
	Herbert Xu <herbert@gondor.hengli.com.au>
Cc: David Miller <davem@davemloft.net>,
	NetDev <netdev@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Patrick McHardy <kaber@trash.net>
Subject: Re: [PATCH net-next-2.6] net/ipv4: push IP options to CB in ip_fragment
Date: Tue, 31 Aug 2010 07:20:31 +0200	[thread overview]
Message-ID: <1283232031.2405.38.camel@edumazet-laptop> (raw)
In-Reply-To: <20100830232147.GB10754@stratus.com>

Le lundi 30 août 2010 à 19:21 -0400, Bandan Das a écrit :
> > 
> > I wonder if we want this.
> > 
> > Maybe setting skb->local_df = 1 in bridge should be enough ?
> > 
> > 
> Thanks Eric for looking at this. Indeed, setting local_df to 1 seems to be enough! I will
> respin and post a different patch.
> 

Reading this stuff again, I wonder if we should not revert commit
17762060c25590bfddd  and use a different trick

Author: Herbert Xu <herbert@gondor.apana.org.au>
Date:   Mon Jul 5 21:29:28 2010 +0000

    bridge: Clear IPCB before possible entry into IP stack
    
    The bridge protocol lives dangerously by having incestuous relations
    with the IP stack.  In this instance an abomination has been created
    where a bogus IPCB area from a bridged packet leads to a crash in
    the IP stack because it's interpreted as IP options.
    
    This patch papers over the problem by clearing the IPCB area in that
    particular spot.  To fix this properly we'd also need to parse any
    IP options if present but I'm way too lazy for that.
    
    Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
    Signed-off-by: David S. Miller <davem@davemloft.net>


We could have a padding in front of struct br_input_skb_cb to make sure
we dont overwrite IP (4|6) CB in bridge ?

Something like this untested patch :

diff --git a/net/bridge/br_netfilter.c b/net/bridge/br_netfilter.c
index 2c911c0..9fdf1b1 100644
--- a/net/bridge/br_netfilter.c
+++ b/net/bridge/br_netfilter.c
@@ -598,9 +598,6 @@ static unsigned int br_nf_pre_routing(unsigned int hook, struct sk_buff *skb,
 
 	pskb_trim_rcsum(skb, len);
 
-	/* BUG: Should really parse the IP options here. */
-	memset(IPCB(skb), 0, sizeof(struct inet_skb_parm));
-
 	nf_bridge_put(skb->nf_bridge);
 	if (!nf_bridge_alloc(skb))
 		return NF_DROP;
diff --git a/net/bridge/br_private.h b/net/bridge/br_private.h
index 75c90ed..b27163a 100644
--- a/net/bridge/br_private.h
+++ b/net/bridge/br_private.h
@@ -18,6 +18,7 @@
 #include <linux/netpoll.h>
 #include <linux/u64_stats_sync.h>
 #include <net/route.h>
+#include <linux/ipv6.h>
 
 #define BR_HASH_BITS 8
 #define BR_HASH_SIZE (1 << BR_HASH_BITS)
@@ -244,6 +245,8 @@ struct net_bridge
 };
 
 struct br_input_skb_cb {
+	struct inet6_skb_parm pad;
+
 	struct net_device *brdev;
 #ifdef CONFIG_BRIDGE_IGMP_SNOOPING
 	int igmp;



  reply	other threads:[~2010-08-31  5:20 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-30 20:09 Bandan Das
2010-08-30 21:35 ` Eric Dumazet
2010-08-30 23:21   ` Bandan Das
2010-08-31  5:20     ` Eric Dumazet [this message]
2010-08-31  8:24       ` Herbert Xu
2010-08-31  9:17         ` Eric Dumazet
2010-08-31 12:36           ` Herbert Xu
2010-08-31 13:13             ` Eric Dumazet
2010-08-31 13:50               ` Bandan Das
2010-09-01 16:57             ` Bandan Das
2010-09-03  4:49               ` Herbert Xu
2010-09-15 17:32                 ` Bandan Das
2010-09-17  6:51                   ` Herbert Xu
2010-09-17 23:43                     ` David Miller
2010-09-19 19:36                       ` Bandan Das
2010-09-01 21:46       ` David Miller
2010-09-01 23:30         ` Herbert Xu
2010-09-02  1:09           ` David Miller
2010-09-02  2:05             ` Bandan Das
2010-09-02  2:17               ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1283232031.2405.38.camel@edumazet-laptop \
    --to=eric.dumazet@gmail.com \
    --cc=bandan.das@stratus.com \
    --cc=davem@davemloft.net \
    --cc=herbert@gondor.hengli.com.au \
    --cc=kaber@trash.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®