Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp59401pxy; Wed, 21 Apr 2021 18:28:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwEt/QYoyXzcw8n4dwAM/J3zEgO+oUkJVw3yK2WCmXafGx8FpAdBRTEcKm444eBPUum/b04 X-Received: by 2002:aa7:92cb:0:b029:1f1:542f:2b2b with SMTP id k11-20020aa792cb0000b02901f1542f2b2bmr900491pfa.31.1619054916242; Wed, 21 Apr 2021 18:28:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619054916; cv=none; d=google.com; s=arc-20160816; b=gd+/XF1d2IbTEiruX7Aj367ItZ3NksGvFCp84k4/WdyjrLEIM6hczW/ZYOb1jRtSSV TT3L8y5GesuAJ9DxU/LMyIHhW6Qb3n4u7oonTWbcobpL4dgjbyGCSO0SkTd2n94HW+kR rO0oR53URG8+a7yvD7Bln8nZ7Acrm0uwdMjLYUx5LkhKbLdW7+66+qEooFQ2WQBYNPiM Ku/dG8yc3g2q5jjM3grTm0rPmW+e4r/pHRnVIMYUhpM502yDPdfTR5CnTKNM+KKYlYHw PNNeFT7cvx5CE2JTLdSdMRSqTI+VYDs52dQS7A6ID3w4ZHB3VbwOqXqluT6yhvmRRVR5 ezKw== 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:date:subject:cc:to:from:dkim-signature; bh=BbWVjYPqLwnuhatdoL5i7GvVhe7lvMrxaHilttyNRMU=; b=Pm7Dk9OFLHtFyGxlNwP3XDNsHNqtk6bg6hmckTNXSlLJw7kE/60AgNSOHyL+PTbzeN URRaNYc7ILpsSlybXlowkTjPlRnTLy49yaJDmgIN/Wl0XhAud3M/Kuk3lIWZg/j1AGW0 B0vQlaDGa19sCIJ4Irg56fAbv6XsClNv/MiwZQvCGX29cxQungLWa/eWx5NRLpVEcGsj 2hT9WtWI95UwrK177LTejsUq3ZHTQe8JpwjfrFGg1g9x+Fbm0ZldU5vK1YeSgtiuDjB2 oQ7OP+7eKr0FDycIzTLAA71auhx/PHQ+oUmyB8AyTYc5h1wl5m1xXLcWQ4gv0X9yMH3N +3Qg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@philpotter-co-uk.20150623.gappssmtp.com header.s=20150623 header.b=nNNm3pMK; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y16si1347393plh.187.2021.04.21.18.28.24; Wed, 21 Apr 2021 18:28:36 -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=@philpotter-co-uk.20150623.gappssmtp.com header.s=20150623 header.b=nNNm3pMK; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343645AbhDUXLj (ORCPT + 99 others); Wed, 21 Apr 2021 19:11:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60090 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234867AbhDUXLi (ORCPT ); Wed, 21 Apr 2021 19:11:38 -0400 Received: from mail-wr1-x435.google.com (mail-wr1-x435.google.com [IPv6:2a00:1450:4864:20::435]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D2433C06138A for ; Wed, 21 Apr 2021 16:11:04 -0700 (PDT) Received: by mail-wr1-x435.google.com with SMTP id r7so30901828wrm.1 for ; Wed, 21 Apr 2021 16:11:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=philpotter-co-uk.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=BbWVjYPqLwnuhatdoL5i7GvVhe7lvMrxaHilttyNRMU=; b=nNNm3pMKhsGiG7o9fMMK7bQrVPxij3MuM7drbcQMRXhPmUb7mixi8xe/eYFsP4axmi X1DnmbwLT0k20AWnWnuiLWKIhaL1EnpEx+kxSqsm6xO+SQ0uyNrIflatz2oLSsrmVz2A VcFS0gy/Y6mBy4twReQBiWG66JcNqODbxpQMbXCRyyQhKUA6huA2dmdrMBiFgb3eqjn8 zjwTmGl/B68ZvNY/TKciP7iM3GkDHGO0trB4kZ9iIqZXbcqxVFsOv2z30uDYla7/XA9S WisSB//a6F6KnOOkTVXNl2UPH9ujF4A2dW2XzxcZi4F09QJEXKIaABBsOEOfhGnXWMFV +b6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=BbWVjYPqLwnuhatdoL5i7GvVhe7lvMrxaHilttyNRMU=; b=e4zSJqw/JBiOhuZ8n6+XUZC0sfQlgYeqLcmqVm2+hdvP+8oi5U7tlf2ukP70u9sS/b /Iw06s23HzHw4AT7SBsd6NIeWVpx2mXlQ7+6B7FkEKlWeRBhzgacQ9NlzrUROVIIomL1 aoU1VUMmPQnUQHpusWLx7kVxbNVI34r8nyyX2D+k9qKJEpnC6YyJJGBXzzBf44AFbghB EWqPNu0dz1i/SIjbfuV1CAeTBFKKu5ESd1HgX5qiLLp1CRKioZZhJUYLEN8kWkgJ36a3 E0lnLZ/Es1QzHCGwfoJIHDFXJ5DwPD+vWP1BuSZWCVgShH7uzma8b2NMS7ToMoEkd3rl P/mg== X-Gm-Message-State: AOAM5333vtsRsRkGWA6ZNat2r+bsns+t7+RjgtqRZTWBhI7KJnFLRuRA WCh9TMO3JXY/Mp5B++NKzMQGw8SKKua5pyWZ X-Received: by 2002:adf:d1c9:: with SMTP id b9mr503203wrd.352.1619046663555; Wed, 21 Apr 2021 16:11:03 -0700 (PDT) Received: from localhost.localdomain (2.0.5.1.1.6.3.8.5.c.c.3.f.b.d.3.0.0.0.0.6.1.f.d.0.b.8.0.1.0.0.2.ip6.arpa. [2001:8b0:df16:0:3dbf:3cc5:8361:1502]) by smtp.gmail.com with ESMTPSA id a2sm3335236wmn.48.2021.04.21.16.11.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Apr 2021 16:11:03 -0700 (PDT) From: Phillip Potter To: davem@davemloft.net Cc: kuba@kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, edumazet@google.com Subject: [PATCH] net: geneve: modify IP header check in geneve6_xmit_skb Date: Thu, 22 Apr 2021 00:11:00 +0100 Message-Id: <20210421231100.7467-1-phil@philpotter.co.uk> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Modify the check in geneve6_xmit_skb to use the size of a struct iphdr rather than struct ipv6hdr. This fixes two kernel selftest failures introduced by commit 6628ddfec758 ("net: geneve: check skb is large enough for IPv4/IPv6 header"), without diminishing the fix provided by that commit. Reported-by: kernel test robot Signed-off-by: Phillip Potter --- drivers/net/geneve.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/geneve.c b/drivers/net/geneve.c index 42f31c681846..a57a5e6f614f 100644 --- a/drivers/net/geneve.c +++ b/drivers/net/geneve.c @@ -988,7 +988,7 @@ static int geneve6_xmit_skb(struct sk_buff *skb, struct net_device *dev, __be16 sport; int err; - if (!pskb_network_may_pull(skb, sizeof(struct ipv6hdr))) + if (!pskb_network_may_pull(skb, sizeof(struct iphdr))) return -EINVAL; sport = udp_flow_src_port(geneve->net, skb, 1, USHRT_MAX, true); -- 2.30.2