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: <7d6d8789-e10b-4b06-aa99-5c1a1bdd3b4c@linux.dev>
Date: Thu, 12 Jun 2025 11:53:26 -0400
From: Sean Anderson <sean.anderson@...ux.dev>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: Saravana Kannan <saravanak@...gle.com>,
 "Rafael J . Wysocki" <rafael@...nel.org>, Danilo Krummrich
 <dakr@...nel.org>, linux-kernel@...r.kernel.org, devicetree@...r.kernel.org,
 Christoph Hellwig <hch@....de>, Rob Herring <robh+dt@...nel.org>,
 Grant Likely <grant.likely@...aro.org>
Subject: Re: [PATCH] driver core: Prevent deferred probe loops

On 6/11/25 08:23, Greg Kroah-Hartman wrote:
> On Tue, Jun 10, 2025 at 07:44:27PM -0400, Sean Anderson wrote:
>> On 6/10/25 19:32, Saravana Kannan wrote:
>> > On Tue, Jun 10, 2025 at 11:35 AM Sean Anderson <sean.anderson@...ux.dev> wrote:
>> >>
>> >> A deferred probe loop can occur when a device returns EPROBE_DEFER after
>> >> registering a bus with children:
>> > 
>> > This is a broken driver. A parent device shouldn't register child
>> > devices unless it is fully read itself. It's not logical to say the
>> > child devices are available, if the parent itself isn't fully ready.
>> > So, adding child devices/the bus should be the last thing done in the
>> > parent's probe function.
>> >
>> > I know there are odd exceptions where the parent depends on the child,
>> > so they might add the child a bit earlier in the probe
>> 
>> This is exactly the case here. So the bus probing cannot happen any
>> later than it already does.
> 
> Please fix the driver not to do this.

How? The driver needs the PCS to work. And the PCS can live on the MDIO
bus.

>> > but in those cases, the parent's probe should still do all the checks
>> > ahead of time.
>> 
>> Such as what? How is the parent going to know the resource is missing
>> without checking for it?
>>  
>> > Can you be more specific about the actual failure you are seeing?
>> 
>> MAC is looking for a PCS that's on its internal MDIO bus, but that PCS's
>> driver isn't loaded. The PCS has to be loaded at probe time because
>> phylink_create needs it, and phylink is necessary to register the
>> netdev. The latter situation is not ideal, but it would be quite a bit
>> of work to untangle.
> 
> Please untangle, don't put stuff in the driver core for broken
> subsystems.  That is just pushing the maintaince of this from the driver
> authors to the driver core maintainers for the next 20+ years :(

What makes it broken? The "mess" has already been made in netdev. The driver
authors have already pushed it off onto phylink.

And by "quite a bit of work to untangle" I mean the PCS affects settings
(ethtool ksettings, MII IOCTL) that are exposed to userspace as soon as
the netdev is registered. So we cannot move to a "delayed" lookup
without breaking reading/modifying the settings. We could of course fake
it, but what happens when e.g. userspace looks at the settings and
breaks because we are not reporting the right capabilities (which would
have been reported in the past)?

--Sean

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ