Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp697239pxv; Thu, 22 Jul 2021 09:58:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwtxh7CXuGmmURDt4+S6NYd7YLUIzdMtrwfOU4EXwfTFlCFkl+tMHAAG7GZEWylZ/pz4QjS X-Received: by 2002:aa7:c956:: with SMTP id h22mr677995edt.378.1626973097162; Thu, 22 Jul 2021 09:58:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626973097; cv=none; d=google.com; s=arc-20160816; b=iBhHXyByIRL3oo4HPFv/TugchLXXddAPpj/D95nWPCWYnDQ6mksS54ZpOgOgyxrHO6 L9Ow1nGregiqoPs4dCDlVcCIDV0hvZfPScniKnkjMGuKMftNcLwHFWhSm4P+lhgFGS3T 2VbOovNef2JDu5M9NbdMrIGXE2f1CV3BQkcTv34SA9NTqBTmSZynVsodUhRIe9+BXlOR TVBsuwnUYL/BzBFyLayOQPnRAcW51NvM1d+Q9o/9O+6LzPyjqhR9QWl4xzzFRAHtE+3v 5mYgAFQcUXSrqZd46M6gKf49fIrn4cUhTR0xbYxXKrrppHoV5DXPPXXDHKa4Nn9h52qO oOQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=9kvxDmP/yP5Iwd/+dZgS38n5J2oXGV9SZZamrDwxT8E=; b=UyvHKpNFg01v6pgkfcP+W3PoXMHNb9SE8Z5FdYp7+q9Aom36r0goXokAi7/3JMwMdq kU+HbHlkOXHxOkUeneOSTw9ZHsikgb+BZIg55tp0qAomb4MgosqMxMwDh2StIAXI0/5Y v3mNNRVeHMOFx39DfssJ4PM0UGFNk4o6JH7f0Y5oaw77L1FKqml+P5eqIvtA1LaSd9l5 XdXb4Q12/OAKxXNFqEDbwfBoaRTAPnZTorpJcztrU42xdLPOVtHPgiSDSrWmmSYK+0ND X0FhAiYz8ApipkQB4J6M2P9HSZm5wI0JkR1jav2khZQNrISvyq1VxOVSI6IVNjTh8U4/ HEWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=IAQVB+5F; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a7si31010339eds.521.2021.07.22.09.57.53; Thu, 22 Jul 2021 09:58:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=IAQVB+5F; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234977AbhGVQNN (ORCPT + 99 others); Thu, 22 Jul 2021 12:13:13 -0400 Received: from mail.kernel.org ([198.145.29.99]:45354 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235515AbhGVQJ0 (ORCPT ); Thu, 22 Jul 2021 12:09:26 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 44242613BA; Thu, 22 Jul 2021 16:49:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626972571; bh=RUZiFHDlKzuWl7OOQqPe6IncVMoYDfmrEYwWKCO6JYA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IAQVB+5FvurFV2rH8kn4XvreTic07BdlqXruhAbRbyG7DxaosbRQgJ54lsd/bZlcC zqRjgprLd4oAsJ0VPV2UQHAdhaKOFiFeiXTo1+jjrQDqM43/Fmvo1HiSIoqZHIxJdr zPQikHcDnwAPAV3yRc7IPbuk6J6u6M52A9D4D+WY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Paolo Abeni , "David S. Miller" , Matthias Treydte Subject: [PATCH 5.13 155/156] udp: properly flush normal packet at GRO time Date: Thu, 22 Jul 2021 18:32:10 +0200 Message-Id: <20210722155633.366057376@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210722155628.371356843@linuxfoundation.org> References: <20210722155628.371356843@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Paolo Abeni commit b43c8909be52f2baca8884f967b418a88424494a upstream. If an UDP packet enters the GRO engine but is not eligible for aggregation and is not targeting an UDP tunnel, udp_gro_receive() will not set the flush bit, and packet could delayed till the next napi flush. Fix the issue ensuring non GROed packets traverse skb_gro_flush_final(). Reported-and-tested-by: Matthias Treydte Fixes: 18f25dc39990 ("udp: skip L4 aggregation for UDP tunnel packets") Signed-off-by: Paolo Abeni Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/ipv4/udp_offload.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) --- a/net/ipv4/udp_offload.c +++ b/net/ipv4/udp_offload.c @@ -525,8 +525,10 @@ struct sk_buff *udp_gro_receive(struct l if ((!sk && (skb->dev->features & NETIF_F_GRO_UDP_FWD)) || (sk && udp_sk(sk)->gro_enabled) || NAPI_GRO_CB(skb)->is_flist) - pp = call_gro_receive(udp_gro_receive_segment, head, skb); - return pp; + return call_gro_receive(udp_gro_receive_segment, head, skb); + + /* no GRO, be sure flush the current packet */ + goto out; } if (NAPI_GRO_CB(skb)->encap_mark ||