Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp599688pxy; Thu, 22 Apr 2021 09:05:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzrf8rigtD2thAYt3UdEoF9HdrGhXg807UnLQ2mMHojsWSrgBJ83w9eDWeVz1KYqUXnLoyg X-Received: by 2002:a63:da10:: with SMTP id c16mr4233459pgh.221.1619107535121; Thu, 22 Apr 2021 09:05:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619107535; cv=none; d=google.com; s=arc-20160816; b=y6uM/zxzPwBKFBXP5eCz5LTOazlVUlspsZi7wmM3l6sBa4VlF2DprEB+u+YHDF18q4 a4gRxbnWxmrUDjBERNMbRWYks7mX54Xf309wG64mrxeJtz5Gdy41XZ3KT18MnWd3yKRC SDIkWGOlsD6BDsN3sT1R95FG20t5fN35xZ7AfTyVtlaz4jmVUtxZofu/O6vMRS0/0pBi LNCyVlA2Xr8Gc6weNLDbaDxHhUSK/Mx6uxRhOBPKcPOsipHcT7Wpv6p0t5SJeuzIO3Aw aOJr4bvwFQP94WfclAzbT2CNDnMN845kVOj+EMTel27RBBl8WklalTqlwpDApnKqujuv JsOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-disposition :in-reply-to:mime-version:references:message-id:subject:cc:to:from :date; bh=OPJnpXMrne9ZNKfyt7qRSws+E8KcE0bTioATOQoBEds=; b=MahjwDh9K0ogniIgGBRti+Vzn6RRYSV96J6Svrn5Np+B8RhHWDGkGzw8jszo3/v7HT vrT0ioniulJebRSr3oojD0hNHPyLVA/BRr1HNlZ1Itl/NbkELO7NbdGYYEFoU7TFsb85 HJSLNlBvS+3shaWteAtGGfJ/pxTVq1Pv4aPmo3sDy9Y/Amb/TUFRVTmBjGof8N8t4BGj rbIxLQ+YcOShHCoBlR2Q2WXUqORS9ofvre42gL7/OIKEdrX2ipXrYSDdZw6CfsDNEKqb K8ujW87EemDfqc+qx1W27DN+VjhD1Mttm/SAMykF8jkCAps0RM4nnRjx3GIukNHHX83z CTiA== 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 o13si3802374pgf.354.2021.04.22.09.05.22; Thu, 22 Apr 2021 09:05:35 -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 S236414AbhDVQEk convert rfc822-to-8bit (ORCPT + 99 others); Thu, 22 Apr 2021 12:04:40 -0400 Received: from us-smtp-delivery-44.mimecast.com ([207.211.30.44]:32784 "EHLO us-smtp-delivery-44.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236169AbhDVQEj (ORCPT ); Thu, 22 Apr 2021 12:04:39 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-207-ufYayBnTNhuXUT5o0X5VwA-1; Thu, 22 Apr 2021 12:03:59 -0400 X-MC-Unique: ufYayBnTNhuXUT5o0X5VwA-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D65E81B2C9B3; Thu, 22 Apr 2021 16:03:36 +0000 (UTC) Received: from hog (unknown [10.40.192.89]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C5CA06091B; Thu, 22 Apr 2021 16:03:34 +0000 (UTC) Date: Thu, 22 Apr 2021 18:03:32 +0200 From: Sabrina Dubroca To: Florian Westphal Cc: Phillip Potter , 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: References: <20210421231100.7467-1-phil@philpotter.co.uk> <20210422003942.GF4841@breakpoint.cc> MIME-Version: 1.0 In-Reply-To: <20210422003942.GF4841@breakpoint.cc> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=sd@queasysnail.net X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: queasysnail.net Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Content-Transfer-Encoding: 8BIT Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 2021-04-22, 02:39:42 +0200, Florian Westphal wrote: > 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? I'm not sure the original commit (6628ddfec758 ("net: geneve: check skb is large enough for IPv4/IPv6 header")) is correct either. GENEVE isn't limited to carrying IP, I think an ethernet header with not much else on top should be valid. -- Sabrina