Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
[pandora-kernel.git] / arch / x86 / ia32 / ia32_aout.c
index 0878137..f82e1a9 100644 (file)
@@ -40,7 +40,7 @@ static int load_aout_binary(struct linux_binprm *, struct pt_regs * regs);
 static int load_aout_library(struct file*);
 
 #ifdef CORE_DUMP
-static int aout_core_dump(long signr, struct pt_regs * regs, struct file *file);
+static int aout_core_dump(long signr, struct pt_regs *regs, struct file *file, unsigned long limit);
 
 /*
  * fill in the user structure for a core dump..
@@ -148,7 +148,7 @@ if (file->f_op->llseek) { \
  * dumping of the process results in another error..
  */
 
-static int aout_core_dump(long signr, struct pt_regs * regs, struct file *file)
+static int aout_core_dump(long signr, struct pt_regs *regs, struct file *file, unsigned long limit)
 {
        mm_segment_t fs;
        int has_dumped = 0;
@@ -168,13 +168,11 @@ static int aout_core_dump(long signr, struct pt_regs * regs, struct file *file)
 
 /* If the size of the dump file exceeds the rlimit, then see what would happen
    if we wrote the stack, but not the data area.  */
-       if ((dump.u_dsize+dump.u_ssize+1) * PAGE_SIZE >
-           current->signal->rlim[RLIMIT_CORE].rlim_cur)
+       if ((dump.u_dsize + dump.u_ssize + 1) * PAGE_SIZE > limit)
                dump.u_dsize = 0;
 
 /* Make sure we have enough room to write the stack and data areas. */
-       if ((dump.u_ssize+1) * PAGE_SIZE >
-           current->signal->rlim[RLIMIT_CORE].rlim_cur)
+       if ((dump.u_ssize + 1) * PAGE_SIZE > limit)
                dump.u_ssize = 0;
 
 /* make sure we actually have a data and stack area to dump */
@@ -422,6 +420,8 @@ beyond_if:
        (regs)->eflags = 0x200;
        (regs)->cs = __USER32_CS;
        (regs)->ss = __USER32_DS;
+       regs->r8 = regs->r9 = regs->r10 = regs->r11 =
+       regs->r12 = regs->r13 = regs->r14 = regs->r15 = 0;
        set_fs(USER_DS);
        if (unlikely(current->ptrace & PT_PTRACED)) {
                if (current->ptrace & PT_TRACE_EXEC)