# 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)
-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
# 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
${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/"
# 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"
--- /dev/null
+--- 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;
--- /dev/null
+--- 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;