Re:Re: Re: Re: [PATCH net] net: phy: micrel: Fix potential shared PHC use-after-free

From: 李广硕

Date: Tue Nov 24 2026 - 08:59:50 EST




Hi Andrew,

From: Andrew Lunn <andrew@xxxxxxx>
Date: 2026-11-19 23:23:10
To: "李广硕" <liguangshuo@xxxxxxxxxxxxxxx>
Cc: Heiner Kallweit <hkallweit1@xxxxxxxxx>,Russell King <linux@xxxxxxxxxxxxxxx>,"David S. Miller" <davem@xxxxxxxxxxxxx>,Eric Dumazet <edumazet@xxxxxxxxxx>,Jakub Kicinski <kuba@xxxxxxxxxx>,Paolo Abeni <pabeni@xxxxxxxxxx>,netdev@xxxxxxxxxxxxxxx,linux-kernel@xxxxxxxxxxxxxxx
Subject: Re: Re: Re: [PATCH net] net: phy: micrel: Fix potential shared PHC use-after-free>> On LAN8814, if the registering PHY unbinds first, the other ports would
>> lose access to the PHC. Is that the behaviour you'd expect?
>
>No, as i keep saying, i expect remove to be the opposite of probe. The
>first PHY probed sets up the PHC. What is the opposite of that? The
>last PHY removed releases the PHC.
>
> Andrew
>

Thanks for clarifying. I had tied teardown to the registering PHY,
but it should happen when the last PHY leaves the package.

I'll rework the cleanup around that lifetime, keeping the PHC and
its pin array alive until then. I'll also check that register access
remains valid after the first PHY is unbound.

Thanks,
Guangshuo