netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net/stable] gro: reset vlan_tci on reuse
@ 2011-11-26 15:19 Benjamin Poirier
  2011-11-26 15:52 ` Greg KH
  0 siblings, 1 reply; 3+ messages in thread
From: Benjamin Poirier @ 2011-11-26 15:19 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev, stable, Jesse Gross

This one liner is part of upstream
commit 3701e51382a026cba10c60b03efabe534fba4ca4

and it is in the same vein as
commit 66c46d741e2e60f0e8b625b80edb0ab820c46d7a
commit 6d152e23ad1a7a5b40fef1f42e017d66e6115159

which are already in -stable.

For drivers using the vlan_gro_frags() interface, a packet with invalid tci
leads to GRO_DROP and napi_reuse_skb(). The skb has to be sanitized before
being reused or we'll send skb's with invalid vlan_tci up the stack where
they're not expected.

Signed-off-by: Benjamin Poirier <bpoirier@suse.de>
Cc: Jesse Gross <jesse@nicira.com>

---

Please note, reusing skb's with an invalid vlan_tci can cause panics on
2.6.32.y -stable kernels.

 net/core/dev.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/net/core/dev.c b/net/core/dev.c
index 64eb849..84a0705 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -2614,6 +2614,7 @@ void napi_reuse_skb(struct napi_struct *napi, struct sk_buff *skb)
 {
 	__skb_pull(skb, skb_headlen(skb));
 	skb_reserve(skb, NET_IP_ALIGN - skb_headroom(skb));
+	skb->vlan_tci = 0;
 	skb->dev = napi->dev;
 	skb->iif = 0;
 
-- 
1.7.7

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

* Re: [PATCH net/stable] gro: reset vlan_tci on reuse
  2011-11-26 15:19 [PATCH net/stable] gro: reset vlan_tci on reuse Benjamin Poirier
@ 2011-11-26 15:52 ` Greg KH
  2011-11-27  1:01   ` Benjamin Poirier
  0 siblings, 1 reply; 3+ messages in thread
From: Greg KH @ 2011-11-26 15:52 UTC (permalink / raw)
  To: Benjamin Poirier; +Cc: David S. Miller, netdev, stable, Jesse Gross

On Sat, Nov 26, 2011 at 10:19:09AM -0500, Benjamin Poirier wrote:
> This one liner is part of upstream
> commit 3701e51382a026cba10c60b03efabe534fba4ca4
> 
> and it is in the same vein as
> commit 66c46d741e2e60f0e8b625b80edb0ab820c46d7a
> commit 6d152e23ad1a7a5b40fef1f42e017d66e6115159
> 
> which are already in -stable.
> 
> For drivers using the vlan_gro_frags() interface, a packet with invalid tci
> leads to GRO_DROP and napi_reuse_skb(). The skb has to be sanitized before
> being reused or we'll send skb's with invalid vlan_tci up the stack where
> they're not expected.
> 
> Signed-off-by: Benjamin Poirier <bpoirier@suse.de>
> Cc: Jesse Gross <jesse@nicira.com>
> 
> ---
> 
> Please note, reusing skb's with an invalid vlan_tci can cause panics on
> 2.6.32.y -stable kernels.

You forgot to mention what stable kernel tree(s) you want this patch
applied to.  And why can't I just take all of
3701e51382a026cba10c60b03efabe534fba4ca4? (hint, when refering to git
commit ids, please put the description of what they are in () after them
so we have a hint and don't have to dig through a git tree to find
them.)

Also, I need David's ack before I can take this, or any other network
patch, for the stable tree.

thanks,

greg k-h

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

* Re: [PATCH net/stable] gro: reset vlan_tci on reuse
  2011-11-26 15:52 ` Greg KH
@ 2011-11-27  1:01   ` Benjamin Poirier
  0 siblings, 0 replies; 3+ messages in thread
From: Benjamin Poirier @ 2011-11-27  1:01 UTC (permalink / raw)
  To: Greg KH; +Cc: David S. Miller, netdev, stable, Jesse Gross

On 11/11/26 07:52, Greg KH wrote:
> On Sat, Nov 26, 2011 at 10:19:09AM -0500, Benjamin Poirier wrote:
> > This one liner is part of upstream
> > commit 3701e51382a026cba10c60b03efabe534fba4ca4
> > 
> > and it is in the same vein as
> > commit 66c46d741e2e60f0e8b625b80edb0ab820c46d7a
> > commit 6d152e23ad1a7a5b40fef1f42e017d66e6115159
> > 
> > which are already in -stable.
> > 
> > For drivers using the vlan_gro_frags() interface, a packet with invalid tci
> > leads to GRO_DROP and napi_reuse_skb(). The skb has to be sanitized before
> > being reused or we'll send skb's with invalid vlan_tci up the stack where
> > they're not expected.
> > 
> > Signed-off-by: Benjamin Poirier <bpoirier@suse.de>
> > Cc: Jesse Gross <jesse@nicira.com>
> > 
> > ---
> > 
> > Please note, reusing skb's with an invalid vlan_tci can cause panics on
> > 2.6.32.y -stable kernels.
> 
> You forgot to mention what stable kernel tree(s) you want this patch
> applied to.  And why can't I just take all of
> 3701e51382a026cba10c60b03efabe534fba4ca4? (hint, when refering to git
> commit ids, please put the description of what they are in () after them
> so we have a hint and don't have to dig through a git tree to find
> them.)

Ah, thank you for spelling it out, I was clueless after re-reading
kernel_stable_rules.txt

> > This one liner is part of upstream
> > commit 3701e51382a026cba10c60b03efabe534fba4ca4
Author: Jesse Gross <jesse@nicira.com>
vlan: Centralize handling of hardware acceleration.

> > 
> > and it is in the same vein as
> > commit 66c46d741e2e60f0e8b625b80edb0ab820c46d7a
Author: Herbert Xu <herbert@gondor.apana.org.au>
gro: Reset dev pointer on reuse

> > commit 6d152e23ad1a7a5b40fef1f42e017d66e6115159
Author: Andy Gospodarek <andy@greyhouse.net>
gro: reset skb_iif on reuse

Jesse's upstream commit is a rework of the hardware assisted vlan
tagging driver interface, and as such doesn't classify for -stable
inclusion. The fix that is needed just happens to be part of that commit
but can work independently of the rest -- I guess they could've been
separate commits from the start.

The vlan_gro_frags() interface was introduced in 2.6.29 and Jesse's
commit went in 2.6.37. -stable kernels in between can make use of the
fix which I believe makes it applicable to 2.6.32.y and .33.y given the
-stable branches that seem to be getting updates at this time.

> 
> Also, I need David's ack before I can take this, or any other network
> patch, for the stable tree.

cc'ed.

Thanks,
-Benjamin

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

end of thread, other threads:[~2011-11-27  0:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-26 15:19 [PATCH net/stable] gro: reset vlan_tci on reuse Benjamin Poirier
2011-11-26 15:52 ` Greg KH
2011-11-27  1:01   ` Benjamin Poirier

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).