Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp661257pxb; Wed, 11 Nov 2020 12:57:52 -0800 (PST) X-Google-Smtp-Source: ABdhPJztFdkIj1eVzku1bF48TCSy+4vho4nB5vqYoKzVRvRGlvgiUMx0MjPIQeMRNH62w9Hlx4o/ X-Received: by 2002:a17:906:1317:: with SMTP id w23mr26409681ejb.120.1605128272648; Wed, 11 Nov 2020 12:57:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605128272; cv=none; d=google.com; s=arc-20160816; b=v3sjL9N5Fvsba6idQunMtJFr4lNJWXFnuxAeOtDu+fSu9NKoXi4SQ+jM2C0Ug5w9zI uxFuHR6xJyvm38PwA7AJ+Uc0M1Ll5/wPxAIOfBdq6P8PJf25smiU+G1Q6xLrHbZlD9q1 rIAFrpUGy9MjmP6ClpApfttgdL7M7W4qSnZ6TAI90jih1JliDHB5DJT9XxclMqQ72+qO oGukf5KaIBbu4446m2R0+1Tm2bnyTCNZuwgjAlCnZj2WLWTvHdSu455Xy95Hm0iEoErz 4Uq2NFcdMZD2bk3VO/HUnXwDbgZuk5LK16XsnoA2KGnETz783zRZk3pEbz78lzKg/V68 lvzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=d6wXQms3X2jDTGkCw8WsYRVzU1kvWpMHgYkx09XvOSo=; b=qJnLSLJ0zhcWg7j0ArB2KH+RigdIItFhTcAlB7DFLlYCXqhA9vM60bES3MeC6delQf HbRUu9ZLWniZbs4+rgpNaAwwPTdfRjuTvK9vfWmS3FjCxsFciHcV/cNGnAruibG+fnZF wyswqCpOzRlj7jIqYQAI5+TuU9nuIbfCm1BRyjWom9VWxELXz9rJBzkDZ0xgD5I+DbB0 MiRYnG5eorfd5V0GbJ1mjMc4IQB+mbudG4kZIN8MQrSW45BtG0pdLooHuMjc5zPd4nsZ vFSB9netNG4Feg15k22UIG3Dh47811HNcTXgNO9IfngqfxyJJJ2VNhtGvs5/oV1Phi7a MFjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=t+grscLb; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l23si2806007ejb.488.2020.11.11.12.57.28; Wed, 11 Nov 2020 12:57:52 -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=@gmail.com header.s=20161025 header.b=t+grscLb; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726953AbgKKUz1 (ORCPT + 99 others); Wed, 11 Nov 2020 15:55:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37934 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725933AbgKKUz1 (ORCPT ); Wed, 11 Nov 2020 15:55:27 -0500 Received: from mail-vs1-xe44.google.com (mail-vs1-xe44.google.com [IPv6:2607:f8b0:4864:20::e44]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EEC19C0613D1 for ; Wed, 11 Nov 2020 12:55:26 -0800 (PST) Received: by mail-vs1-xe44.google.com with SMTP id 128so1980156vso.7 for ; Wed, 11 Nov 2020 12:55:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=d6wXQms3X2jDTGkCw8WsYRVzU1kvWpMHgYkx09XvOSo=; b=t+grscLb20Tx0eHT7Z0/3k9KRGG3yAc0IuHJ5S/pi0ek59meKkGY0CtxIplTBbl11j oTSxcbEMlEMkj8W7RMJlTS1d4xPkr1a9fJ0aFfgLvj6eONeTK+BAqezy+ExOkbkaSFzz 25gAAZ2u1RLDBe9B4QZXGhEYkSSCOeUc7BJkODARM3xlgpQ9PPXQCewu0QQltVG2UlA3 hiXI4alqL1PNC3XL+Mdn1mA6QhEf2vUaKUaZKqM29U31JUVzowAbMa0xAARMQGraosCI 4BfQtavFo6mDftIYj2i2ouxw3RpRrZIH2N0LuBt/ad/yK0c6L409r2KUGMroCHWjHZ1X YA4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=d6wXQms3X2jDTGkCw8WsYRVzU1kvWpMHgYkx09XvOSo=; b=Mi/ND6+FXn1yG3786N3YcKCPBhaQPOfZ5xAgXwdhkGunyAyivRmML0kGsjy7RKzKiE jOw+HIv9LjIVzdTmBLp3LGCLeVKWTB166jBSgmXbWNdd39JaXadlDeVCAor+LDnfYEzO NL1sv8M6Vyyqx2Co0MSvBl7rMivM+jTesy+Qky4Iau8S1zCYpokCsU/jgiHxjqV8p7K0 UAcUQYU2cPCMU5TwFdax8CXnNwQVT1rlA29p4j1XLB4h4z1PUfA/FpYxsSjl31nNAEiq D1K9h4h50CbVOlNwEmLxbYDEwhmf2UMSH3I9ssZZcUUloobZVwax0BFct+jRMB/2krWW 3dUg== X-Gm-Message-State: AOAM533+9BeksLUGeY5ayCFUyX1z2yfh/UNPvyEw1vgsIYZap/ppXUBe vEnk6mcLpeEKTQRmOSqOGmpUi0YcpHg= X-Received: by 2002:a05:6102:a17:: with SMTP id t23mr9679209vsa.25.1605128125345; Wed, 11 Nov 2020 12:55:25 -0800 (PST) Received: from mail-vs1-f51.google.com (mail-vs1-f51.google.com. [209.85.217.51]) by smtp.gmail.com with ESMTPSA id 59sm293490uag.13.2020.11.11.12.55.24 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 11 Nov 2020 12:55:24 -0800 (PST) Received: by mail-vs1-f51.google.com with SMTP id m16so1969075vsl.8 for ; Wed, 11 Nov 2020 12:55:24 -0800 (PST) X-Received: by 2002:a67:ce0e:: with SMTP id s14mr16942916vsl.13.1605128123561; Wed, 11 Nov 2020 12:55:23 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Willem de Bruijn Date: Wed, 11 Nov 2020 15:54:45 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v5 net 2/2] net: udp: fix IP header access and skb lookup on Fast/frag0 UDP GRO To: Alexander Lobakin Cc: "David S. Miller" , Jakub Kicinski , Alexey Kuznetsov , Hideaki YOSHIFUJI , Paolo Abeni , Steffen Klassert , Eric Dumazet , Network Development , linux-kernel Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Nov 11, 2020 at 3:45 PM Alexander Lobakin wrote: > > udp{4,6}_lib_lookup_skb() use ip{,v6}_hdr() to get IP header of the > packet. While it's probably OK for non-frag0 paths, this helpers > will also point to junk on Fast/frag0 GRO when all headers are > located in frags. As a result, sk/skb lookup may fail or give wrong > results. To support both GRO modes, skb_gro_network_header() might > be used. To not modify original functions, add private versions of > udp{4,6}_lib_lookup_skb() only to perform correct sk lookups on GRO. > > Present since the introduction of "application-level" UDP GRO > in 4.7-rc1. > > Misc: replace totally unneeded ternaries with plain ifs. > > Fixes: a6024562ffd7 ("udp: Add GRO functions to UDP socket") > Suggested-by: Willem de Bruijn > Cc: Eric Dumazet > Cc: Jakub Kicinski > Signed-off-by: Alexander Lobakin Acked-by: Willem de Bruijn