patch-2.4.0-test3 linux/fs/binfmt_elf.c

Next file: linux/fs/binfmt_em86.c
Previous file: linux/fs/binfmt_aout.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.0-test2/linux/fs/binfmt_elf.c linux/fs/binfmt_elf.c
@@ -407,13 +407,21 @@
 		goto out;
 	if (!elf_check_arch(elf_ex.e_machine))
 		goto out;
-#ifdef __mips__
-	/* IRIX binaries handled elsewhere. */
+#if defined(__mips__) && !defined(__mips64)
+	/* IRIX5 binaries handled elsewhere.  */
 	if (elf_ex.e_flags & EF_MIPS_ARCH) {
 		retval = -ENOEXEC;
 		goto out;
 	}
 #endif
+#if defined(__mips__) && defined(__mips64)
+	/* Linux/MIPS 32-bit binaries handled elsewhere.  */
+	if (sizeof(elf_caddr_t) == 8 &&
+	    elf_ex.e_ident[EI_CLASS] == ELFCLASS32) {
+		retval = -ENOEXEC;
+		goto out;
+	}
+#endif
 	if (!bprm->file->f_op||!bprm->file->f_op->mmap)
 		goto out;
 
@@ -666,9 +674,8 @@
 						    interpreter,
 						    &interp_load_addr);
 
-		lock_kernel();
+		allow_write_access(interpreter);
 		fput(interpreter);
-		unlock_kernel();
 		kfree(elf_interpreter);
 
 		if (elf_entry == ~0UL) {
@@ -755,9 +762,8 @@
 
 	/* error cleanup */
 out_free_dentry:
-	lock_kernel();
+	allow_write_access(interpreter);
 	fput(interpreter);
-	unlock_kernel();
 out_free_interp:
 	if (elf_interpreter)
 		kfree(elf_interpreter);
@@ -1091,7 +1097,7 @@
 	psinfo.pr_state = i;
 	psinfo.pr_sname = (i < 0 || i > 5) ? '.' : "RSDZTD"[i];
 	psinfo.pr_zomb = psinfo.pr_sname == 'Z';
-	psinfo.pr_nice = current->priority-15;
+	psinfo.pr_nice = current->nice;
 	psinfo.pr_flag = current->flags;
 	psinfo.pr_uid = NEW_TO_OLD_UID(current->uid);
 	psinfo.pr_gid = NEW_TO_OLD_GID(current->gid);

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)