public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Maxime Chevallier <maxime.chevallier@bootlin.com>
To: Eric Dumazet <edumazet@google.com>
Cc: davem@davemloft.net, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org, thomas.petazzoni@bootlin.com,
	"Andrew Lunn" <andrew@lunn.ch>,
	"Jakub Kicinski" <kuba@kernel.org>,
	"Paolo Abeni" <pabeni@redhat.com>,
	"Russell King" <linux@armlinux.org.uk>,
	linux-arm-kernel@lists.infradead.org,
	"Christophe Leroy" <christophe.leroy@csgroup.eu>,
	"Herve Codina" <herve.codina@bootlin.com>,
	"Florian Fainelli" <f.fainelli@gmail.com>,
	"Heiner Kallweit" <hkallweit1@gmail.com>,
	"Vladimir Oltean" <vladimir.oltean@nxp.com>,
	"Köry Maincent" <kory.maincent@bootlin.com>,
	"Jesse Brandeburg" <jesse.brandeburg@intel.com>,
	"Marek Behún" <kabel@kernel.org>,
	"Piergiorgio Beruto" <piergiorgio.beruto@gmail.com>,
	"Oleksij Rempel" <o.rempel@pengutronix.de>,
	"Nicolò Veronese" <nicveronese@gmail.com>,
	"Simon Horman" <horms@kernel.org>,
	mwojtas@chromium.org, "Nathan Chancellor" <nathan@kernel.org>,
	"Antoine Tenart" <atenart@kernel.org>,
	"Marc Kleine-Budde" <mkl@pengutronix.de>,
	"Dan Carpenter" <dan.carpenter@linaro.org>,
	"Romain Gantois" <romain.gantois@bootlin.com>
Subject: Re: [PATCH net-next v18 07/13] net: ethtool: Introduce a command to list PHYs on an interface
Date: Tue, 10 Sep 2024 19:20:20 +0200	[thread overview]
Message-ID: <20240910192020.5ab9cd16@fedora.home> (raw)
In-Reply-To: <CANn89iLQYsyADrdW04PpuxEdAEhBkVQm+uVV8=CDmX_Fswdvrw@mail.gmail.com>

Hello Eric,

On Tue, 10 Sep 2024 18:41:03 +0200
Eric Dumazet <edumazet@google.com> wrote:

> > +int ethnl_phy_doit(struct sk_buff *skb, struct genl_info *info)
> > +{
> > +       struct phy_req_info req_info = {};
> > +       struct nlattr **tb = info->attrs;
> > +       struct sk_buff *rskb;
> > +       void *reply_payload;
> > +       int reply_len;
> > +       int ret;
> > +
> > +       ret = ethnl_parse_header_dev_get(&req_info.base,
> > +                                        tb[ETHTOOL_A_PHY_HEADER],
> > +                                        genl_info_net(info), info->extack,
> > +                                        true);
> > +       if (ret < 0)
> > +               return ret;
> > +
> > +       rtnl_lock();
> > +
> > +       ret = ethnl_phy_parse_request(&req_info.base, tb, info->extack);
> > +       if (ret < 0)
> > +               goto err_unlock_rtnl;
> > +
> > +       /* No PHY, return early */  
> 
> I got a syzbot report here.

I seem to have missed the report, sorry about that.

> 
> Should we fix this with :
> 
> diff --git a/net/ethtool/phy.c b/net/ethtool/phy.c
> index 560dd039c6625ac0925a0f28c14ce77cf768b6a5..4ef7c6e32d1087dc71acb467f9cd2ab8faf4dc39
> 100644
> --- a/net/ethtool/phy.c
> +++ b/net/ethtool/phy.c
> @@ -164,7 +164,7 @@ int ethnl_phy_doit(struct sk_buff *skb, struct
> genl_info *info)
>                 goto err_unlock_rtnl;
> 
>         /* No PHY, return early */
> -       if (!req_info.pdn->phy)
> +       if (!req_info.pdn)
>                 goto err_unlock_rtnl;
> 
>         ret = ethnl_phy_reply_size(&req_info.base, info->extack);
> 
> 

Indeed that's the correct fix. Should I send it ? ( including
suggested-by/reported-by )

Thanks,

Maxime

  reply	other threads:[~2024-09-10 17:20 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-21 15:09 [PATCH net-next v18 00/13] Introduce PHY listing and link_topology tracking Maxime Chevallier
2024-08-21 15:09 ` [PATCH net-next v18 01/13] net: phy: Introduce ethernet link topology representation Maxime Chevallier
2024-08-21 15:09 ` [PATCH net-next v18 02/13] net: sfp: pass the phy_device when disconnecting an sfp module's PHY Maxime Chevallier
2024-08-21 15:09 ` [PATCH net-next v18 03/13] net: phy: add helpers to handle sfp phy connect/disconnect Maxime Chevallier
2024-08-21 15:09 ` [PATCH net-next v18 04/13] net: sfp: Add helper to return the SFP bus name Maxime Chevallier
2024-08-21 15:09 ` [PATCH net-next v18 05/13] net: ethtool: Allow passing a phy index for some commands Maxime Chevallier
2024-08-21 15:10 ` [PATCH net-next v18 06/13] netlink: specs: add phy-index as a header parameter Maxime Chevallier
2024-08-21 15:10 ` [PATCH net-next v18 07/13] net: ethtool: Introduce a command to list PHYs on an interface Maxime Chevallier
2024-09-10 16:41   ` Eric Dumazet
2024-09-10 17:20     ` Maxime Chevallier [this message]
2024-09-10 17:23       ` Eric Dumazet
2024-08-21 15:10 ` [PATCH net-next v18 08/13] netlink: specs: add ethnl PHY_GET command set Maxime Chevallier
2024-08-21 15:10 ` [PATCH net-next v18 09/13] net: ethtool: plca: Target the command to the requested PHY Maxime Chevallier
2024-08-21 15:10 ` [PATCH net-next v18 10/13] net: ethtool: pse-pd: " Maxime Chevallier
2024-08-21 15:10 ` [PATCH net-next v18 11/13] net: ethtool: cable-test: " Maxime Chevallier
2024-08-21 15:10 ` [PATCH net-next v18 12/13] net: ethtool: strset: Allow querying phy stats by index Maxime Chevallier
2024-08-21 15:10 ` [PATCH net-next v18 13/13] Documentation: networking: document phy_link_topology Maxime Chevallier
2024-08-23 12:10 ` [PATCH net-next v18 00/13] Introduce PHY listing and link_topology tracking patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240910192020.5ab9cd16@fedora.home \
    --to=maxime.chevallier@bootlin.com \
    --cc=andrew@lunn.ch \
    --cc=atenart@kernel.org \
    --cc=christophe.leroy@csgroup.eu \
    --cc=dan.carpenter@linaro.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=f.fainelli@gmail.com \
    --cc=herve.codina@bootlin.com \
    --cc=hkallweit1@gmail.com \
    --cc=horms@kernel.org \
    --cc=jesse.brandeburg@intel.com \
    --cc=kabel@kernel.org \
    --cc=kory.maincent@bootlin.com \
    --cc=kuba@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=mkl@pengutronix.de \
    --cc=mwojtas@chromium.org \
    --cc=nathan@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=nicveronese@gmail.com \
    --cc=o.rempel@pengutronix.de \
    --cc=pabeni@redhat.com \
    --cc=piergiorgio.beruto@gmail.com \
    --cc=romain.gantois@bootlin.com \
    --cc=thomas.petazzoni@bootlin.com \
    --cc=vladimir.oltean@nxp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox