From patchwork Wed Nov 30 12:47:18 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Poirier X-Patchwork-Id: 128503 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 676351007D1 for ; Wed, 30 Nov 2011 23:49:25 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751780Ab1K3MtV (ORCPT ); Wed, 30 Nov 2011 07:49:21 -0500 Received: from mail-qy0-f174.google.com ([209.85.216.174]:48628 "EHLO mail-qy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750852Ab1K3MtT (ORCPT ); Wed, 30 Nov 2011 07:49:19 -0500 Received: by qyk4 with SMTP id 4so235025qyk.19 for ; Wed, 30 Nov 2011 04:49:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=sender:from:to:cc:subject:date:message-id:x-mailer; bh=3drZRLaXRs1QV7qY4D+PLKrbaAKKcjBH33B/YPWJCZE=; b=IMBJZE0OxgEItFcMd+ErNCcFDUEoEw+VbeLhzSZSgHdfwJAs6bhgUL+tg4eLJjOKPu ffwed2ON7K75rFbzcSJBihtbc9XH6+C/pK6H4HVvCrqCCa9/Bi2agxuaguRXeXZvZoRB fDskxx8wZRfygjA+AUG8H/2kUINbcpGANy01I= Received: by 10.229.11.141 with SMTP id t13mr218667qct.275.1322657359210; Wed, 30 Nov 2011 04:49:19 -0800 (PST) Received: from localhost.localdomain ([216.252.92.231]) by mx.google.com with ESMTPS id ed2sm1992384qab.15.2011.11.30.04.49.16 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 30 Nov 2011 04:49:17 -0800 (PST) From: Benjamin Poirier To: davem@davemloft.net Cc: netdev@vger.kernel.org, stable@vger.kernel.org, Jesse Gross Subject: [PATCH RESEND net/stable] gro: reset vlan_tci on reuse Date: Wed, 30 Nov 2011 07:47:18 -0500 Message-Id: <1322657238-17159-1-git-send-email-bpoirier@suse.de> X-Mailer: git-send-email 1.7.7 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org For drivers using the vlan_gro_frags() interface, a packet with an invalid tci leads to GRO_DROP and napi_reuse_skb(). The skb has to be sanitized before being reused or we may send an skb with an invalid vlan_tci field up the stack where it is not expected. Signed-off-by: Benjamin Poirier Cc: Jesse Gross Acked-by: David S. Miller --- Please apply to the -2.6.32.y stable branch. This one liner is part of upstream commit 3701e51382a026cba10c60b03efabe534fba4ca4 Author: Jesse Gross vlan: Centralize handling of hardware acceleration. The bulk of that 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 is a part of that commit but can work independently of the rest. This patch can avoid panics on the 2.6.32.y -stable kernels and is in the same spirit as mainline commits 66c46d7 gro: Reset dev pointer on reuse 6d152e2 gro: reset skb_iif on reuse which are already in -stable. --- 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;