fs: Limit sys_mount to only request filesystem modules.
[deliverable/linux.git] / fs / binfmt_elf.c
index 11e078a747a538a99a0249704c1291b9bcaea21b..3939829f6c5cc67e7d0ca1e9518f1df834be5088 100644 (file)
@@ -33,6 +33,7 @@
 #include <linux/elf.h>
 #include <linux/utsname.h>
 #include <linux/coredump.h>
+#include <linux/sched.h>
 #include <asm/uaccess.h>
 #include <asm/param.h>
 #include <asm/page.h>
@@ -321,6 +322,8 @@ create_elf_tables(struct linux_binprm *bprm, struct elfhdr *exec,
        return 0;
 }
 
+#ifndef elf_map
+
 static unsigned long elf_map(struct file *filep, unsigned long addr,
                struct elf_phdr *eppnt, int prot, int type,
                unsigned long total_size)
@@ -355,6 +358,8 @@ static unsigned long elf_map(struct file *filep, unsigned long addr,
        return(map_addr);
 }
 
+#endif /* !elf_map */
+
 static unsigned long total_mapping_size(struct elf_phdr *cmds, int nr)
 {
        int i, first_idx = -1, last_idx = -1;
@@ -1248,7 +1253,7 @@ static int writenote(struct memelfnote *men, struct file *file,
 #undef DUMP_WRITE
 
 static void fill_elf_header(struct elfhdr *elf, int segs,
-                           u16 machine, u32 flags, u8 osabi)
+                           u16 machine, u32 flags)
 {
        memset(elf, 0, sizeof(*elf));
 
@@ -1320,8 +1325,11 @@ static void fill_prstatus(struct elf_prstatus *prstatus,
                cputime_to_timeval(cputime.utime, &prstatus->pr_utime);
                cputime_to_timeval(cputime.stime, &prstatus->pr_stime);
        } else {
-               cputime_to_timeval(p->utime, &prstatus->pr_utime);
-               cputime_to_timeval(p->stime, &prstatus->pr_stime);
+               cputime_t utime, stime;
+
+               task_cputime(p, &utime, &stime);
+               cputime_to_timeval(utime, &prstatus->pr_utime);
+               cputime_to_timeval(stime, &prstatus->pr_stime);
        }
        cputime_to_timeval(p->signal->cutime, &prstatus->pr_cutime);
        cputime_to_timeval(p->signal->cstime, &prstatus->pr_cstime);
@@ -1630,7 +1638,7 @@ static int fill_note_info(struct elfhdr *elf, int phdrs,
         * Initialize the ELF file header.
         */
        fill_elf_header(elf, phdrs,
-                       view->e_machine, view->e_flags, view->ei_osabi);
+                       view->e_machine, view->e_flags);
 
        /*
         * Allocate a structure for each thread.
@@ -1870,7 +1878,7 @@ static int fill_note_info(struct elfhdr *elf, int phdrs,
        elf_core_copy_regs(&info->prstatus->pr_reg, regs);
 
        /* Set up header */
-       fill_elf_header(elf, phdrs, ELF_ARCH, ELF_CORE_EFLAGS, ELF_OSABI);
+       fill_elf_header(elf, phdrs, ELF_ARCH, ELF_CORE_EFLAGS);
 
        /*
         * Set up the notes in similar form to SVR4 core dumps made
This page took 0.02777 seconds and 5 git commands to generate.