Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp60834pxy; Wed, 21 Apr 2021 18:31:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxJa/EC0gmwf2w2VzxONtpjLn00TGPySSBk5fsVwRCT8G67Ayj4QmCKq5Iem3le3oh5Fyf5 X-Received: by 2002:a17:903:2310:b029:eb:73d5:3e4e with SMTP id d16-20020a1709032310b02900eb73d53e4emr909052plh.66.1619055092786; Wed, 21 Apr 2021 18:31:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619055092; cv=none; d=google.com; s=arc-20160816; b=tvH43UL+rriz35GauhQUgjEDUvSlBBzHbAVUmC+Ezccz4UXrPPUx2783jSyD9w5ikV tSglsERAOXw0bMIlyJE0EZebQ3iY6gdlSHvpgpmpqk/FYU/+/LXLGEgxnm5W4U+EncAy TLVUllHHUmTDXTc1kdFcQVomXWHuSRq09iJaQdQM0culNKCArCxHHxAtFnTlDhiJ+ZPO G3ZxD3BabMBeVjONg35S6cu2pjYESRuo4gd8Sy4QAp37l78B1MFYwfCo0/Jz0BraGIs7 OKbmmSFsjkACy8UKVP7qR+eIefMkMnaXXbQ19VeG7IVhM8Xrh5HLhcfOeHEG8xBkAX+s rDMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=l0s47wZmx64awC0Admi3xDmdK4Y+RFOsl9yhvjQusY0=; b=bOOrz7Ry14ZlbSPTEyLg8DmQlDvfCGrOAg41q2rAokOaqyrN5d/PARvw50SD5Y06Ar 2D+8Jw56UitBuWbSm/VwvHe4zXt3/ShGtsja8wsd7gHhoFXDBqbR5jSMXKhS9vkbMQYt Ge+ZDuOLZST3p6Nrop2p29e1mOalphO6sgIR5MtMj0cpiPZnu7BR1HODKDWC/FHMg4mR 1LNo8XB3aXXkaShHO8x43OiKpdMbiV0OnxG5BXC+03qMsWB54Svrc0UPzCA9+lB0M7mx R1VfSzTF1STUM3eyf1bqcU1li5mv3gB6wywltO4Qey50K7pALbEV47K7GqXFBxcvCkbX 2VeA== ARC-Authentication-Results: i=1; mx.google.com; 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 hg20si1201452pjb.162.2021.04.21.18.31.20; Wed, 21 Apr 2021 18:31:32 -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; 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 S241431AbhDVAlK (ORCPT + 99 others); Wed, 21 Apr 2021 20:41:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51366 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344084AbhDVAky (ORCPT ); Wed, 21 Apr 2021 20:40:54 -0400 Received: from Chamillionaire.breakpoint.cc (Chamillionaire.breakpoint.cc [IPv6:2a0a:51c0:0:12e:520::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B8BCEC061345; Wed, 21 Apr 2021 17:39:48 -0700 (PDT) Received: from fw by Chamillionaire.breakpoint.cc with local (Exim 4.92) (envelope-from ) id 1lZNNe-0000u0-3V; Thu, 22 Apr 2021 02:39:42 +0200 Date: Thu, 22 Apr 2021 02:39:42 +0200 From: Florian Westphal To: Phillip Potter Cc: davem@davemloft.net, kuba@kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, edumazet@google.com Subject: Re: [PATCH] net: geneve: modify IP header check in geneve6_xmit_skb Message-ID: <20210422003942.GF4841@breakpoint.cc> References: <20210421231100.7467-1-phil@philpotter.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210421231100.7467-1-phil@philpotter.co.uk> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Phillip Potter wrote: > 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. What errors? > 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; Seems this is papering over some bug, this change makes no sense to me. Can you please explain this?