lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 27 Sep 2013 00:01:43 +0200
From:	Antonio Quartulli <antonio@...n-mesh.com>
To:	Stephen Hemminger <stephen@...workplumber.org>
Cc:	"David S. Miller" <davem@...emloft.net>,
	"bridge@...ts.linux-foundation.org" 
	<bridge@...ts.linux-foundation.org>,
	"netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: Re: [RFC net] bridge: clean the nf_bridge status when forwarding the
 skb

On Thu, Sep 26, 2013 at 02:32:48PM -0700, Stephen Hemminger wrote:
> > > > diff --git a/net/bridge/br_forward.c b/net/bridge/br_forward.c
> > > > index 4b81b14..65864bc 100644
> > > > --- a/net/bridge/br_forward.c
> > > > +++ b/net/bridge/br_forward.c
> > > > @@ -49,6 +49,11 @@ int br_dev_queue_push_xmit(struct sk_buff *skb)
> > > >  	} else {
> > > >  		skb_push(skb, ETH_HLEN);
> > > >  		br_drop_fake_rtable(skb);
> > > > +
> > > > +		/* clean the NF bridge data */
> > > > +		nf_bridge_put(skb->nf_bridge);
> > > > +		skb->nf_bridge = NULL;
> > > > +
> > > >  		dev_queue_xmit(skb);
> > > >  	}
> > > >  
> > 
> > Regarding CONFIG_BRIDGE_NETFILTER you are right, thanks.
> > 
> > > 
> > > I think the header will also be garbage if bridge on bridge with netfilter is used.
> > > See nf_bridge_save_header.
> > 
> > What header are you referring to? nf_bridge_save_header() saves the header in
> > skb->nf_bridge->data, which is freed during nf_bridge_put() (assuming
> > ->use reached 0).
> > 
> > 
> 
> If bridge is stacked the original ether header will get overwritten by the second
> call to save_header.

Sorry, but I am not getting what you mean (I am new to the code and it is late here..):
save_header() will store the Ethernet header in nf_bridge->data for
later recover (if needed).

By freeing nf_bridge I also destroy this header copy.

When the skb enters the second bridge, save_header() will save again the header
in nf_bridge->data. But I don't see how this can create a problem.

The problem I had before this patch comes from the fact that
nf_bridge_copy_header() is invoked in the second bridge with the nf_bridge state
of the first. This was overwriting my the packet Ethernet header with what the
first invocation of save_header() stored in nf_bridge->data.

But by unsetting nf_bridge I think I am preventing this from happening again.
no?

-- 
Antonio Quartulli

Download attachment "signature.asc" of type "application/pgp-signature" (837 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ