From: Benjamin Poirier <bpoirier@suse.de>
To: "David S. Miller" <davem@davemloft.net>
Cc: netdev@vger.kernel.org, stable@vger.kernel.org,
Jesse Gross <jesse@nicira.com>
Subject: [PATCH net/stable] gro: reset vlan_tci on reuse
Date: Sat, 26 Nov 2011 10:19:09 -0500 [thread overview]
Message-ID: <1322320749-8055-1-git-send-email-bpoirier@suse.de> (raw)
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
next reply other threads:[~2011-11-26 15:39 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-26 15:19 Benjamin Poirier [this message]
2011-11-26 15:52 ` [PATCH net/stable] gro: reset vlan_tci on reuse Greg KH
2011-11-27 1:01 ` Benjamin Poirier
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=1322320749-8055-1-git-send-email-bpoirier@suse.de \
--to=bpoirier@suse.de \
--cc=davem@davemloft.net \
--cc=jesse@nicira.com \
--cc=netdev@vger.kernel.org \
--cc=stable@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;
as well as URLs for NNTP newsgroup(s).