Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2460117yba; Mon, 15 Apr 2019 12:06:36 -0700 (PDT) X-Google-Smtp-Source: APXvYqyY/AHE4m0PY5ROmFXklr+2ovNjj3Kj0NOdHnyx+6rif5hNJqJ/6g7QuVHU2oRLKCPrqVSC X-Received: by 2002:a17:902:567:: with SMTP id 94mr45902924plf.120.1555355196283; Mon, 15 Apr 2019 12:06:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555355196; cv=none; d=google.com; s=arc-20160816; b=jrNLkBI6QIPDuMuMpTXSGDewaWKTRxGOYMrasVO3oHBQmPFCjzphDJpVa2VBL/rcQQ RO7Fhau6byjxp5eerKUQ99Z70Aw1Ky4Elj00rKk1JVc847jdyRopaqL24dP5mYTj/S0C 8CHkfMbwWxq72x52hhlPH/M0um9Z1LT/OkZ9u5tAP6qxsiUkZ6x/p6sXORa/4VayAusa BTnvncKA3pcYk//DSuUP5d7ff20WpBWj5rS1VJHPTPlSw17GbVjH4XvIo23wJyiT2zfN 3LSIgBAP9hxkpKWM2kEQNLotgPGwjwM/5RFesJTk4ucSfMBiHZQ1OWGift9pHehDEwP6 R0LQ== 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=QOD4sGQxdibVLyi5Obb6Uue3mjj1YAxeHQPHI7haKyc=; b=dv4EZbiT3Vi+NOCEArEnmg4yu704JDdQYNjImpsFElazHyP9DwqMvhxZvQcRSeeOfA ge14Fs+t9o89L+PJ+lXwsBuMboPagl/3Jc5Pso8TMR6E5ZSwH2UWB+8kBVi2MevT+jiu ZdjWKWhRK+CEpc9z3yMuoE81AEEYgg2X1+hrw3LJweTtwXxuBiUaWmaTlS3+AjeDWOvN ZucqoqSvdpWckrppJ5wf8e5HsedAbu87ZBq1WwRc1W57wZveWTP33ovGHP78JiwbLfso fxvqMfYlwdE8FPmU17oC1T7SpbceTpaxPuOODxn4Ak5eNeyKnypm0YWJou0VWLRe8nmR 2vsw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=N2sox8SC; 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 y11si6672844plr.384.2019.04.15.12.06.20; Mon, 15 Apr 2019 12:06:36 -0700 (PDT) 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=N2sox8SC; 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 S1729645AbfDOTE7 (ORCPT + 99 others); Mon, 15 Apr 2019 15:04:59 -0400 Received: from mail.kernel.org ([198.145.29.99]:38266 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729640AbfDOTE4 (ORCPT ); Mon, 15 Apr 2019 15:04:56 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.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 C0491218A1; Mon, 15 Apr 2019 19:04:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1555355095; bh=H7rKdmFTc5qZBeuaO8rpSqLCLhvPVO44wOUlN+eUbfc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=N2sox8SCaeXZY0n4ae+SDkpzN1K4XBBqi9Gx62qismEr6aXMqN2Mzxn6NlAHQHaxv A+OB5y1ZPJJKo00KapXh/OuGYBK2w6oNIxfe24Xj9YDs/xbZtB+fY0fte3uPXkPjQ4 4FXMP5y3VzLUa7K3NxZ0hrIWLlIW0bBax4RJQGYs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Steffen Klassert , "David S. Miller" , Sasha Levin Subject: [PATCH 4.19 011/101] net-gro: Fix GRO flush when receiving a GSO packet. Date: Mon, 15 Apr 2019 20:58:09 +0200 Message-Id: <20190415183740.969100277@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190415183740.341577907@linuxfoundation.org> References: <20190415183740.341577907@linuxfoundation.org> User-Agent: quilt/0.66 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 [ Upstream commit 0ab03f353d3613ea49d1f924faf98559003670a8 ] Currently we may merge incorrectly a received GSO packet or a packet with frag_list into a packet sitting in the gro_hash list. skb_segment() may crash case because the assumptions on the skb layout are not met. The correct behaviour would be to flush the packet in the gro_hash list and send the received GSO packet directly afterwards. Commit d61d072e87c8e ("net-gro: avoid reorders") sets NAPI_GRO_CB(skb)->flush in this case, but this is not checked before merging. This patch makes sure to check this flag and to not merge in that case. Fixes: d61d072e87c8e ("net-gro: avoid reorders") Signed-off-by: Steffen Klassert Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- net/core/skbuff.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/core/skbuff.c b/net/core/skbuff.c index 8656b1e20d35..ceee28e184af 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c @@ -3832,7 +3832,7 @@ int skb_gro_receive(struct sk_buff *p, struct sk_buff *skb) unsigned int delta_truesize; struct sk_buff *lp; - if (unlikely(p->len + len >= 65536)) + if (unlikely(p->len + len >= 65536 || NAPI_GRO_CB(skb)->flush)) return -E2BIG; lp = NAPI_GRO_CB(p)->last; -- 2.19.1