Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5604470imu; Mon, 26 Nov 2018 02:53:39 -0800 (PST) X-Google-Smtp-Source: AFSGD/UFhnUl1XxDT1xyUetOSmAhe3+eSZ9g6jv5CE1skXrdaSE8Ulw97D6xIQNcreZDal/m4DvC X-Received: by 2002:a17:902:848d:: with SMTP id c13mr17027194plo.257.1543229619209; Mon, 26 Nov 2018 02:53:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543229619; cv=none; d=google.com; s=arc-20160816; b=UDjw6lcmc+adxmUB45Zs/Owpzi5N3QPSNydvee8NQjjFfPBpI9vZ9n21z9K+cUF6UE imBKXml9IzQZMISo8NvO7iu52RkSpSOJuqMhvz3GXzfa/axPNMDzUo3NfsmuAAvRAqP9 9EnJLzgdOa1R6m7Sh8Wqq1s+aN3OUASqjflRwk9DSFODIpBKyjmRhTeO1tLjzn2ghBiV LKSHxvqXpGl+HgRwOalyK2Ol8RGvhfWS2UShd58fFe90zhAOKaMgSTIk9M3QCkLrh0g1 F/RSsHb7KCeDv4AsBzP3Q61UqlcB7UCFEsJl/SntVDpBgFORU9gRMP63KddaPtQ13xMc m7UQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=FiF0Y/X/kyuvVph3r0Z2oTHUCTG/pf5PZXrlM9zzE88=; b=tcRbNRehdlbqE7o9HDkvyrfpCU5BUeadSmSIDiA5KT8n3oU+yr1wJyv7jQBLpZfZ8/ c4qHX2/cs1Edt8pVpyXIxLjPv+1OUKucBW6AdQZYJ5Gj6M+xjhd58lXYgeRzku9rNX+h 7YCbFBlhhZLS/hNns4kKHRcwcxLlhR+jYPFdC/sAu7iD1s1nNL9xGK2CsWebdTaXLr4/ Lgj+04aWWx7XxisOqPka3K5hwLwW+MKaJdGCJvNu6Rla7WrGjHJm4KoCvmTq1k8AsGSV G+CFOixGkYLAPI4mzv8s6wXwylm6tPemdH2+vbSPap4xOtO9NxSJV8/QKEi5Ryb+0Wag ZEsA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=VoPrN5Af; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j7si29413595plb.91.2018.11.26.02.53.23; Mon, 26 Nov 2018 02:53:39 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=VoPrN5Af; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726254AbeKZVqX (ORCPT + 99 others); Mon, 26 Nov 2018 16:46:23 -0500 Received: from mail.kernel.org ([198.145.29.99]:54130 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726167AbeKZVqX (ORCPT ); Mon, 26 Nov 2018 16:46:23 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id DB50B21104; Mon, 26 Nov 2018 10:52:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1543229559; bh=pJxNv8rUrg8qKDAHAa3oSjNjwQ0klkXzLOEFDoASijk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VoPrN5Af82j1vHecb81Z+oDczs48bO6QFplCA83xD+yfZhxAx+epsO3Lf41+THC7C P5zZ84wKbE1Wv9MqtNo0a7s1sEMF2Njz5ePFsgQcytBLDUvRoCy6NDygW94K7Wwyp0 yl68iVURn7+7BCOjyXCToPBzRz0q23mDfsTLPQqg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Eric Dumazet , "David S. Miller" Subject: [PATCH 3.18 01/24] net-gro: reset skb->pkt_type in napi_reuse_skb() Date: Mon, 26 Nov 2018 11:50:55 +0100 Message-Id: <20181126105029.963465279@linuxfoundation.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181126105029.790599475@linuxfoundation.org> References: <20181126105029.790599475@linuxfoundation.org> User-Agent: quilt/0.65 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Eric Dumazet [ Upstream commit 33d9a2c72f086cbf1087b2fd2d1a15aa9df14a7f ] eth_type_trans() assumes initial value for skb->pkt_type is PACKET_HOST. This is indeed the value right after a fresh skb allocation. However, it is possible that GRO merged a packet with a different value (like PACKET_OTHERHOST in case macvlan is used), so we need to make sure napi->skb will have pkt_type set back to PACKET_HOST. Otherwise, valid packets might be dropped by the stack because their pkt_type is not PACKET_HOST. napi_reuse_skb() was added in commit 96e93eab2033 ("gro: Add internal interfaces for VLAN"), but this bug always has been there. Fixes: 96e93eab2033 ("gro: Add internal interfaces for VLAN") Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/core/dev.c | 4 ++++ 1 file changed, 4 insertions(+) --- a/net/core/dev.c +++ b/net/core/dev.c @@ -4201,6 +4201,10 @@ static void napi_reuse_skb(struct napi_s skb->vlan_tci = 0; skb->dev = napi->dev; skb->skb_iif = 0; + + /* eth_type_trans() assumes pkt_type is PACKET_HOST */ + skb->pkt_type = PACKET_HOST; + skb->encapsulation = 0; skb_shinfo(skb)->gso_type = 0; skb->truesize = SKB_TRUESIZE(skb_end_offset(skb));