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] [day] [month] [year] [list]
Message-ID: <ZwBl5XBPGRS_eL9Y@makrotopia.org>
Date: Fri, 4 Oct 2024 23:02:13 +0100
From: Daniel Golle <daniel@...rotopia.org>
To: Andrew Lunn <andrew@...n.ch>
Cc: Heiner Kallweit <hkallweit1@...il.com>,
	Russell King <linux@...linux.org.uk>,
	"David S. Miller" <davem@...emloft.net>,
	Eric Dumazet <edumazet@...gle.com>,
	Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
	netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH net-next] net: phy: realtek: make sure paged read is
 protected by mutex

On Fri, Oct 04, 2024 at 11:25:29PM +0200, Andrew Lunn wrote:
> On Fri, Oct 04, 2024 at 04:52:04PM +0100, Daniel Golle wrote:
> > As we cannot rely on phy_read_paged function before the PHY is
> > identified, the paged read in rtlgen_supports_2_5gbps needs to be open
> > coded as it is being called by the match_phy_device function, ie. before
> > .read_page and .write_page have been populated.
> > 
> > Make sure it is also protected by the MDIO bus mutex and use
> > rtl821x_write_page instead of 3 individually locked MDIO bus operations.
> 
> match_phy_device() as far as i know, is only used during bus probe,
> when trying to match a driver to a device. What are you trying to lock
> against during probe?

The idea is to reduce the amount of unnecessary lock/unlock cycles (1 vs
3). Of course, we could just omit locking entirely here, but that seemed
a bit wild to me, and even if it would work in that specific case, it
just serve as a bad example.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ