Messages in this thread | | | Date | Fri, 17 Oct 2014 09:02:14 +0200 | From | Martin Schwidefsky <> | Subject | Re: [PATCH] kernel/kmod: fix use-after-free of the sub_infostructure |
| |
On Fri, 17 Oct 2014 06:30:29 +0900 Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> wrote:
> Regarding UMH_NO_WAIT, the sub_info structure can be freed by > __call_usermodehelper() before the worker thread returns from > do_execve(), allowing memory corruption when do_execve() failed > after exec_mmap() is called. > > Regarding UMH_WAIT_EXEC, the call to umh_complete() allows > call_usermodehelper_exec() to continue which then frees sub_info. > > To fix this race, we need to make sure that the call to > call_usermodehelper_freeinfo() in call_usermodehelper_exec() is > always made after the last store to sub_info->retval.
I like this improved description for the UMH_NO_WAIT and UMH_WAIT_EXEC cases. I mix it with parts of the original description.
-- blue skies, Martin.
"Reality continues to ruin my life." - Calvin.
| |