--- zzzz-none-000/linux-2.6.13.1/fs/binfmt_elf.c 2005-09-10 02:42:58.000000000 +0000 +++ ohio-7170-487/linux-2.6.13.1/fs/binfmt_elf.c 2005-10-10 09:59:38.000000000 +0000 @@ -551,22 +551,22 @@ if (loc->elf_ex.e_type != ET_EXEC && loc->elf_ex.e_type != ET_DYN) goto out; - if (!elf_check_arch(&loc->elf_ex)) + if (!elf_check_arch(&loc->elf_ex)) goto out; - if (!bprm->file->f_op||!bprm->file->f_op->mmap) + if (!bprm->file->f_op||!bprm->file->f_op->mmap) goto out; /* Now read in all of the header information */ - if (loc->elf_ex.e_phentsize != sizeof(struct elf_phdr)) + if (loc->elf_ex.e_phentsize != sizeof(struct elf_phdr)) goto out; if (loc->elf_ex.e_phnum < 1 || - loc->elf_ex.e_phnum > 65536U / sizeof(struct elf_phdr)) + loc->elf_ex.e_phnum > 65536U / sizeof(struct elf_phdr)) goto out; size = loc->elf_ex.e_phnum * sizeof(struct elf_phdr); retval = -ENOMEM; elf_phdata = (struct elf_phdr *) kmalloc(size, GFP_KERNEL); - if (!elf_phdata) + if (!elf_phdata) goto out; retval = kernel_read(bprm->file, loc->elf_ex.e_phoff, (char *) elf_phdata, size); @@ -578,7 +578,7 @@ files = current->files; /* Refcounted so ok */ retval = unshare_files(); - if (retval < 0) + if (retval < 0) goto out_free_ph; if (files == current->files) { put_files_struct(files); @@ -589,7 +589,7 @@ loader stuff we need to do it earlier */ retval = get_unused_fd(); - if (retval < 0) + if (retval < 0) goto out_free_fh; get_file(bprm->file); fd_install(elf_exec_fileno = retval, bprm->file); @@ -612,13 +612,13 @@ retval = -ENOEXEC; if (elf_ppnt->p_filesz > PATH_MAX || - elf_ppnt->p_filesz < 2) + elf_ppnt->p_filesz < 2) goto out_free_file; retval = -ENOMEM; elf_interpreter = (char *) kmalloc(elf_ppnt->p_filesz, GFP_KERNEL); - if (!elf_interpreter) + if (!elf_interpreter) goto out_free_file; retval = kernel_read(bprm->file, elf_ppnt->p_offset, @@ -631,7 +631,7 @@ } /* make sure path is NULL terminated */ retval = -ENOEXEC; - if (elf_interpreter[elf_ppnt->p_filesz - 1] != '\0') + if (elf_interpreter[elf_ppnt->p_filesz - 1] != '\0') goto out_free_interp; /* If the program interpreter is one of these two, @@ -665,7 +665,7 @@ interpreter = open_exec(elf_interpreter); retval = PTR_ERR(interpreter); - if (IS_ERR(interpreter)) + if (IS_ERR(interpreter)) goto out_free_interp; retval = kernel_read(interpreter, 0, bprm->buf, BINPRM_BUF_SIZE); if (retval != BINPRM_BUF_SIZE) { @@ -719,7 +719,7 @@ } /* Verify the interpreter has a valid arch */ if ((interpreter_type == INTERPRETER_ELF) && - !elf_check_arch(&loc->interp_elf_ex)) + !elf_check_arch(&loc->interp_elf_ex)) goto out_free_dentry; } else { /* Executables without an interpreter also need a personality */ @@ -735,7 +735,7 @@ if (elf_interpreter) { retval = copy_strings_kernel(1, &passed_p, bprm); - if (retval) + if (retval) goto out_free_dentry; bprm->argc++; } @@ -743,7 +743,7 @@ /* Flush all traces of the currently running executable */ retval = flush_old_exec(bprm); - if (retval) + if (retval) goto out_free_dentry; /* Discard our unneeded old files struct */ @@ -1032,6 +1032,7 @@ int retval, error, i, j; struct elfhdr elf_ex; + error = -ENOEXEC; retval = kernel_read(file, 0, (char *) &elf_ex, sizeof(elf_ex)); if (retval != sizeof(elf_ex)) @@ -1634,7 +1635,7 @@ if ((off_t) file->f_pos != offset) { /* Sanity check */ - printk("elf_core_dump: file->f_pos (%ld) != offset (%ld)\n", + printk(KERN_ERR "elf_core_dump: file->f_pos (%ld) != offset (%ld)\n", (off_t) file->f_pos, offset); }