Merge git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc
[powerpc.git] / arch / mips / kernel / irixelf.c
index 881f125..10d3644 100644 (file)
@@ -147,7 +147,7 @@ static void padzero(unsigned long elf_bss)
        nbyte = elf_bss & (PAGE_SIZE-1);
        if (nbyte) {
                nbyte = PAGE_SIZE - nbyte;
-               clear_user((void *) elf_bss, nbyte);
+               clear_user((void __user *) elf_bss, nbyte);
        }
 }
 
@@ -422,9 +422,7 @@ static inline int look_for_irix_interpreter(char **name,
                if (*name != NULL)
                        goto out;
 
-               *name = (char *) kmalloc((epp->p_filesz +
-                                         strlen(IRIX_EMUL)),
-                                        GFP_KERNEL);
+               *name = kmalloc(epp->p_filesz + strlen(IRIX_EMUL), GFP_KERNEL);
                if (!*name)
                        return -ENOMEM;
 
@@ -699,7 +697,6 @@ static int load_irix_binary(struct linux_binprm * bprm, struct pt_regs * regs)
        /* Do this so that we can load the interpreter, if need be.  We will
         * change some of these later.
         */
-       set_mm_counter(current->mm, rss, 0);
        setup_arg_pages(bprm, STACK_TOP, EXSTACK_DEFAULT);
        current->mm->start_stack = bprm->p;
 
@@ -878,10 +875,10 @@ static int load_irix_library(struct file *file)
  * phdrs there are in the USER_PHDRP array.  We return the vaddr the
  * first phdr was successfully mapped to.
  */
-unsigned long irix_mapelf(int fd, struct elf_phdr *user_phdrp, int cnt)
+unsigned long irix_mapelf(int fd, struct elf_phdr __user *user_phdrp, int cnt)
 {
        unsigned long type, vaddr, filesz, offset, flags;
-       struct elf_phdr *hp;
+       struct elf_phdr __user *hp;
        struct file *filp;
        int i, retval;
 
@@ -968,9 +965,9 @@ unsigned long irix_mapelf(int fd, struct elf_phdr *user_phdrp, int cnt)
 /* These are the only things you should do on a core-file: use only these
  * functions to write out all the necessary info.
  */
-static int dump_write(struct file *file, const void *addr, int nr)
+static int dump_write(struct file *file, const void __user *addr, int nr)
 {
-       return file->f_op->write(file, (const char *) addr, nr, &file->f_pos) == nr;
+       return file->f_op->write(file, (const char __user *) addr, nr, &file->f_pos) == nr;
 }
 
 static int dump_seek(struct file *file, off_t off)
@@ -1080,8 +1077,8 @@ static int irix_core_dump(long signr, struct pt_regs * regs, struct file *file)
        struct elfhdr elf;
        off_t offset = 0, dataoff;
        int limit = current->signal->rlim[RLIMIT_CORE].rlim_cur;
-       int numnote = 4;
-       struct memelfnote notes[4];
+       int numnote = 3;
+       struct memelfnote notes[3];
        struct elf_prstatus prstatus;   /* NT_PRSTATUS */
        elf_fpregset_t fpu;             /* NT_PRFPREG */
        struct elf_prpsinfo psinfo;     /* NT_PRPSINFO */
@@ -1204,7 +1201,7 @@ static int irix_core_dump(long signr, struct pt_regs * regs, struct file *file)
                len = current->mm->arg_end - current->mm->arg_start;
                len = len >= ELF_PRARGSZ ? ELF_PRARGSZ : len;
                (void *) copy_from_user(&psinfo.pr_psargs,
-                              (const char *)current->mm->arg_start, len);
+                              (const char __user *)current->mm->arg_start, len);
                for (i = 0; i < len; i++)
                        if (psinfo.pr_psargs[i] == 0)
                                psinfo.pr_psargs[i] = ' ';
@@ -1214,20 +1211,15 @@ static int irix_core_dump(long signr, struct pt_regs * regs, struct file *file)
        }
        strlcpy(psinfo.pr_fname, current->comm, sizeof(psinfo.pr_fname));
 
-       notes[2].name = "CORE";
-       notes[2].type = NT_TASKSTRUCT;
-       notes[2].datasz = sizeof(*current);
-       notes[2].data = current;
-
        /* Try to dump the FPU. */
        prstatus.pr_fpvalid = dump_fpu (regs, &fpu);
        if (!prstatus.pr_fpvalid) {
                numnote--;
        } else {
-               notes[3].name = "CORE";
-               notes[3].type = NT_PRFPREG;
-               notes[3].datasz = sizeof(fpu);
-               notes[3].data = &fpu;
+               notes[2].name = "CORE";
+               notes[2].type = NT_PRFPREG;
+               notes[2].datasz = sizeof(fpu);
+               notes[2].data = &fpu;
        }
 
        /* Write notes phdr entry. */
@@ -1301,7 +1293,7 @@ static int irix_core_dump(long signr, struct pt_regs * regs, struct file *file)
 #ifdef DEBUG
                printk("elf_core_dump: writing %08lx %lx\n", addr, len);
 #endif
-               DUMP_WRITE((void *)addr, len);
+               DUMP_WRITE((void __user *)addr, len);
        }
 
        if ((off_t) file->f_pos != offset) {