From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 70C28C2BD09 for ; Wed, 3 Jul 2024 19:13:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Subject:Cc:To: From:Date:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=BxTCmTex5kv+lgpyy//tkSWZet6gekj5OsnVRcOl+rI=; b=jm1HeTwfZyUmNijPuQ3LTkcBcP pvPXJQfgSX8aB7OgQ69qV4qXdE0nohHDqVIupw/YuLTQFy8i1J6E6SisWoLh7JlI42SRPQ6ASH8wO 1cYD6CX4n9JiiZ7r6opxcOqOamIT3JLhH+Nr8KcsPhtekvaf+WQFRVY9rroKvQn3gwhMZvThY3lvN e2rfp/nfF6nvpXZp1wAZ2LyWO1JoTHtoDhHDZFjml6gWipQO4ia5Zu8qOIHhUVGC7tDCcnIZxmOkr FpQ/YzFic8cnl6utlwYEtXG7jhmmhUTo9iFHEH/YKFdmDYgG0xZzrFVIiTnSB4kO+Zp/BGRB4Ww+0 D21uYS3A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sP5PT-0000000BFVM-0cBq; Wed, 03 Jul 2024 19:12:55 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sP5PE-0000000BFT2-3yWj for linux-arm-kernel@lists.infradead.org; Wed, 03 Jul 2024 19:12:43 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 9E7CB60FDF; Wed, 3 Jul 2024 19:12:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 80F97C2BD10; Wed, 3 Jul 2024 19:12:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1720033959; bh=W2TV0tGrwkg2U2nDDi7LC0UCR05ZRDjKA7OZgxB/bVE=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=Ut843I53JZz/Ny77u61NsPKMd05t/m3FYzT2+ZkMRPxjY/MxqdRQ/gw7sHX/UpSsF gojYoZk14OiQ6e8ysFX47iaSLTbknKTI81QMsOfzWqRxoDJFb0Y4oF9rukqa5G9sPv FcKwPfBwvFY95L1Xa7zv4mpcdRaFhI50qdozouxDA7Nq5vStsgacIDJp+d6fah+AcV DGTVxZ1AIUa58R1k6+b1LpBdkDXpISKIoOU3eTUhIE+oxKV+c4Ba3SeP3nfjesDbis Yk1KcZqQq/i5EtxGSl0EfVfBf33S5qg+TtrCgP/P0GUG7AQRvr+sh6E0hEXRySGxnk 5GvvCZoRpzwIw== Date: Wed, 3 Jul 2024 12:12:37 -0700 From: Jakub Kicinski To: Maxime Chevallier Cc: Simon Horman , davem@davemloft.net, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, thomas.petazzoni@bootlin.com, Andrew Lunn , Eric Dumazet , Paolo Abeni , Russell King , linux-arm-kernel@lists.infradead.org, Christophe Leroy , Herve Codina , Florian Fainelli , Heiner Kallweit , Vladimir Oltean , =?UTF-8?B?S8O2cnk=?= Maincent , Jesse Brandeburg , Marek =?UTF-8?B?QmVow7pu?= , Piergiorgio Beruto , Oleksij Rempel , =?UTF-8?B?Tmljb2zDsg==?= Veronese , mwojtas@chromium.org, Nathan Chancellor , Antoine Tenart , Marc Kleine-Budde Subject: Re: [PATCH net-next v14 12/13] net: ethtool: strset: Allow querying phy stats by index Message-ID: <20240703121237.3f8b9125@kernel.org> In-Reply-To: <20240703085515.25dab47c@fedora-2.home> References: <20240701131801.1227740-1-maxime.chevallier@bootlin.com> <20240701131801.1227740-13-maxime.chevallier@bootlin.com> <20240702105411.GF598357@kernel.org> <20240703085515.25dab47c@fedora-2.home> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240703_121242_096232_34B50F50 X-CRM114-Status: GOOD ( 14.31 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, 3 Jul 2024 08:55:15 +0200 Maxime Chevallier wrote: > > Elsewhere in this function it is assumed that info may be NULL. > > But here it is dereferenced unconditionally. > > Hmm in almst all netlink commands we do dereference the genl_info *info > pointer without checks. > > I've looked into net/netlink/genetlink.c to backtrack call-sites and it > looks to be that indeed info can't be NULL (either populated from > genl_start() or genl_family_rcv_msg_doit(). Maybe Jakub can confirm > this ? > > If what I say above is correct, I can include a small patch to remove > the un-necessary check that makes smatch think the genl_info pointer can > be NULL. The info used to be null during dumps, but I think we fixed that in f946270d05c2 ("ethtool: netlink: always pass genl_info to .prepare_data") Perhaps I should have cleaned up existing code :S