]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/binfmt_elf.c
Deprecate a.out ELF interpreters
[linux-2.6-omap-h63xx.git] / fs / binfmt_elf.c
index b1013f34085d00ac4b966e895ac58419f4ae3269..66cd711a6b1a392733187b4c72d8e6dc5cc6b919 100644 (file)
@@ -52,7 +52,7 @@ static unsigned long elf_map (struct file *, unsigned long, struct elf_phdr *, i
  * don't even try.
  */
 #if defined(USE_ELF_CORE_DUMP) && defined(CONFIG_ELF_CORE)
-static int elf_core_dump(long signr, struct pt_regs *regs, struct file *file);
+static int elf_core_dump(long signr, struct pt_regs *regs, struct file *file, unsigned long limit);
 #else
 #define elf_core_dump  NULL
 #endif
@@ -730,6 +730,7 @@ static int load_elf_binary(struct linux_binprm *bprm, struct pt_regs *regs)
 
        /* Some simple consistency checks for the interpreter */
        if (elf_interpreter) {
+               static int warn;
                interpreter_type = INTERPRETER_ELF | INTERPRETER_AOUT;
 
                /* Now figure out which format our binary is */
@@ -741,6 +742,13 @@ static int load_elf_binary(struct linux_binprm *bprm, struct pt_regs *regs)
                if (memcmp(loc->interp_elf_ex.e_ident, ELFMAG, SELFMAG) != 0)
                        interpreter_type &= ~INTERPRETER_ELF;
 
+               if (interpreter_type == INTERPRETER_AOUT && warn < 10) {
+                       printk(KERN_WARNING "a.out ELF interpreter %s is "
+                               "deprecated and will not be supported "
+                               "after Linux 2.6.25\n", elf_interpreter);
+                       warn++;
+               }
+
                retval = -ELIBBAD;
                if (!interpreter_type)
                        goto out_free_dentry;
@@ -1411,7 +1419,7 @@ struct elf_thread_status
        elf_fpregset_t fpu;             /* NT_PRFPREG */
        struct task_struct *thread;
 #ifdef ELF_CORE_COPY_XFPREGS
-       elf_fpxregset_t xfpu;           /* NT_PRXFPREG */
+       elf_fpxregset_t xfpu;           /* ELF_CORE_XFPREG_TYPE */
 #endif
        struct memelfnote notes[3];
        int num_notes;
@@ -1446,8 +1454,8 @@ static int elf_dump_thread_status(long signr, struct elf_thread_status *t)
 
 #ifdef ELF_CORE_COPY_XFPREGS
        if (elf_core_copy_task_xfpregs(p, &t->xfpu)) {
-               fill_note(&t->notes[2], "LINUX", NT_PRXFPREG, sizeof(t->xfpu),
-                         &t->xfpu);
+               fill_note(&t->notes[2], "LINUX", ELF_CORE_XFPREG_TYPE,
+                         sizeof(t->xfpu), &t->xfpu);
                t->num_notes++;
                sz += notesize(&t->notes[2]);
        }
@@ -1488,7 +1496,7 @@ static struct vm_area_struct *next_vma(struct vm_area_struct *this_vma,
  * and then they are actually written out.  If we run out of core limit
  * we just truncate.
  */
-static int elf_core_dump(long signr, struct pt_regs *regs, struct file *file)
+static int elf_core_dump(long signr, struct pt_regs *regs, struct file *file, unsigned long limit)
 {
 #define        NUM_NOTES       6
        int has_dumped = 0;
@@ -1499,7 +1507,6 @@ static int elf_core_dump(long signr, struct pt_regs *regs, struct file *file)
        struct vm_area_struct *vma, *gate_vma;
        struct elfhdr *elf = NULL;
        loff_t offset = 0, dataoff, foffset;
-       unsigned long limit = current->signal->rlim[RLIMIT_CORE].rlim_cur;
        int numnote;
        struct memelfnote *notes = NULL;
        struct elf_prstatus *prstatus = NULL;   /* NT_PRSTATUS */
@@ -1621,7 +1628,7 @@ static int elf_core_dump(long signr, struct pt_regs *regs, struct file *file)
 #ifdef ELF_CORE_COPY_XFPREGS
        if (elf_core_copy_task_xfpregs(current, xfpu))
                fill_note(notes + numnote++,
-                         "LINUX", NT_PRXFPREG, sizeof(*xfpu), xfpu);
+                         "LINUX", ELF_CORE_XFPREG_TYPE, sizeof(*xfpu), xfpu);
 #endif 
   
        fs = get_fs();
@@ -1725,7 +1732,7 @@ static int elf_core_dump(long signr, struct pt_regs *regs, struct file *file)
                                                &page, &vma) <= 0) {
                                DUMP_SEEK(PAGE_SIZE);
                        } else {
-                               if (page == ZERO_PAGE(addr)) {
+                               if (page == ZERO_PAGE(0)) {
                                        if (!dump_seek(file, PAGE_SIZE)) {
                                                page_cache_release(page);
                                                goto end_coredump;