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: <20250219105458.GD3888@debian>
Date: Wed, 19 Feb 2025 11:54:58 +0100
From: Dimitri Fedrau <dima.fedrau@...il.com>
To: Stefan Eichenberger <eichest@...il.com>
Cc: Andrew Lunn <andrew@...n.ch>, 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>,
	Niklas Söderlund <niklas.soderlund+renesas@...natech.se>,
	Gregor Herburger <gregor.herburger@...tq-group.com>,
	Geert Uytterhoeven <geert@...ux-m68k.org>, netdev@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/2] net: phy: marvell-88q2xxx: Prevent reading
 temperature with asserted reset

Hi Stefan,

Am Wed, Feb 19, 2025 at 07:29:49AM +0100 schrieb Stefan Eichenberger:
> Hi Dimitri,
> 
> On Tue, Feb 18, 2025 at 07:33:10PM +0100, Dimitri Fedrau wrote:
> > If the PHYs reset is asserted it returns 0xffff for any read operation.
> > Prevent reading the temperature in this case and return with an I/O error.
> > Write operations are ignored by the device.
> > 
> > Fixes: a197004cf3c2 ("net: phy: marvell-88q2xxx: Fix temperature measurement with reset-gpios")
> > Signed-off-by: Dimitri Fedrau <dima.fedrau@...il.com>
> > ---
> >  drivers/net/phy/marvell-88q2xxx.c | 6 ++++++
> >  1 file changed, 6 insertions(+)
> > 
> > diff --git a/drivers/net/phy/marvell-88q2xxx.c b/drivers/net/phy/marvell-88q2xxx.c
> > index 30d71bfc365597d77c34c48f05390db9d63c4af4..c1ae27057ee34feacb31c2e3c40b2b1769596408 100644
> > --- a/drivers/net/phy/marvell-88q2xxx.c
> > +++ b/drivers/net/phy/marvell-88q2xxx.c
> > @@ -647,6 +647,12 @@ static int mv88q2xxx_hwmon_read(struct device *dev,
> >  	struct phy_device *phydev = dev_get_drvdata(dev);
> >  	int ret;
> >  
> > +	/* If the PHYs reset is asserted it returns 0xffff for any read
> > +	 * operation. Return with an I/O error in this case.
> > +	 */
> > +	if (phydev->mdio.reset_state == 1)
> > +		return -EIO;
> > +
> >  	switch (attr) {
> >  	case hwmon_temp_input:
> >  		ret = phy_read_mmd(phydev, MDIO_MMD_PCS,
> > 
> 
> It makes sense to me. However, aren't most phys that allow reading
> sensors over MDIO affected by this issue? I couldn't find anything
> similar, are they ignoring that use-case?
>
Yes, you are right, but only if the PHYs hard reset is controlled with
"reset-gpios" or similar. I didn't find anything about it too.

Best regards,
Dimitri Fedrau

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ