nfs: fix xattr inode op pointers when disabled
[deliverable/linux.git] / fs / exec.c
index 389fe7b0ba148059dcbc0d5e34f84dd5820b82a9..e1529b4c79b1c29b300ab6519a94d7b748069e33 100644 (file)
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -842,7 +842,6 @@ static int exec_mmap(struct mm_struct *mm)
        tsk->active_mm = mm;
        activate_mm(active_mm, mm);
        task_unlock(tsk);
-       arch_pick_mmap_layout(mm);
        if (old_mm) {
                up_read(&old_mm->mmap_sem);
                BUG_ON(active_mm != old_mm);
@@ -1087,8 +1086,8 @@ int flush_old_exec(struct linux_binprm * bprm)
        bprm->mm = NULL;                /* We're using it now */
 
        set_fs(USER_DS);
-       current->flags &=
-               ~(PF_RANDOMIZE | PF_FORKNOEXEC | PF_KTHREAD | PF_NOFREEZE);
+       current->flags &= ~(PF_RANDOMIZE | PF_FORKNOEXEC | PF_KTHREAD |
+                                       PF_NOFREEZE | PF_NO_SETAFFINITY);
        flush_thread();
        current->personality &= ~bprm->per_clear;
 
@@ -1138,9 +1137,7 @@ void setup_new_exec(struct linux_binprm * bprm)
 
        /* An exec changes our domain. We are no longer part of the thread
           group */
-
        current->self_exec_id++;
-                       
        flush_signal_handlers(current, 0);
        do_close_on_exec(current->files);
 }
@@ -1172,6 +1169,10 @@ void free_bprm(struct linux_binprm *bprm)
                mutex_unlock(&current->signal->cred_guard_mutex);
                abort_creds(bprm->cred);
        }
+       if (bprm->file) {
+               allow_write_access(bprm->file);
+               fput(bprm->file);
+       }
        /* If a binfmt changed the interp, free it. */
        if (bprm->interp != bprm->filename)
                kfree(bprm->interp);
@@ -1422,14 +1423,7 @@ static int exec_binprm(struct linux_binprm *bprm)
                audit_bprm(bprm);
                trace_sched_process_exec(current, old_pid, bprm);
                ptrace_event(PTRACE_EVENT_EXEC, old_vpid);
-               current->did_exec = 1;
                proc_exec_connector(current);
-
-               if (bprm->file) {
-                       allow_write_access(bprm->file);
-                       fput(bprm->file);
-                       bprm->file = NULL; /* to catch use-after-free */
-               }
        }
 
        return ret;
@@ -1492,7 +1486,7 @@ static int do_execve_common(const char *filename,
 
        retval = bprm_mm_init(bprm);
        if (retval)
-               goto out_file;
+               goto out_unmark;
 
        bprm->argc = count(argv, MAX_ARG_STRINGS);
        if ((retval = bprm->argc) < 0)
@@ -1539,12 +1533,6 @@ out:
                mmput(bprm->mm);
        }
 
-out_file:
-       if (bprm->file) {
-               allow_write_access(bprm->file);
-               fput(bprm->file);
-       }
-
 out_unmark:
        current->fs->in_exec = 0;
        current->in_execve = 0;
This page took 0.029683 seconds and 5 git commands to generate.