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 PHC | |
Open Source and information security mailing list archives
| ||
|
Date: Thu, 31 Mar 2022 11:20:50 +0200 From: Oliver Neukum <oneukum@...e.com> To: Oleksij Rempel <o.rempel@...gutronix.de>, Lukas Wunner <lukas@...ner.de> CC: Andrew Lunn <andrew@...n.ch>, Oliver Neukum <oneukum@...e.com>, Oleksij Rempel <linux@...pel-privat.de>, "netdev@...r.kernel.org" <netdev@...r.kernel.org>, Heiner Kallweit <hkallweit1@...il.com> Subject: Re: ordering of call to unbind() in usbnet_disconnect On 27.03.22 10:37, Oleksij Rempel wrote: > On Sat, Mar 26, 2022 at 02:04:30PM +0100, Lukas Wunner wrote: >> On Sat, Mar 26, 2022 at 01:49:28PM +0100, Andrew Lunn wrote: >>> On Sat, Mar 26, 2022 at 01:39:29PM +0100, Lukas Wunner wrote: >>> >>>> On probe, they first attach the PHY, then register the netdev. >>>> On remove, they detach the PHY, then unregister the netdev. >>>> >>>> Is it legal to detach the PHY from a registered (potentially running) >>>> netdev? It looks wrong to me. >>> I think the network stack guarantee that the close() method is called >>> before unregister completes. It is a common pattern to attach the PHY >>> in open() and detach it in close(). The stack itself should not be >>> using the PHY when it is down, the exception being IOCTL handlers >>> which people often get wrong. >> But the PHY is detached from a *running* netdev *before* that netdev >> is unregistered (and closed). Is that really legal? > IMO, it reflects, more or less, the reality of devices with SFP modules. > The PHY can be physically removed from running netdev. At same time, > netdev should be registered and visible for the user, even if PHY is not > physically attached. > > Hi, this makes sense, but the relevance to the question of how to do an unplug of the whole device is indirect, isn't it? I am afraid, putting my maintainer's hat on, I have to point on that we have a stable tree for which we will need some solution. Nor can usbnet exclusively cater to device that expose their PHY over MDIO. (or at all really). Intuitively I must say that exactly reversing the order of probe() in disconnect() is kind of the default. If there is a need to deviate from that, of course we will acomodate that, but making this the exclusive order is another matter. I really get that you want to discuss this matter exhaustively, but we need to come to some kind of conclusion. Regards Oliver
Powered by blists - more mailing lists