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  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]
Date:	Sun, 18 Mar 2012 01:26:41 -0700
From:	Stephen Boyd <sboyd@...eaurora.org>
To:	Linus Torvalds <torvalds@...ux-foundation.org>
CC:	"Rafael J. Wysocki" <rjw@...k.pl>,
	Saravana Kannan <skannan@...eaurora.org>,
	Kay Sievers <kay.sievers@...y.org>,
	Greg KH <gregkh@...uxfoundation.org>,
	Christian Lamparter <chunkeey@...glemail.com>,
	linux-kernel@...r.kernel.org,
	"Srivatsa S. Bhat" <srivatsa.bhat@...ux.vnet.ibm.com>,
	alan@...rguk.ukuu.org.uk,
	Linux PM mailing list <linux-pm@...r.kernel.org>
Subject: Re: [PATCH] firmware loader: don't cancel _nowait requests when helper
 is not yet available

On 3/16/2012 10:51 PM, Linus Torvalds wrote:
> On Fri, Mar 16, 2012 at 7:47 PM, Stephen Boyd <sboyd@...eaurora.org> wrote:
>> -       if (WARN_ON(usermodehelper_is_disabled())) {
>> +       if (is_sleep_task()) {
>>                dev_err(device, "firmware: %s will not be loaded\n", name);
> Stop these idiotic games already!
>
> It's very simple: you cannot load firmware while the system is not
> readt. Your moronic "let's change the test to something else" is
> entirely and utterly misguided and totally misses the point.
>
> It's not about sleeping, and it's not about anything even *remotely*
> about that. Stop the idiocy already.
>
> How hard is it to understand? How many times do people have to tell you?
>
> That warning is very much valid during bootup, and that warning has
> been *seen* during bootup. For example, try to compile in most
> wireless drivers as non-modular, and that warning *has* to trigger.

Ok. I like where nowait() is going in the other part of the thread but
I'm still confused about when request_firmware() is correct to use. It
seems that the function is inherently racy with freezing. Does every
user of request_firmware() need to synchronize with freezing?

For example, if one CPU is in the middle of a driver probe that makes a
request_firmware() call and another CPU is starting to suspend we will
have a race between usermodehelpers being disabled and the
request_firmware() call acquiring the usermodehelper rwsem. If the
suspending CPU wins the race it will disable usermodehelpers and the
request_firmware() call will return -EBUSY and warn.

CPU0                           CPU1
driver_probe()                 suspend_prepare()
  ...                            usermodehelper_disable()
  _request_firmware()              down_write(&umhelper_sem)
                                   usermodehelper_disabled = 1
                                   up_write(&umhelper_sem)
    down_read(&umhelper_sem)       ....
    WARN_ON(...)                   freeze_processes()
    <freeze>                       


Hopefully I'm missing something here? This is all theoretical right now
as I haven't actually seen any of this in practice.

-- 
Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists