Re: cgroup_release_agent() with call_usermodehelper() withUMH_WAIT_EXEC may crash

From: Linus Torvalds
Date: Fri Feb 03 2012 - 11:48:27 EST


On Fri, Feb 3, 2012 at 8:04 AM, Oleg Nesterov <oleg@xxxxxxxxxx> 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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/