Messages in this thread | | | From | Linus Torvalds <> | Date | Fri, 3 Feb 2012 08:48:08 -0800 | Subject | Re: cgroup_release_agent() with call_usermodehelper() with UMH_WAIT_EXEC may crash |
| |
On Fri, Feb 3, 2012 at 8:04 AM, Oleg Nesterov <oleg@redhat.com> wrote: > > Can't we simply move that code into flush_old_exec() ? (wrapped into > the new helper).
Sure. It would kind of make sense to do it as part of exec_mmap(). That's what associates us with the new mm, after all.
That said, I think my *preferred* approach would be to still do the final
set_task_comm(current, tcomm);
in setup_new_exec(), because that's really when we set up the new mm.
So my preferred solution would be to simply move the "char tcomm[];" array from the stack (currently automatic in setup_new_exec()) into the struct linux_binprm, and then copy it from the filename early. We could copy it arbitrarily early, perhaps in "prepare_binprm()".
Hmm?
Linus
| |