Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5647495imu; Mon, 26 Nov 2018 03:29:56 -0800 (PST) X-Google-Smtp-Source: AJdET5fEAK6Y1BkdtumHMGUND+8Vmrd8G1ct+ZSDeGaVuowjic8DtiArS6lKdS832eDEUw/u6Our X-Received: by 2002:a62:d2c1:: with SMTP id c184mr27665383pfg.248.1543231796084; Mon, 26 Nov 2018 03:29:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543231796; cv=none; d=google.com; s=arc-20160816; b=jrIy79UIhmOFUnDgR1tf1gabHGeWFaXGMkley4gBJW/vyhTwRaoBbZqUy54la9sXVZ MpYzGwy59Icxs7lfrKJqdAGC7Xtq++jwD7Nn3q67Jl09edCQGbvH+HwmK3rNJNrLa+BZ CxCsZzn777f0KmmHivki+aPLgh99DzMgNC3CzClRLotnktPn4VkP5/063+Cqkug+61kG HVvfxjIKXtl40uiWCxrJTLUKl3Symj5vDMowDVjlqDSUYP/aMr8OKJAOPIVkgdzQp84e hoF0apcgbnfQjgxi4p8z7oIDYGtT0Bt6eDvncBfQ69AQTwa/olhzY5xawvOTCqzU4BIF 8WKA== 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=CUVWQ7+4aBXOTE7LFYD/FkjPDccc76cGnnIuko/zzTo=; b=a//7ZOf2Hz7JuW5/x+j141X/ppw2xEz43i966TWVqrKBgm262IhAdD0u1sD9Wh7Ujw 5fpETbTZWHK5NEuu/ami5BKflaV6m0oNT4ShSju8m7NJh+61uBZhL8w3bjpMrLX5pGdf FXvw9xtKIAHz+Ku8Q7eCulWnCENgqGjAr396KxGzJf7FurTI0/vH2eeN66bgYF//zlnh 0MI5t9wDu02BKLvvqYEZcnAEPuljeVa4xKOmLgr4RXyNW4Upz9qbI+dK6aTuI64ap/4w Ay81/GjAYw1EGxUklJigK51xHUU8JXPY89tDl2Wies24tiFTLzUYZt3x1tECAp7z/7X/ 5xYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=GafBDE6Y; 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 a6si26023pfo.90.2018.11.26.03.29.19; Mon, 26 Nov 2018 03:29:56 -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=GafBDE6Y; 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 S1727072AbeKZVre (ORCPT + 99 others); Mon, 26 Nov 2018 16:47:34 -0500 Received: from mail.kernel.org ([198.145.29.99]:55726 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726138AbeKZVrb (ORCPT ); Mon, 26 Nov 2018 16:47:31 -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 35F882089F; Mon, 26 Nov 2018 10:53:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1543229627; bh=Y5qMITy+GG7Oxmf5I/NQXpDAkrmoTf0AA01D3W3O5lo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GafBDE6YJPi73HhJcNMQRVm+v7oOCJPAfgZOm57tcOc88cH1W4BASHXrAP6bDOYXd nARCQEGcziEMpVQyiS6n5AZA04Tgqbh/tGEf3no2NzBQPdot+y1vfyB5McQD58UbJ8 ZCIaZU7nmF5lFJkdErwaNXc9CmTNY3KmaHFNl6uc= 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 4.4 03/70] net-gro: reset skb->pkt_type in napi_reuse_skb() Date: Mon, 26 Nov 2018 11:50:18 +0100 Message-Id: <20181126105047.236363945@linuxfoundation.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181126105046.722096341@linuxfoundation.org> References: <20181126105046.722096341@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review 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 4.4-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 @@ -4481,6 +4481,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));