lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250901093530.v5surl2wgpusedph@skbuf>
Date: Mon, 1 Sep 2025 12:35:30 +0300
From: Vladimir Oltean <vladimir.oltean@....com>
To: "Russell King (Oracle)" <linux@...linux.org.uk>
Cc: Andrew Lunn <andrew@...n.ch>, Heiner Kallweit <hkallweit1@...il.com>,
	"David S. Miller" <davem@...emloft.net>,
	Eric Dumazet <edumazet@...gle.com>,
	Jakub Kicinski <kuba@...nel.org>, netdev@...r.kernel.org,
	Paolo Abeni <pabeni@...hat.com>
Subject: Re: [PATCH net] net: phy: fix phy_uses_state_machine()

On Mon, Sep 01, 2025 at 10:09:17AM +0100, Russell King (Oracle) wrote:
> On Mon, Sep 01, 2025 at 11:42:25AM +0300, Vladimir Oltean wrote:
> > On Sun, Aug 31, 2025 at 05:38:11PM +0100, Russell King (Oracle) wrote:
> > > phydev->phy_link_change is initialised by phy_attach_direct(), and
> > > overridden by phylink. This means that a never-connected PHY will
> > > have phydev->phy_link_change set to NULL, which causes
> > > phy_uses_state_machine() to return true. This is incorrect.
> > 
> > Another nitpick regarding phrasing here: the never-connected PHY doesn't
> > _cause_ phy_uses_state_machine() to return true. It returns true _in
> > spite_ of the PHY never being connected: the non-NULL quality of
> > phydev->phy_link_change is not something that phy_uses_state_machine()
> > tests for.
> 
> No. What I'm saying is that if phydev->phy_link_change is set to NULL,
> _this_ causes phy_uses_state_machine() to return true and that
> behaviour incorrect.
> 
> The first part is describing _when_ phydev->phy_link_change is set to
> NULL.
> 
> It is not saying that a never-connected PHY directly causes
> phy_uses_state_machine() to return true.
> 
> I think my phrasing of this is totally fine, even re-reading it now.
> 
> -- 
> RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
> FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!

I think the language is sufficiently flexible for us to find a phrasing
that avoids all ambiguity. What about:

"It was assumed the only two valid values for phydev->phy_link_change
are phy_link_change() and phylink_phy_change(), thus phy_uses_state_machine()
was oversimplified to only compare with one of these values. There is a
third possible value (NULL), meaning that the PHY is unconnected, and
does not use the state machine. This logic misinterprets this case as
phy_uses_state_machine() == true, but in reality it should return false."

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ