Received: by 2002:ab2:7855:0:b0:1f9:5764:f03e with SMTP id m21csp974726lqp; Thu, 23 May 2024 05:56:03 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVJMVdPxEs1i6S6He71ewhzYYAfP6iTgTF6uNTl80MKdyrrdrzCw/wdqiYIfz/UnRpE+aX+w8ljLR+aEGLRee3TbK6pnwMqJCTSwHdfLg== X-Google-Smtp-Source: AGHT+IE/LogmuqCXciElGgagqSExVAhh+36OLgAxgWPEie1K85xeeFfUSuHN3hpQwo08cC79d2L+ X-Received: by 2002:a05:6870:2323:b0:23b:caff:be33 with SMTP id 586e51a60fabf-24c68e3f95emr5481933fac.49.1716468962876; Thu, 23 May 2024 05:56:02 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716468962; cv=pass; d=google.com; s=arc-20160816; b=wUhVA4foub8c8jSoPxZ2jYVZwxonxbc+gTx0vKJwW/Jg8jqzLF/k1tdIhTYwvixIkq Mqw94fVq2dzkHVetnhHWNm55blZwd/lKy+xVDcFUOj8aeAN8Vvrc93Q49XzmUUmt/ArE XqN3TV13VEXknxngjJ1RkLl3Rje/WOg27CuE5dTmwmak5gcwMXlJGV0kO2LBH5Bupuga Z0f9LqTUrDnMAhjNVwHBR5SzN38enC5KmnMn/pHxhPO6a9YKFjqGGk2IlcUOUr88ATTY 1u+FrDv9XsuU7vT54dVv34YfLsnIQyKdAF+HG1KHfFtQ9LfwueLdSDgP99oOI9RehE/k m+Sw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=wYFV93Y+KpRst1YHt+QKOqFRQmnZCOL9YEY0BzIdxrk=; fh=QCnriEoKOVZp8TzhjDM58RtAsDRlA8fP849BVpi8tcc=; b=fTFvIkPv3VdT8UGquZVVIl1/sRa91DADI3tKNh+pMDBOCRssSpC9pxtQvmkvkymefz M/Drn55lvT7HbAsvacQgRpj0KIZw/1jPq/v9SF/BzFp4JQjqvNPuqjmJRzrV8AI5FwmS 9yToR2DrhIyV+Pn2E2+u9o7gLXEhaj1fth/vf0myRYlFratBGlLLaD/59TFgU2IfwEh3 YRHq8ia+K6STZV7V6Gbn7fRNnHDddS6tdI1G4C32k8OglSLUvI9CNjdZ/x9yhOHKYEWA PyDlrCRjldKnu0I9SBnMm6lZf56NNshD1IQmMemnxPl1Ax6Uq/tcJP2R2JYzGNxHHraJ GNzQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=QBoelqo2; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-187521-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-187521-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id d75a77b69052e-43e39c75b2bsi155170161cf.297.2024.05.23.05.56.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 May 2024 05:56:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-187521-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=QBoelqo2; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-187521-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-187521-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 82D531C215E0 for ; Thu, 23 May 2024 12:56:02 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E796714A4F0; Thu, 23 May 2024 12:55:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="QBoelqo2" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1841C8174C; Thu, 23 May 2024 12:55:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716468954; cv=none; b=Y+ijDVZqLMw5Q7proWnqw006uxXzLArerjz5eI+S6tQzW7eM20uv09a0r+dZBOXDEBxlFycww7ULId/jcBaaSZPUt7Vlcv90m4wj3AXGSuR0W3TJGBkzbOvhM6FXDp5sUiKFRWLIoxhi0ffO1ZXZQDdJaConosztsAZrdsvP0lk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716468954; c=relaxed/simple; bh=lZWCDNLYdh3G7nFtzihodDsqvt7voL9bMlCo0OYVZFc=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=UfXylvGCh+bsOG7ZVWGBhxxUHr3acAkIt+XpKJamQr6fBRr1fJTI6fL2zkNYO7+VzshI1YI1VPGObGzPOu7QyLsXvAMFGDbrALliPIJ9OuZeZZcoW/C7aNAt4h5yNDKNg56tfQVVAxGkny2e/KnzuMFGiuPa+dt8/OI1nblPOKw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=QBoelqo2; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7E257C2BD10; Thu, 23 May 2024 12:55:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1716468953; bh=lZWCDNLYdh3G7nFtzihodDsqvt7voL9bMlCo0OYVZFc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=QBoelqo2F9lLszwI4GhC1WFQ9QqyxA3cwVF7viiB0crQWhNITasNNPo7vMZiaCvdo oZ9te/h4q6n2Vstmr73apygmKDo20pvnOu94o95UuzGxgzuvg7oxWXS2BC0ugcK3oG KmZkfG7+UO2Fz+aAFWdpuaIvXc1S4HWj5pV/TNSz7qBagioDvOl/64D6I7a8RtyyMU Q42tLqzKF9CmvM8XjkIxw0meTPIOgCmF/oIFJii+5DlDrHsp3x+6x2sb6Hbw/1y/QD npiK30rk6isdOmP15+O2+pyL7gBHDkI0aCXwzRcGW3uY2/U9MVvHaoMgF+9dBADeMI mRNvvntnQai+Q== Date: Thu, 23 May 2024 13:55:49 +0100 From: Simon Horman To: Lin Ma Cc: davem@davemloft.net, dsahern@kernel.org, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, yuehaibing@huawei.com, larysa.zaremba@intel.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v1 net-next] ila: avoid genlmsg_reply when not ila_map found Message-ID: <20240523125549.GM883722@kernel.org> References: <20240522031537.51741-1-linma@zju.edu.cn> <20240522170302.GA883722@kernel.org> <44456b54.180f2.18fa31eca2b.Coremail.linma@zju.edu.cn> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <44456b54.180f2.18fa31eca2b.Coremail.linma@zju.edu.cn> On Thu, May 23, 2024 at 09:44:15AM +0800, Lin Ma wrote: > Hi Simon. > > > > > Hi Lin Ma, > > > > The lines immediately above those covered by this patch are as follows: > > > > ret = -ESRCH; > > ila = ila_lookup_by_params(&xp, ilan); > > if (ila) { > > ret = ila_dump_info(ila, > > > > > @@ -483,6 +483,8 @@ int ila_xlat_nl_cmd_get_mapping(struct sk_buff *skb, struct genl_info *info) > > > info->snd_portid, > > > info->snd_seq, 0, msg, > > > info->genlhdr->cmd); > > > + } else { > > > + ret = -EINVAL; > > > } > > > > > > rcu_read_unlock(); > > > > And the lines following, up to the end of the function, are: > > > > if (ret < 0) > > goto out_free; > > > > return genlmsg_reply(msg, info); > > > > out_free: > > nlmsg_free(msg); > > return ret; > > > > By my reading, without your patch, if ila is not found (NULL) > > then ret will be -ESRCH, and genlmsg_reply will not be called. > > > > I feel that I am missing something here. > > Oh my bad, it seems this bug was already fixed by the > commit 693aa2c0d9b6 ("ila: do not generate empty messages > in ila_xlat_nl_cmd_get_mapping()") last year. > And my dated kernel does not apply that one. > > Thanks for reminding me of this false alarm. Thanks for checking. I think we can retire this patch.