Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp657054pxb; Wed, 11 Nov 2020 12:49:33 -0800 (PST) X-Google-Smtp-Source: ABdhPJz0V6U1G5yYsqRHzSP6e58yQX8uqeLv3B6VsV0blQCU3Be4skanv3B75nBI1wVzjUG1NgmS X-Received: by 2002:a17:906:5e45:: with SMTP id b5mr26668962eju.46.1605127773008; Wed, 11 Nov 2020 12:49:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605127773; cv=none; d=google.com; s=arc-20160816; b=pl2wrGz8/SAwM/qdpjVpdyUorujwIk59Ft7a9JdCgIXcW7mVLPGN+hNM6/yUtGoajU vchEL1c0tzvGJTqTT8q8vhxBbSEM/ZuAh0S7ExMQmfI1eL2Y0evMVMcxZELfNYMMuWzk lcyEpC0eS8IJk4UdD/xSlkUcx7KvrInw/AjBOW/TgkGbzKixeVQNgiQsMM/7CeSZyvT3 n/gLRObaJYO2cv3zL6hQrHYGMfHr1DDkCKq4byR6aYCt6f8RGkc4584i3/p5JYp2H03a 03oIbJgxfExVcZtTz0XvrShP98Llg/DDqmjNhujsNuokeissOp6QvQC5bLbEf/ld9YVc UnMw== 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 :message-id:subject:reply-to:cc:from:to:dkim-signature:date; bh=bsLJnkXi8MeTMrm7MqVIftcvsnbFJMQr1qH+ckDYG2k=; b=SWe9DQhJZJQzkhfZkkIV6tIChz97Vct5vx8WCqAfNS6XaSufh/6o9PpMro2WjmmtNZ bDIYndk17YdkccaM88LuzJB8E4ID513lqQDDvJxYlXPCF5NTNaI54rfYwt986j8Vr9Up rTjrs6XlmRRCuN5rVKYnlhdm/dy+epxrPa8365f8f04MycGbwZI4OeOCG13tbNykvPk4 sksNa5TzhIuETjgADJh5VxWiKUfOfJCfPpFXg2fviIWO9x5sWnkZzLhOGz0QFMw0qfxL k+T/aj3EdVOjwLeB6mZTvvIC57jJcZcslep3cJ09KwGuQRNGozS7wcI2EcUECC1r92s2 FIPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@pm.me header.s=protonmail header.b=LaabHsZW; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=pm.me Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i24si2082427eje.42.2020.11.11.12.49.09; Wed, 11 Nov 2020 12:49:32 -0800 (PST) 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=@pm.me header.s=protonmail header.b=LaabHsZW; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=pm.me Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726566AbgKKUpd (ORCPT + 99 others); Wed, 11 Nov 2020 15:45:33 -0500 Received: from mail-40131.protonmail.ch ([185.70.40.131]:56125 "EHLO mail-40131.protonmail.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725900AbgKKUpd (ORCPT ); Wed, 11 Nov 2020 15:45:33 -0500 X-Greylist: delayed 161883 seconds by postgrey-1.27 at vger.kernel.org; Wed, 11 Nov 2020 15:45:31 EST Date: Wed, 11 Nov 2020 20:45:25 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pm.me; s=protonmail; t=1605127530; bh=bsLJnkXi8MeTMrm7MqVIftcvsnbFJMQr1qH+ckDYG2k=; h=Date:To:From:Cc:Reply-To:Subject:From; b=LaabHsZW/4JyVGzDppF9Qsi1NifWmzt017nLH0mUXhbmTxR6qnRwAOmnupAFgxX05 bbE4t4Yt+Wivm9xgyLaYTnRZoKb7FPOBn+LoAMVV07vZlWgc6qwXD/TOn6uCjup+Xk xvGkzzSiKeCgJLCSRujLkdEnJoHCQYo4GKeaEcLS7YwsjM9uMo0W+XnuHaBk4HRUsh x9iMux9RfALDHdCeFL+9kR1+jTUPZnwEDTrNYCzp8WJbtE9DO/sGsAI1MOA6mcv7y0 EZnQfr0XRk/SAPfj1b6ihVHPtw5o1UjxX7cZUGxfofms5gSX96GOjn0Gy8V/G/CWrk 0/aIc/IkQmrIg== To: "David S. Miller" , Jakub Kicinski From: Alexander Lobakin Cc: Alexey Kuznetsov , Hideaki YOSHIFUJI , Paolo Abeni , Willem de Bruijn , Steffen Klassert , Alexander Lobakin , Eric Dumazet , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Reply-To: Alexander Lobakin Subject: [PATCH v5 net 1/2] net: udp: fix UDP header access on Fast/frag0 UDP GRO Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.2 required=10.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF shortcircuit=no autolearn=disabled version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on mailout.protonmail.ch Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org UDP GRO uses udp_hdr(skb) in its .gro_receive() callback. While it's probably OK for non-frag0 paths (when all headers or even the entire frame are already in skb head), this inline points to junk when using Fast GRO (napi_gro_frags() or napi_gro_receive() with only Ethernet header in skb head and all the rest in the frags) and breaks GRO packet compilation and the packet flow itself. To support both modes, skb_gro_header_fast() + skb_gro_header_slow() are typically used. UDP even has an inline helper that makes use of them, udp_gro_udphdr(). Use that instead of troublemaking udp_hdr() to get rid of the out-of-order delivers. Present since the introduction of plain UDP GRO in 5.0-rc1. Fixes: e20cf8d3f1f7 ("udp: implement GRO for plain UDP sockets.") Cc: Eric Dumazet Cc: Jakub Kicinski Cc: Willem de Bruijn Signed-off-by: Alexander Lobakin --- net/ipv4/udp_offload.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/ipv4/udp_offload.c b/net/ipv4/udp_offload.c index e67a66fbf27b..13740e9fe6ec 100644 --- a/net/ipv4/udp_offload.c +++ b/net/ipv4/udp_offload.c @@ -366,7 +366,7 @@ static struct sk_buff *udp4_ufo_fragment(struct sk_buff= *skb, static struct sk_buff *udp_gro_receive_segment(struct list_head *head, =09=09=09=09=09 struct sk_buff *skb) { -=09struct udphdr *uh =3D udp_hdr(skb); +=09struct udphdr *uh =3D udp_gro_udphdr(skb); =09struct sk_buff *pp =3D NULL; =09struct udphdr *uh2; =09struct sk_buff *p; --=20 2.29.2