summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'sys-kernel/wolk-sources/files/wolk-sources.binfmt_elf.patch')
-rw-r--r--sys-kernel/wolk-sources/files/wolk-sources.binfmt_elf.patch29
1 files changed, 21 insertions, 8 deletions
diff --git a/sys-kernel/wolk-sources/files/wolk-sources.binfmt_elf.patch b/sys-kernel/wolk-sources/files/wolk-sources.binfmt_elf.patch
index bce026adf312..a8ce8124db86 100644
--- a/sys-kernel/wolk-sources/files/wolk-sources.binfmt_elf.patch
+++ b/sys-kernel/wolk-sources/files/wolk-sources.binfmt_elf.patch
@@ -1,6 +1,6 @@
-diff -ur linux-2.4.27-gentoo-r2/fs/binfmt_elf.c linux-2.4.27-gentoo-r3/fs/binfmt_elf.c
---- linux-2.4.27-gentoo-r2/fs/binfmt_elf.c 2004-11-10 20:43:18.000000000 +0000
-+++ linux-2.4.27-gentoo-r3/fs/binfmt_elf.c 2004-11-10 20:33:40.000000000 +0000
+diff -ur linux-2.4.27-gentoo-r3/fs/binfmt_elf.c linux-2.4.27-gentoo-r4/fs/binfmt_elf.c
+--- linux-2.4.27-gentoo-r3/fs/binfmt_elf.c 2004-11-20 14:00:14.547133232 +0000
++++ linux-2.4.27-gentoo-r4/fs/binfmt_elf.c 2004-11-20 13:59:42.415018056 +0000
@@ -308,9 +308,12 @@
goto out;
@@ -29,7 +29,17 @@ diff -ur linux-2.4.27-gentoo-r2/fs/binfmt_elf.c linux-2.4.27-gentoo-r3/fs/binfmt
files = current->files; /* Refcounted so ok */
retval = unshare_files();
-@@ -734,8 +740,14 @@
+@@ -724,7 +730,8 @@
+ */
+
+ retval = -ENOMEM;
+- if (elf_ppnt->p_filesz > PATH_MAX)
++ if (elf_ppnt->p_filesz > PATH_MAX ||
++ elf_ppnt->p_filesz == 0)
+ goto out_free_file;
+ elf_interpreter = (char *) kmalloc(elf_ppnt->p_filesz,
+ GFP_KERNEL);
+@@ -734,8 +741,16 @@
retval = kernel_read(bprm->file, elf_ppnt->p_offset,
elf_interpreter,
elf_ppnt->p_filesz);
@@ -40,12 +50,14 @@ diff -ur linux-2.4.27-gentoo-r2/fs/binfmt_elf.c linux-2.4.27-gentoo-r3/fs/binfmt
goto out_free_interp;
+ }
+ /* make sure path is NULL terminated */
-+ elf_interpreter[elf_ppnt->p_filesz - 1] = '\0';
++ retval = -EINVAL;
++ if (elf_interpreter[elf_ppnt->p_filesz - 1] != '\0')
++ goto out_free_interp;
+
/* If the program interpreter is one of these two,
* then assume an iBCS2 image. Otherwise assume
* a native linux image.
-@@ -754,8 +766,11 @@
+@@ -754,8 +769,11 @@
if (IS_ERR(interpreter))
goto out_free_interp;
retval = kernel_read(interpreter, 0, bprm->buf, BINPRM_BUF_SIZE);
@@ -58,7 +70,7 @@ diff -ur linux-2.4.27-gentoo-r2/fs/binfmt_elf.c linux-2.4.27-gentoo-r3/fs/binfmt
/* Get the exec headers */
interp_ex = *((struct exec *) bprm->buf);
-@@ -967,7 +982,10 @@
+@@ -967,7 +985,10 @@
#endif
if (BAD_ADDR(error))
@@ -70,7 +82,7 @@ diff -ur linux-2.4.27-gentoo-r2/fs/binfmt_elf.c linux-2.4.27-gentoo-r3/fs/binfmt
/* PaX: mirror at a randomized base */
down_write(&current->mm->mmap_sem);
-@@ -1008,7 +1026,10 @@
+@@ -1008,7 +1029,10 @@
{
error = elf_map(bprm->file, load_bias + vaddr, elf_ppnt, elf_prot, elf_flags);
if (BAD_ADDR(error))
@@ -82,3 +94,4 @@ diff -ur linux-2.4.27-gentoo-r2/fs/binfmt_elf.c linux-2.4.27-gentoo-r3/fs/binfmt
}
if (!load_addr_set) {
+Only in linux-2.4.27-gentoo-r4/fs: binfmt_elf.c.orig