[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240703121237.3f8b9125@kernel.org>
Date: Wed, 3 Jul 2024 12:12:37 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Maxime Chevallier <maxime.chevallier@...tlin.com>
Cc: Simon Horman <horms@...nel.org>, davem@...emloft.net,
netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
thomas.petazzoni@...tlin.com, Andrew Lunn <andrew@...n.ch>, Eric Dumazet
<edumazet@...gle.com>, Paolo Abeni <pabeni@...hat.com>, Russell King
<linux@...linux.org.uk>, linux-arm-kernel@...ts.infradead.org, Christophe
Leroy <christophe.leroy@...roup.eu>, Herve Codina
<herve.codina@...tlin.com>, Florian Fainelli <f.fainelli@...il.com>, Heiner
Kallweit <hkallweit1@...il.com>, Vladimir Oltean <vladimir.oltean@....com>,
Köry Maincent <kory.maincent@...tlin.com>, Jesse Brandeburg
<jesse.brandeburg@...el.com>, Marek Behún
<kabel@...nel.org>, Piergiorgio Beruto <piergiorgio.beruto@...il.com>,
Oleksij Rempel <o.rempel@...gutronix.de>, Nicolò Veronese
<nicveronese@...il.com>, mwojtas@...omium.org, Nathan Chancellor
<nathan@...nel.org>, Antoine Tenart <atenart@...nel.org>, Marc Kleine-Budde
<mkl@...gutronix.de>
Subject: Re: [PATCH net-next v14 12/13] net: ethtool: strset: Allow querying
phy stats by index
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
Powered by blists - more mailing lists