Btrfs: Avoid superfluous tree-log writeout
[firefly-linux-kernel-4.4.55.git] / fs / exec.c
index da36c206f0f1ee86539a23608448028d8d095c78..56da15f6d77100f5c604ba0eabb5df111e9379aa 100644 (file)
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -638,7 +638,6 @@ int setup_arg_pages(struct linux_binprm *bprm,
         * will align it up.
         */
        rlim_stack = rlimit(RLIMIT_STACK) & PAGE_MASK;
-       rlim_stack = min(rlim_stack, stack_size);
 #ifdef CONFIG_STACK_GROWSUP
        if (stack_size + stack_expand > rlim_stack)
                stack_base = vma->vm_start + rlim_stack;
@@ -1380,8 +1379,6 @@ int do_execve(char * filename,
        if (retval < 0)
                goto out;
 
-       current->stack_start = current->mm->start_stack;
-
        /* execve succeeded */
        current->fs->in_exec = 0;
        current->in_execve = 0;
@@ -1914,8 +1911,9 @@ void do_coredump(long signr, int exit_code, struct pt_regs *regs)
        /*
         * Dont allow local users get cute and trick others to coredump
         * into their pre-created files:
+        * Note, this is not relevant for pipes
         */
-       if (inode->i_uid != current_fsuid())
+       if (!ispipe && (inode->i_uid != current_fsuid()))
                goto close_fail;
        if (!file->f_op)
                goto close_fail;