Merge to Fedora kernel-2.6.7-1.441
[linux-2.6.git] / fs / exec.c
index 7e5aec3..2902dda 100644 (file)
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -47,9 +47,9 @@
 #include <linux/syscalls.h>
 #include <linux/rmap.h>
 #include <linux/ckrm.h>
+#include <linux/vs_memory.h>
 
 #include <asm/uaccess.h>
-#include <asm/pgalloc.h>
 #include <asm/mmu_context.h>
 
 #ifdef CONFIG_KMOD
@@ -850,7 +850,8 @@ int flush_old_exec(struct linux_binprm * bprm)
        flush_thread();
 
        if (bprm->e_uid != current->euid || bprm->e_gid != current->egid || 
-           permission(bprm->file->f_dentry->d_inode,MAY_READ, NULL))
+           permission(bprm->file->f_dentry->d_inode,MAY_READ, NULL) ||
+           (bprm->interp_flags & BINPRM_FLAGS_ENFORCE_NONDUMP))
                current->mm->dumpable = 0;
 
        /* An exec changes our domain. We are no longer part of the thread
@@ -1095,20 +1096,21 @@ int do_execve(char * filename,
        int retval;
        int i;
 
-       sched_balance_exec();
-
        file = open_exec(filename);
 
        retval = PTR_ERR(file);
        if (IS_ERR(file))
                return retval;
 
+       sched_balance_exec();
+
        bprm.p = PAGE_SIZE*MAX_ARG_PAGES-sizeof(void *);
        memset(bprm.page, 0, MAX_ARG_PAGES*sizeof(bprm.page[0]));
 
        bprm.file = file;
        bprm.filename = filename;
        bprm.interp = filename;
+       bprm.interp_flags = 0;
        bprm.sh_bang = 0;
        bprm.loader = 0;
        bprm.exec = 0;