From patchwork Sat Nov 26 15:19:09 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Poirier X-Patchwork-Id: 127813 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 3003EB6F8E for ; Sun, 27 Nov 2011 02:39:19 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752804Ab1KZPjM (ORCPT ); Sat, 26 Nov 2011 10:39:12 -0500 Received: from mail-vx0-f174.google.com ([209.85.220.174]:60347 "EHLO mail-vx0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752620Ab1KZPjL (ORCPT ); Sat, 26 Nov 2011 10:39:11 -0500 Received: by vcbfk14 with SMTP id fk14so2666821vcb.19 for ; Sat, 26 Nov 2011 07:39:10 -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=hor91yrPEtFgb+1FB+ry4T1xc9mkUnExrKxjQiRAwog=; b=OjAgsK1CjWaUQW4xHsrtcLC914c3svSiES5WlamsyjPaWN4nH1kjwmGq1XyFcm3LW6 BNKUII8iW+KPcRFW+pfZGLyPsF4vTtTpiMto+8sdFQMnt9dtcrxYJKmziIYPq+OZaVIJ 2NVDCMSp4jj8QlO4QPEvTynzTbU+MRdCdJ1lM= Received: by 10.52.23.83 with SMTP id k19mr27631420vdf.93.1322321950717; Sat, 26 Nov 2011 07:39:10 -0800 (PST) Received: from localhost.localdomain ([216.252.92.231]) by mx.google.com with ESMTPS id j10sm18545650vdv.10.2011.11.26.07.39.08 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 26 Nov 2011 07:39:09 -0800 (PST) From: Benjamin Poirier To: "David S. Miller" Cc: netdev@vger.kernel.org, stable@vger.kernel.org, Jesse Gross Subject: [PATCH net/stable] gro: reset vlan_tci on reuse Date: Sat, 26 Nov 2011 10:19:09 -0500 Message-Id: <1322320749-8055-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 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 Cc: Jesse Gross --- 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;