lkml.org 
[lkml]   [2013]   [Sep]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] argv_split: Return NULL if argument contains nonon-whitespace.
On 09/15, Tetsuo Handa wrote:
>
> Oleg Nesterov wrote:
> > > upon core dump because helper_argv[0] == NULL at
> > >
> > > helper_argv = argv_split(GFP_KERNEL, cn.corename, NULL);
> > > call_usermodehelper_setup(helper_argv[0], ...);
> >
> > Are you sure? See above.
> >
>
> Yes, I'm sure.

I thougt you meant that call_usermodehelper_setup() crashes. "See above"
means that afaics it should crash in do_filp_open().

> execve(NULL) from user space is safe,

because it never does do_execve(NULL),

> but
> do_execve(NULL) from kernel space is not safe.

Yes, this is clear.

> > Perhaps
> >
> > --- x/kernel/kmod.c
> > +++ x/kernel/kmod.c
> > @@ -571,6 +571,9 @@ int call_usermodehelper_exec(struct subp
> > DECLARE_COMPLETION_ONSTACK(done);
> > int retval = 0;
> >
> > + if (!sub_info->path)
> > + return -EXXX;
> > +
> > helper_lock();
> > if (!khelper_wq || usermodehelper_disabled) {
> > retval = -EBUSY;
> >
> > ?
> >
>
> I'm OK with that.

OK,

Oleg.



\
 
 \ /
  Last update: 2013-09-15 18:41    [W:0.082 / U:0.180 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site