Merge tag 'rpmsg-v5.10' of git://git.kernel.org/pub/scm/linux/kernel/git/andersson...
[linux-2.6-microblaze.git] / kernel / umh.c
index fcf3ee8..3f64661 100644 (file)
@@ -14,6 +14,7 @@
 #include <linux/cred.h>
 #include <linux/file.h>
 #include <linux/fdtable.h>
+#include <linux/fs_struct.h>
 #include <linux/workqueue.h>
 #include <linux/security.h>
 #include <linux/mount.h>
@@ -71,6 +72,14 @@ static int call_usermodehelper_exec_async(void *data)
        flush_signal_handlers(current, 1);
        spin_unlock_irq(&current->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;
+
        /*
         * Our parent (unbound workqueue) runs with elevated scheduling
         * priority. Avoid propagating that into the userspace child.