From: <Parthiban.Veerasooran@microchip.com>
To: <maxime.chevallier@bootlin.com>
Cc: <netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<thomas.petazzoni@bootlin.com>,
<linux-arm-kernel@lists.infradead.org>,
<christophe.leroy@csgroup.eu>, <herve.codina@bootlin.com>,
<f.fainelli@gmail.com>, <vladimir.oltean@nxp.com>,
<kory.maincent@bootlin.com>, <o.rempel@pengutronix.de>,
<horms@kernel.org>, <romain.gantois@bootlin.com>,
<piergiorgio.beruto@gmail.com>, <davem@davemloft.net>,
<andrew@lunn.ch>, <kuba@kernel.org>, <edumazet@google.com>,
<pabeni@redhat.com>, <hkallweit1@gmail.com>
Subject: Re: [PATCH net 0/2] net: ethtool: netlink: Fix notifications for
Date: Fri, 28 Feb 2025 06:19:18 +0000 [thread overview]
Message-ID: <c6df7040-40d2-46e0-b8f3-a28227d2d98c@microchip.com> (raw)
In-Reply-To: <20250227182454.1998236-1-maxime.chevallier@bootlin.com>
Hi Maxime,
I did a quick test with your patches and it seems working fine without
kernel crash.
Best regards,
Parthiban V
On 27/02/25 11:54 pm, Maxime Chevallier wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
>
> It has been found (thanks to Parthiban) that the PLCA ethtool commands
> were failing since 6.12, due to the phy_link_topology work. This was
> traced back to the ethnl notifications mechanism, in which calls to
> ethnl_req_get_phydev() crashed in the notification path following a
> ->set request.
>
> The typical callsite for ethnl_req_get_phydev() looks like :
>
> phydev = ethnl_req_get_phydev(req_base, tb[ETHTOOL_A_XXX_HEADER],
> info->extack);
>
> as 'tb' is NULL in the notification path for the ->prepare_data ethnl
> ops, this causes crashes. The solution for that is to change the
> prototype of ethnl_req_get_phydev() to perform checks inside the helper
> (patch 1).
>
> While investigating that, I realised that the notification path for PHYs
> is not correct anyways. As we don't have a netlink request to parse, we
> can't know for sure which PHY the notification event targets in the case
> of a notification following a ->set request.
>
> Patch 2 introduces a context structure that is used between ->set
> requests and the followup notification, to keep track of the PHY that
> the original request targeted for the notification.
>
> Thanks Parthiban for the report (not on netdev@ though).
>
> Maxime
>
> Maxime Chevallier (2):
> net: ethtool: netlink: Allow NULL nlattrs when getting a phy_device
> net: ethtool: netlink: Pass a context for default ethnl notifications
>
> net/ethtool/cabletest.c | 8 ++++----
> net/ethtool/linkstate.c | 2 +-
> net/ethtool/netlink.c | 21 +++++++++++++++++----
> net/ethtool/netlink.h | 5 +++--
> net/ethtool/phy.c | 2 +-
> net/ethtool/plca.c | 6 +++---
> net/ethtool/pse-pd.c | 4 ++--
> net/ethtool/stats.c | 2 +-
> net/ethtool/strset.c | 2 +-
> 9 files changed, 33 insertions(+), 19 deletions(-)
>
> --
> 2.48.1
>
next prev parent reply other threads:[~2025-02-28 6:19 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-27 18:24 [PATCH net 0/2] net: ethtool: netlink: Fix notifications for Maxime Chevallier
2025-02-27 18:24 ` [PATCH net 1/2] net: ethtool: netlink: Allow NULL nlattrs when getting a phy_device Maxime Chevallier
2025-02-27 18:24 ` [PATCH net 2/2] net: ethtool: netlink: Pass a context for default ethnl notifications Maxime Chevallier
2025-03-01 2:24 ` Jakub Kicinski
2025-03-01 9:53 ` Maxime Chevallier
2025-03-01 10:38 ` Maxime Chevallier
2025-02-27 18:26 ` [PATCH net 0/2] net: ethtool: netlink: Fix notifications for Maxime Chevallier
2025-02-28 6:19 ` Parthiban.Veerasooran [this message]
2025-02-28 8:14 ` Maxime Chevallier
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=c6df7040-40d2-46e0-b8f3-a28227d2d98c@microchip.com \
--to=parthiban.veerasooran@microchip.com \
--cc=andrew@lunn.ch \
--cc=christophe.leroy@csgroup.eu \
--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=kory.maincent@bootlin.com \
--cc=kuba@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maxime.chevallier@bootlin.com \
--cc=netdev@vger.kernel.org \
--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