lkml.org 
[lkml]   [2009]   [Apr]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [2.6.30-rc1] RCU detected CPU 1 stall
From
Date
Hello.

Hugh Dickins wrote:
> --- 2.6.30-rc1/lib/kobject_uevent.c 2009-04-08 18:20:24.000000000 +0100
> +++ linux/lib/kobject_uevent.c 2009-04-15 19:59:33.000000000 +0100
> @@ -244,11 +244,9 @@ int kobject_uevent_env(struct kobject *k
>
> /* call uevent_helper, usually only enabled during early boot */
> if (uevent_helper[0]) {
> - char *argv [3];
> -
> - argv [0] = uevent_helper;
> - argv [1] = (char *)subsystem;
> - argv [2] = NULL;
> + env->argv[0] = uevent_helper;
> + env->argv[1] = (char *)subsystem;
> + env->argv[2] = NULL;
> retval = add_uevent_var(env, "HOME=/");
> if (retval)
> goto exit;
> @@ -257,7 +255,7 @@ int kobject_uevent_env(struct kobject *k
> if (retval)
> goto exit;
>
> - retval = call_usermodehelper(argv[0], argv,
> + retval = call_usermodehelper(env->argv[0], env->argv,
> env->envp, UMH_NO_WAIT);
> }
>
Indeed, we can't use "argv" put on stack memory if we use "no wait" mode.
We need to ensure that memory region pointed by "argv" is valid until
do_execve() finishes. However,
|
| exit:
| kfree(devpath);
| kfree(env);
| return retval;
| }
"env" can be overwritten as well as "argv".
We need to ensure that memory region pointed by "env" is valid until
do_execve() finishes, don't we?

I think we need to use UMH_WAIT_EXEC instead of UMH_NO_WAIT.

Regards.


\
 
 \ /
  Last update: 2009-04-16 02:51    [from the cache]
©2003-2011 Jasper Spaans