diff --git a/kernel/umh.c b/kernel/umh.c index 6ff36a7f038b9367290d9877da2a31221f846384..53611efb10cb4e08d4b50e46d977a74cfd6fc2e7 100644 --- a/kernel/umh.c +++ b/kernel/umh.c @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -76,6 +77,14 @@ static int call_usermodehelper_exec_async(void *data) flush_signal_handlers(current, 1); spin_unlock_irq(¤t->sighand->siglock); + /* + * Initial kernel threads share ther FS with init, in order to + * get the init root directory. But we've now created a new + * thread that is going to execve a user process and has its own + * 'struct fs_struct'. Reset umask to the default. + */ + current->fs->umask = 0022; + /* * Kthreadd can be restricted to a set of processors if the user wants * to protect other processors from OS latencies. If that has happened