From 878515ac7c4bd977d1fbfea5b5b1da3470931788 Mon Sep 17 00:00:00 2001 From: "Konstantin V. Arkhipov" Date: Mon, 15 Nov 2004 17:00:36 +0000 Subject: [PATCH] uuups, missing patch --- sys-kernel/openmosix-sources/Manifest | 1 + .../files/openmosix-sources-binfmt_elf.patch | 72 +++++++++++++++++++ 2 files changed, 73 insertions(+) create mode 100644 sys-kernel/openmosix-sources/files/openmosix-sources-binfmt_elf.patch diff --git a/sys-kernel/openmosix-sources/Manifest b/sys-kernel/openmosix-sources/Manifest index 38d3621d4ec0..36734b2b768a 100644 --- a/sys-kernel/openmosix-sources/Manifest +++ b/sys-kernel/openmosix-sources/Manifest @@ -15,6 +15,7 @@ MD5 42009ab1ca8da78b30d2fcd15150f202 files/digest-openmosix-sources-2.4.27-r4 29 MD5 21f3a4f186017d925067335e24db36a1 files/openmosix-sources.CAN-2004-0109.patch 1877 MD5 ac42024b6e6ee1e2165914db4b22a61c files/openmosix-sources.CAN-2004-0178.patch 424 MD5 60d25ff310fc6abfdce39ec9e47345af files/openmosix-sources.CAN-2004-0685.patch 2809 +MD5 24c53f49954dab29cfc172d4a3ba1a31 files/openmosix-sources-binfmt_elf.patch 1928 MD5 bf2b609e8cab6460d220b1267db09826 files/openmosix-sources.CAN-2004-0001.patch 982 MD5 0f66013f643c79c97fda489618a4e2fd files/openmosix-sources.CAN-2004-0535.patch 476 MD5 dc18e982f8149588a291956481885a8c files/openmosix-sources.CAN-2004-0495.patch 17549 diff --git a/sys-kernel/openmosix-sources/files/openmosix-sources-binfmt_elf.patch b/sys-kernel/openmosix-sources/files/openmosix-sources-binfmt_elf.patch new file mode 100644 index 000000000000..534e4c064a52 --- /dev/null +++ b/sys-kernel/openmosix-sources/files/openmosix-sources-binfmt_elf.patch @@ -0,0 +1,72 @@ +--- linux-2.4.27/fs/binfmt_elf.c 2004-11-10 12:25:16 -08:00 ++++ linux-2.4.27-plasmaroo/fs/binfmt_elf.c 2004-11-10 12:25:16 -08:00 +@@ -335,9 +335,12 @@ + goto out; + + retval = kernel_read(interpreter,interp_elf_ex->e_phoff,(char *)elf_phdata,size); +- error = retval; +- if (retval < 0) ++ error = -EIO; ++ if (retval != size) { ++ if (retval < 0) ++ error = retval; + goto out_close; ++ } + + eppnt = elf_phdata; + for (i=0; ie_phnum; i++, eppnt++) { +@@ -532,8 +535,11 @@ + goto out; + + retval = kernel_read(bprm->file, elf_ex.e_phoff, (char *) elf_phdata, size); +- if (retval < 0) ++ if (retval != size) { ++ if (retval >= 0) ++ retval = -EIO; + goto out_free_ph; ++ } + + files = current->files; /* Refcounted so ok */ + retval = unshare_files(); +@@ -580,8 +586,14 @@ + retval = kernel_read(bprm->file, elf_ppnt->p_offset, + elf_interpreter, + elf_ppnt->p_filesz); +- if (retval < 0) ++ if (retval != elf_ppnt->p_filesz) { ++ if (retval >= 0) ++ retval = -EIO; + goto out_free_interp; ++ } ++ /* make sure path is NULL terminated */ ++ elf_interpreter[elf_ppnt->p_filesz - 1] = '\0'; ++ + /* If the program interpreter is one of these two, + * then assume an iBCS2 image. Otherwise assume + * a native linux image. +@@ -616,8 +628,11 @@ + if (IS_ERR(interpreter)) + goto out_free_interp; + retval = kernel_read(interpreter, 0, bprm->buf, BINPRM_BUF_SIZE); +- if (retval < 0) ++ if (retval != BINPRM_BUF_SIZE) { ++ if (retval >= 0) ++ retval = -EIO; + goto out_free_dentry; ++ } + + /* Get the exec headers */ + loc->interp_ex = *((struct exec *) bprm->buf); +@@ -776,8 +791,10 @@ + } + + error = elf_map(bprm->file, load_bias + vaddr, elf_ppnt, elf_prot, elf_flags); +- if (BAD_ADDR(error)) +- continue; ++ if (BAD_ADDR(error)) { ++ send_sig(SIGKILL, current, 0); ++ goto out_free_dentry; ++ } + + if (!load_addr_set) { + load_addr_set = 1; -- 2.26.2