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

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