Received: by 2002:a19:ef0c:0:0:0:0:0 with SMTP id n12csp980009lfh; Thu, 27 Jan 2022 04:43:14 -0800 (PST) X-Google-Smtp-Source: ABdhPJyxANGbToERFyYLV2TYFLkG9CRl105QYWnGnH/nVI78u/qo+s9xJpanexKWSZSMSH1j32MP X-Received: by 2002:a17:907:7e9a:: with SMTP id qb26mr2669101ejc.549.1643287393881; Thu, 27 Jan 2022 04:43:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643287393; cv=none; d=google.com; s=arc-20160816; b=G7nZk9WdhcbuJPSAJnOSmLfa350ldZgtVXuwVQYU/W7Y5kQHMpezFV6kZ/diSA3mRg jGhQ5NBOOMA8onm3/q6FTPBpc/plJRlMRUsAsNO5v/0Igbt8uQToEdMboZ87wdF53uAC 8BP2DCQXo2XE3gtahqNmxp5RS1AOmIRbSvoNHbyC4iTeSDZItJPDM2iwIalbKUit4Ane Tmdsf41jsWk65xESAXDP7bDjCDtD9XKZyVjLHe/gZ3TDkUwfxJY4gSOS+/560sZEn3RI ibQna+oGq0yvAezC8lCyfiQxKqGFuNAB6vGmeldP9fLe1IwqG/rmV3nAKgeYEdWc7xAg hGIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=T3Ucc9twUy0Juw9Orr4CxieofIOUyTD1X//ZgttOjdA=; b=l400rdDVw6H5ZMHFIzhxzF2UOc+2PfQLQdpAlbjx7c9xgtyzgH9IAsgnjvHypuKZKG axfFjRmB9x+hYTwLk6gOMQNJYreJX5IHEX2e0HXY/D//jz65dM2HPI4/gm275sbjX+IT 11TeeCQH7npGaP6LWGkifCssJuubQ4F1ycY5aC60ZPKP93etoQ6HYOKAzqS4zh58EY7H 3yTZsi2yLAJ4JmYMlYi0PN+Tuf467OCpD87QnDprIUGDDbygWP+tBXSw6wrtOQSc6HY2 6S0PGhx5DtTkGhloj3VnHeO2HGwcfWxWPqtrneDwR9bnpmZZCD+nRZwnWYEgM0GePv73 0fqQ== 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 z13si1490418edb.237.2022.01.27.04.42.49; Thu, 27 Jan 2022 04:43:13 -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; 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 S236770AbiA0GdH (ORCPT + 99 others); Thu, 27 Jan 2022 01:33:07 -0500 Received: from a.mx.secunet.com ([62.96.220.36]:57620 "EHLO a.mx.secunet.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229685AbiA0GdE (ORCPT ); Thu, 27 Jan 2022 01:33:04 -0500 Received: from localhost (localhost [127.0.0.1]) by a.mx.secunet.com (Postfix) with ESMTP id B8AA920582; Thu, 27 Jan 2022 07:33:02 +0100 (CET) X-Virus-Scanned: by secunet Received: from a.mx.secunet.com ([127.0.0.1]) by localhost (a.mx.secunet.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id RD8ONOuL5xsy; Thu, 27 Jan 2022 07:33:02 +0100 (CET) Received: from mailout1.secunet.com (mailout1.secunet.com [62.96.220.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by a.mx.secunet.com (Postfix) with ESMTPS id 462F120519; Thu, 27 Jan 2022 07:33:02 +0100 (CET) Received: from cas-essen-01.secunet.de (unknown [10.53.40.201]) by mailout1.secunet.com (Postfix) with ESMTP id 34F4480004A; Thu, 27 Jan 2022 07:33:02 +0100 (CET) Received: from mbx-essen-01.secunet.de (10.53.40.197) by cas-essen-01.secunet.de (10.53.40.201) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.17; Thu, 27 Jan 2022 07:33:01 +0100 Received: from gauss2.secunet.de (10.182.7.193) by mbx-essen-01.secunet.de (10.53.40.197) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.17; Thu, 27 Jan 2022 07:33:01 +0100 Received: by gauss2.secunet.de (Postfix, from userid 1000) id 5796131805DC; Thu, 27 Jan 2022 07:33:01 +0100 (CET) Date: Thu, 27 Jan 2022 07:33:01 +0100 From: Steffen Klassert To: Pavel Machek CC: Greg Kroah-Hartman , , , Antony Antony , Eyal Birger , Sasha Levin Subject: Re: [PATCH 5.10 173/563] xfrm: interface with if_id 0 should return error Message-ID: <20220127063301.GQ1223722@gauss3.secunet.de> References: <20220124184024.407936072@linuxfoundation.org> <20220124184030.397155595@linuxfoundation.org> <20220126215937.GA31158@duo.ucw.cz> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20220126215937.GA31158@duo.ucw.cz> X-ClientProxiedBy: cas-essen-01.secunet.de (10.53.40.201) To mbx-essen-01.secunet.de (10.53.40.197) X-EXCLAIMER-MD-CONFIG: 2c86f778-e09b-4440-8b15-867914633a10 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 26, 2022 at 10:59:37PM +0100, Pavel Machek wrote: > Hi! > > > [ Upstream commit 8dce43919566f06e865f7e8949f5c10d8c2493f5 ] > > > > xfrm interface if_id = 0 would cause xfrm policy lookup errors since > > Commit 9f8550e4bd9d. > > > > Now explicitly fail to create an xfrm interface when if_id = 0 > > This will break changelink completely, AFAICT. > > > @@ -672,7 +677,12 @@ static int xfrmi_changelink(struct net_device *dev, struct nlattr *tb[], > > { > > struct xfrm_if *xi = netdev_priv(dev); > > struct net *net = xi->net; > > - struct xfrm_if_parms p; > > + struct xfrm_if_parms p = {}; > > + > > + if (!p.if_id) { > > + NL_SET_ERR_MSG(extack, "if_id must be non zero"); > > + return -EINVAL; > > + } > > > > xfrmi_netlink_parms(data, &p); > > xi = xfrmi_locate(net, &p); > > if_id will be always 0, because it was not yet initialized. > > Best regards, > Pavel > > Signed-off-by: Pavel Machek Can you please resend this with proper commit message and 'Fixes:' tag? Thanks!