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: <7abfbda8-2b4b-5301-6a86-1696d4898525@linux.intel.com>
Date:   Fri, 22 May 2020 09:29:57 -0500
From:   Pierre-Louis Bossart <pierre-louis.bossart@...ux.intel.com>
To:     Jason Gunthorpe <jgg@...pe.ca>,
        Ranjani Sridharan <ranjani.sridharan@...ux.intel.com>
Cc:     Jeff Kirsher <jeffrey.t.kirsher@...el.com>, davem@...emloft.net,
        gregkh@...uxfoundation.org, netdev@...r.kernel.org,
        linux-rdma@...r.kernel.org, nhorman@...hat.com,
        sassmann@...hat.com, Fred Oh <fred.oh@...ux.intel.com>
Subject: Re: [net-next v4 10/12] ASoC: SOF: Introduce descriptors for SOF
 client


>>>> +	ret = virtbus_register_device(vdev);
>>>> +	if (ret < 0)
>>>> +		return ret;
>>>> +
>>>> +	/* make sure the probe is complete before updating client list
>>>> */
>>>> +	timeout = msecs_to_jiffies(SOF_CLIENT_PROBE_TIMEOUT_MS);
>>>> +	time = wait_for_completion_timeout(&cdev->probe_complete,
>>>> timeout);
>>>
>>> This seems bonkers - the whole point of something like virtual bus is
>>> to avoid madness like this.
>>
>> Thanks for your review, Jason. The idea of the times wait here is to
>> make the registration of the virtbus devices synchronous so that the
>> SOF core device has knowledge of all the clients that have been able to
>> probe successfully. This part is domain-specific and it works very well
>> in the audio driver case.
> 
> This need to be hot plug safe. What if the module for this driver is
> not available until later in boot? What if the user unplugs the
> driver? What if the kernel runs probing single threaded?
> 
> It is really unlikely you can both have the requirement that things be
> synchronous and also be doing all the other lifetime details properly..

Can you suggest an alternate solution then?

The complete/wait_for_completion is a simple mechanism to tell that the 
action requested by the parent is done. Absent that, we can end-up in a 
situation where the probe may fail, or the requested module does not 
exist, and the parent knows nothing about the failure - so the system is 
in a zombie state and users are frustrated. It's not great either, is it?

This is not an hypothetical case, we've had this recurring problem when 
a PCI device creates an audio card represented as a platform device. 
When the card registration fails, typically due to configuration issues, 
the PCI probe still completes. That's really confusing and the source of 
lots of support questions. If we use these virtual bus extensions to 
stpo abusing platform devices, it'd be really nice to make those 
unreported probe failures go away.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ