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:
 <PAXPR04MB8510EB0E0EC299D4A76C0DEE886EA@PAXPR04MB8510.eurprd04.prod.outlook.com>
Date: Fri, 6 Jun 2025 05:26:36 +0000
From: Wei Fang <wei.fang@....com>
To: "Abhishek Chauhan (ABC)" <quic_abchauha@...cinc.com>, Russell King
	<linux@...linux.org.uk>
CC: Florian Fainelli <f.fainelli@...il.com>, "andrew@...n.ch"
	<andrew@...n.ch>, "hkallweit1@...il.com" <hkallweit1@...il.com>,
	"davem@...emloft.net" <davem@...emloft.net>, "edumazet@...gle.com"
	<edumazet@...gle.com>, "kuba@...nel.org" <kuba@...nel.org>,
	"pabeni@...hat.com" <pabeni@...hat.com>, "xiaolei.wang@...driver.com"
	<xiaolei.wang@...driver.com>, "netdev@...r.kernel.org"
	<netdev@...r.kernel.org>, "linux-kernel@...r.kernel.org"
	<linux-kernel@...r.kernel.org>, "imx@...ts.linux.dev" <imx@...ts.linux.dev>,
	Sarosh Hasan <quic_sarohasa@...cinc.com>
Subject: RE: [PATCH v2 net] net: phy: clear phydev->devlink when the link is
 deleted



Best Regards,
Wei Fang
> >> On Wed, Jun 04, 2025 at 06:00:54AM +0000, Wei Fang wrote:
> >>> I think this issue is also introduced by the commit bc66fa87d4fd
> >>> ("net: phy: Add link between phy dev and mac dev"). I suggested to
> >>> change the DL_FLAG_STATELESS flag to DL_FLAG_AUTOREMOVE_SUPPLIER to
> >>> solve this issue, so that the consumer (MAC controller) driver will
> >>> be automatically removed when the link is removed. The changes are
> >>> as follows.
> >>
> >> I suspect this still has problems. This is fine if the PHY device is
> >> going away and as you say device_del() is called.
> >>
> >> However, you need to consider the case where a MAC driver attaches
> >> the PHY during .ndo_open and releases it during .ndo_release. These
> >> will happen multiple times.
> >
> > .ndo_release? Do you mean .ndo_stop?
> >
> >>
> >> Each time the MAC driver attaches to the PHY via .ndo_open, we will
> >> call device_link_add(), but the device link will not be removed when
> >> .ndo_release is called.
> >>
> >> Either device_link_add() will fail, or we will eat memory each time
> >> the device is closed and re-opened.
> >
> > Below is what I find in the kernel doc of device_link_add().
> > https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Felix
> >
> ir.bootlin.com%2Flinux%2Fv6.15%2Fsource%2Fdrivers%2Fbase%2Fcore.c%23L7
> >
> 11&data=05%7C02%7Cwei.fang%40nxp.com%7C078b59e45bd54f13cfea08dda
> 49477a
> >
> 4%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C638847679768356
> 722%7CUn
> >
> known%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCI
> sIlAiOi
> >
> JXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=iFtK
> o%2F
> > NfwPVYbxLBtZM8Y15Aa9eomUNhPTRfnEb0L7c%3D&reserved=0
> >
> > if a device link between the given @consumer and @supplier pair exists
> > already when this function is called for them, the existing link will
> > be returned regardless of its current type and status.
> >
> > Therefore, it will not create new link each time the netdev is re-opened.
> >
> @Wei,
> 
> We were able to verify the suggestion what you gave us.
> No crash is seen now.
> Should we raise a patch or shall we wait until this is clarified and Russell has no
> more further questions. ?
> 

I'm okay, but I don't know if Russel has any other concerns. And if there
are no more comments, you can raise a patch. :)


> I am okay with anything.
> 
> >>
> >> If that is correct, then we're trading one problem for another.
> >>
> >

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ