]> err.no Git - linux-2.6/blobdiff - kernel/kmod.c
[PATCH] taskstats: fix sk_buff leak
[linux-2.6] / kernel / kmod.c
index 5c63c53014a986f53149019890a2743f236d493b..bb4e29d924e4ff29567a962e7b643e0c1c875896 100644 (file)
@@ -18,8 +18,6 @@
        call_usermodehelper wait flag, and remove exec_usermodehelper.
        Rusty Russell <rusty@rustcorp.com.au>  Jan 2003
 */
-#define __KERNEL_SYSCALLS__
-
 #include <linux/module.h>
 #include <linux/sched.h>
 #include <linux/syscalls.h>
@@ -35,6 +33,7 @@
 #include <linux/mount.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
+#include <linux/resource.h>
 #include <asm/uaccess.h>
 
 extern int max_threads;
@@ -158,6 +157,9 @@ static int ____call_usermodehelper(void *data)
                FD_SET(0, fdt->open_fds);
                FD_CLR(0, fdt->close_on_exec);
                spin_unlock(&f->file_lock);
+
+               /* and disallow core files too */
+               current->signal->rlim[RLIMIT_CORE] = (struct rlimit){0, 0};
        }
 
        /* We can run anywhere, unlike our parent keventd(). */
@@ -165,7 +167,8 @@ static int ____call_usermodehelper(void *data)
 
        retval = -EPERM;
        if (current->fs->root)
-               retval = execve(sub_info->path, sub_info->argv, sub_info->envp);
+               retval = kernel_execve(sub_info->path,
+                               sub_info->argv, sub_info->envp);
 
        /* Exec failed? */
        sub_info->retval = retval;