Re: [PATCH] usermodehelper: Fix -ENOMEM return logic

2013-03-07 Thread Lucas De Marchi
On Thu, Mar 7, 2013 at 5:07 PM, Oleg Nesterov wrote: > On 03/07, Lucas De Marchi wrote: >> >> On Thu, Mar 7, 2013 at 4:37 PM, Oleg Nesterov wrote: >> > >> >> @@ -98,12 +93,13 @@ static int call_modprobe(char *module_name, int wait) >> >> argv[3] = module_name; /* check free_modprobe_argv()

Re: [PATCH] usermodehelper: Fix -ENOMEM return logic

2013-03-07 Thread Oleg Nesterov
On 03/07, Lucas De Marchi wrote: > > On Thu, Mar 7, 2013 at 4:37 PM, Oleg Nesterov wrote: > > > >> @@ -98,12 +93,13 @@ static int call_modprobe(char *module_name, int wait) > >> argv[3] = module_name; /* check free_modprobe_argv() */ > >> argv[4] = NULL; > >> > >> - return call_us

Re: [PATCH] usermodehelper: Fix -ENOMEM return logic

2013-03-07 Thread Lucas De Marchi
On Thu, Mar 7, 2013 at 4:37 PM, Oleg Nesterov wrote: > Hi Lucas, > > On 03/06, Lucas De Marchi wrote: >> >> On Mon, Feb 25, 2013 at 3:08 PM, Oleg Nesterov wrote: >> > >> > So, I hope you will send v2. I'd suggest to split the fixes. 1/3 >> > should create/export the new helpers, and 2-3 fix shoul

Re: [PATCH] usermodehelper: Fix -ENOMEM return logic

2013-03-07 Thread Oleg Nesterov
Hi Lucas, On 03/06, Lucas De Marchi wrote: > > On Mon, Feb 25, 2013 at 3:08 PM, Oleg Nesterov wrote: > > > > So, I hope you will send v2. I'd suggest to split the fixes. 1/3 > > should create/export the new helpers, and 2-3 fix should call_modprobe() > > and call_usermodehelper_keys(). But this i

Re: [PATCH] usermodehelper: Fix -ENOMEM return logic

2013-03-06 Thread Lucas De Marchi
Hi Oleg, On Mon, Feb 25, 2013 at 3:08 PM, Oleg Nesterov wrote: > On 02/25, Lucas De Marchi wrote: >> >> Yep. The current interface is confusing. I agree that a separate >> setup() + exec() would make more sense. > > Great, > >> > @@ -98,8 +98,14 @@ static int call_modprobe(char *module_na >> >

Re: [PATCH] usermodehelper: Fix -ENOMEM return logic

2013-02-25 Thread Oleg Nesterov
On 02/25, Lucas De Marchi wrote: > > Yep. The current interface is confusing. I agree that a separate > setup() + exec() would make more sense. Great, > > @@ -98,8 +98,14 @@ static int call_modprobe(char *module_na > > argv[3] = module_name; /* check free_modprobe_argv() */ > > a

Re: [PATCH] usermodehelper: Fix -ENOMEM return logic

2013-02-25 Thread Lucas De Marchi
On Mon, Feb 25, 2013 at 1:06 PM, Oleg Nesterov wrote: > On 02/25, Lucas De Marchi wrote: >> >> Callers of call_usermodehelper_fns() should check the return value and >> free themselves the data passed if the return is -ENOMEM. This is >> because the subprocess_info is allocated in this function, a

Re: [PATCH] usermodehelper: Fix -ENOMEM return logic

2013-02-25 Thread Oleg Nesterov
On 02/25, David Howells wrote: > > Lucas De Marchi wrote: > > > This patch fixes both call_usermodehelper_fns() to never call the > > cleanup function in case retval == -ENOMEM and also the callers to > > actually check the return value of this function. > > I suspect it's probably better to alway

Re: [PATCH] usermodehelper: Fix -ENOMEM return logic

2013-02-25 Thread Oleg Nesterov
On 02/25, Lucas De Marchi wrote: > > Callers of call_usermodehelper_fns() should check the return value and > free themselves the data passed if the return is -ENOMEM. This is > because the subprocess_info is allocated in this function, and if the > allocation fail, the cleanup function cannot be c

Re: [PATCH] usermodehelper: Fix -ENOMEM return logic

2013-02-25 Thread David Howells
Lucas De Marchi wrote: > Callers of call_usermodehelper_fns() should check the return value and > free themselves the data passed if the return is -ENOMEM. This is > because the subprocess_info is allocated in this function, and if the > allocation fail, the cleanup function cannot be called. >

[PATCH] usermodehelper: Fix -ENOMEM return logic

2013-02-25 Thread Lucas De Marchi
Callers of call_usermodehelper_fns() should check the return value and free themselves the data passed if the return is -ENOMEM. This is because the subprocess_info is allocated in this function, and if the allocation fail, the cleanup function cannot be called. However call_usermodehelper_exec()