Version bump for the binfmt_elf security vulnerability, bug #70681.
authorTim Yamin <plasmaroo@gentoo.org>
Fri, 12 Nov 2004 18:57:37 +0000 (18:57 +0000)
committerTim Yamin <plasmaroo@gentoo.org>
Fri, 12 Nov 2004 18:57:37 +0000 (18:57 +0000)
sys-kernel/ck-sources/ChangeLog
sys-kernel/ck-sources/Manifest
sys-kernel/ck-sources/ck-sources-2.4.27-r2.ebuild [moved from sys-kernel/ck-sources/ck-sources-2.4.27-r1.ebuild with 86% similarity]
sys-kernel/ck-sources/ck-sources-2.6.9-r3.ebuild
sys-kernel/ck-sources/files/ck-sources-2.4.27.binfmt_elf.patch [new file with mode: 0644]
sys-kernel/ck-sources/files/ck-sources-2.6.9.binfmt_elf.patch [new file with mode: 0644]
sys-kernel/ck-sources/files/digest-ck-sources-2.4.27-r2 [moved from sys-kernel/ck-sources/files/digest-ck-sources-2.4.27-r1 with 100% similarity]

index 1a6aabc978b5d7e74a3ec96b675efe88bdb23d13..d128b842389ea512a2c2f05a7ee8df440f33265b 100644 (file)
@@ -1,6 +1,14 @@
 # ChangeLog for sys-kernel/ck-sources
 # Copyright 2002-2004 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-kernel/ck-sources/ChangeLog,v 1.65 2004/11/08 22:17:11 dsd Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-kernel/ck-sources/ChangeLog,v 1.66 2004/11/12 18:57:37 plasmaroo Exp $
+
+*ck-sources-2.4.27-r2 (12 Nov 2004)
+
+  12 Nov 2004; <plasmaroo@gentoo.org> -ck-sources-2.4.27-r1.ebuild,
+  +ck-sources-2.4.27-r2.ebuild, ck-sources-2.6.9-r3.ebuild,
+  +files/ck-sources-2.4.27.binfmt_elf.patch,
+  +files/ck-sources-2.6.9.binfmt_elf.patch:
+  Version bump for the binfmt_elf security vulnerability, bug #70681.
 
 *ck-sources-2.6.9-r3 (08 Nov 2004)
 
index 0bc3309c2b98783c10b43cfc677148cecfdf62a3..e19e761df80026780e71365c2d0ee0347043913c 100644 (file)
@@ -1,9 +1,11 @@
-MD5 404ccac88b9c959456a0109b869186b7 ck-sources-2.6.9-r3.ebuild 1102
-MD5 fb6921791ef540d1bc7acc720aaa2432 ck-sources-2.4.27-r1.ebuild 942
-MD5 d406d4a584c18406348cb73f0ed6ff30 ChangeLog 12411
+MD5 8abfae6db38e899e818367f827e3c4aa ChangeLog 12742
+MD5 3dffb961cd109699d5027f45f3b6d7a3 ck-sources-2.6.9-r3.ebuild 1143
 MD5 7187b8c28501f454a2412c9e4a7fcf53 metadata.xml 421
-MD5 d1ccc2047be533c992f67270a150a210 files/ck-sources-2.4.27.cmdlineLeak.patch 388
+MD5 a37cf2413cc07ca599e18d85dff1a134 ck-sources-2.4.27-r2.ebuild 977
 MD5 2b3ddb8b8b15f8da35ade38544b57857 files/ck-sources-2.4.27.XDRWrapFix.patch 1499
+MD5 cc2afc76adbf81038af8a5f262ed5174 files/digest-ck-sources-2.4.27-r2 214
+MD5 d1ccc2047be533c992f67270a150a210 files/ck-sources-2.4.27.cmdlineLeak.patch 388
+MD5 d9127fc038c80114d40b69d761803ed2 files/ck-sources-2.6.9.binfmt_elf.patch 1929
 MD5 7f0579764a55a43256ce069632e0373e files/digest-ck-sources-2.6.9-r3 129
-MD5 cc2afc76adbf81038af8a5f262ed5174 files/digest-ck-sources-2.4.27-r1 214
+MD5 24c53f49954dab29cfc172d4a3ba1a31 files/ck-sources-2.4.27.binfmt_elf.patch 1928
 MD5 d4a740ae56c2049247083af387a22a85 files/ck-sources-2.4.27.CAN-2004-0394.patch 350
similarity index 86%
rename from sys-kernel/ck-sources/ck-sources-2.4.27-r1.ebuild
rename to sys-kernel/ck-sources/ck-sources-2.4.27-r2.ebuild
index 5f0cda3fa69db86ed7eebef59e18bb82825cce78..91999a0c76c779ba41170c26505040c5a48a47fe 100644 (file)
@@ -1,6 +1,6 @@
 # Copyright 1999-2004 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-kernel/ck-sources/ck-sources-2.4.27-r1.ebuild,v 1.1 2004/11/06 22:13:08 plasmaroo Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-kernel/ck-sources/ck-sources-2.4.27-r2.ebuild,v 1.1 2004/11/12 18:57:37 plasmaroo Exp $
 
 ETYPE="sources"
 inherit kernel-2
@@ -16,7 +16,8 @@ UNIPATCH_LIST="${DISTDIR}/patch-${PV}-lck${CKV}.bz2
        ${DISTDIR}/${P}-CAN-2004-0814.patch
        ${FILESDIR}/${P}.CAN-2004-0394.patch
        ${FILESDIR}/${P}.cmdlineLeak.patch
-       ${FILESDIR}/${P}.XDRWrapFix.patch"
+       ${FILESDIR}/${P}.XDRWrapFix.patch
+       ${FILESDIR}/${P}.binfmt_elf.patch"
 
 DESCRIPTION="Full sources for the Stock Linux kernel Con Kolivas's high performance patchset"
 HOMEPAGE="http://members.optusnet.com.au/ckolivas/kernel/"
index 2738f5fe89d42ecbfeb950051d799bbae849290e..56818e9c823c92bc32e9dc80a7b0dbbe4a37fc6d 100644 (file)
@@ -1,8 +1,9 @@
 # Copyright 1999-2004 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-kernel/ck-sources/ck-sources-2.6.9-r3.ebuild,v 1.1 2004/11/08 22:17:11 dsd Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-kernel/ck-sources/ck-sources-2.6.9-r3.ebuild,v 1.2 2004/11/12 18:57:37 plasmaroo Exp $
 
-UNIPATCH_LIST="${DISTDIR}/patch-${KV}.bz2"
+UNIPATCH_LIST="${DISTDIR}/patch-${KV}.bz2
+       ${FILESDIR}/${P}.binfmt_elf.patch"
 K_PREPATCHED="yes"
 UNIPATCH_STRICTORDER="yes"
 
diff --git a/sys-kernel/ck-sources/files/ck-sources-2.4.27.binfmt_elf.patch b/sys-kernel/ck-sources/files/ck-sources-2.4.27.binfmt_elf.patch
new file mode 100644 (file)
index 0000000..534e4c0
--- /dev/null
@@ -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; i<interp_elf_ex->e_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;
diff --git a/sys-kernel/ck-sources/files/ck-sources-2.6.9.binfmt_elf.patch b/sys-kernel/ck-sources/files/ck-sources-2.6.9.binfmt_elf.patch
new file mode 100644 (file)
index 0000000..c4cc8a8
--- /dev/null
@@ -0,0 +1,72 @@
+--- linux-2.6.9/fs/binfmt_elf.c        2004-11-10 12:25:16 -08:00
++++ linux-2.6.9-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; i<interp_elf_ex->e_phnum; i++, eppnt++) {
+@@ -532,8 +535,11 @@
+               goto out;
+ 
+       retval = kernel_read(bprm->file, loc->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;