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]
Date:	Thu, 08 May 2008 11:16:46 +0100
From:	Jeremy Fitzhardinge <jeremy@...p.org>
To:	Andrew Morton <akpm@...ux-foundation.org>
CC:	KOSAKI Motohiro <kosaki.motohiro@...fujitsu.com>,
	Li Zefan <lizf@...fujitsu.com>,
	Paul Menage <menage@...gle.com>,
	Jeremy Fitzhardinge <jeremy@...source.com>,
	Andi Kleen <ak@...e.de>, LKML <linux-kernel@...r.kernel.org>,
	Rusty Russell <rusty@...tcorp.com.au>
Subject: Re: [PATCH] call_usermodehelper_setup() should use GFP_KERNEL

Andrew Morton wrote:
> On Thu, 08 May 2008 16:31:29 +0900 KOSAKI Motohiro <kosaki.motohiro@...fujitsu.com> wrote:
>
>   
>>> KOSAKI Motohiro wrote:
>>>       
>>>> Now, call_usermodehelper_setup() use GFP_ATOMIC.
>>>> but it is slighly odd.
>>>> because call_usermodehelper() is always called process context.
>>>>
>>>>         
>>> Are you sure? I found the following call chain:
>>>
>>>   static irqreturn_t power_handler(int irq, void *dev_id)
>>>   ->orderly_poweroff(true);
>>>     ->call_usermodehelper_setup()
>>>       
>> sorry, you are right.
>> I'll make patch again.
>>     
>
> How many times do we have to make this mistake :(
>
> Only the caller knows what allocation mode the callee can use. 
> call_usermodehelper_setup() should be extended to take a gfp_t argument.
>   

Yeah, but making the caller need to know about the internal 
implementation details of the callee (ie, whether it needs to allocate 
memory or not) leads to pretty warty interfaces.  In this case, you 
could push the gfp_t up to the call_usermodehelper_setup() level, but 
pushing it any higher wouldn't make much sense.

Not that I have a better answer.

    J
--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ