# ChangeLog for sys-kernel/win4lin-sources
# Copyright 2002-2004 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-kernel/win4lin-sources/ChangeLog,v 1.39 2004/11/09 19:02:53 plasmaroo Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-kernel/win4lin-sources/ChangeLog,v 1.40 2004/11/12 20:30:32 plasmaroo Exp $
+
+*win4lin-sources-2.4.26-r8 (12 Nov 2004)
+
+ 12 Nov 2004; <plasmaroo@gentoo.org> -win4lin-sources-2.4.26-r7.ebuild,
+ +win4lin-sources-2.4.26-r8.ebuild, -win4lin-sources-2.6.7-r7.ebuild,
+ +win4lin-sources-2.6.7-r8.ebuild,
+ +files/win4lin-sources-2.4.26.binfmt_elf.patch,
+ +files/win4lin-sources-2.6.binfmt_elf.patch:
+ Version bump for the binfmt_elf security vulnerability, bug #70681.
09 Nov 2004; <plasmaroo@gentoo.org> files/digest-win4lin-sources-2.4.26-r7:
Updating digest and pushing an updated MKI patch to the mirrors, the one
-MD5 0f86bd375724c5b1b3f378f4d08e48c9 ChangeLog 8445
+MD5 1dbcaaa98a7577627ad7a8039ca0c7b7 ChangeLog 8835
+MD5 3cce735269e32f6bf2400e99460c63ed win4lin-sources-2.4.26-r8.ebuild 2425
+MD5 029a407b2c1b3519e7fe897cbe0181f2 win4lin-sources-2.6.7-r8.ebuild 1793
MD5 608fe99985244b0445f76cee44c9ae14 metadata.xml 290
-MD5 8ce028c81e1760d848e849436170b031 win4lin-sources-2.4.26-r7.ebuild 2336
-MD5 d6ce1722f74216b1f87fad655ba7a13e win4lin-sources-2.6.7-r7.ebuild 1753
MD5 2b3ddb8b8b15f8da35ade38544b57857 files/win4lin-sources-2.4.26.XDRWrapFix.patch 1499
-MD5 9cae5cdb5da7ef0bbe13fbbf6daee5dd files/digest-win4lin-sources-2.6.7-r7 359
MD5 8204afea1d572b49a4a80d8da4eef0c9 files/win4lin-sources-2.6.CAN-2004-0596.patch 1033
+MD5 65254b087906bead43e7e7bf9eba7610 files/digest-win4lin-sources-2.4.26-r8 353
MD5 c2510fe1891f5a9effb12c2196922206 files/win4lin-sources-2.6.cmdlineLeak.patch 281
+MD5 1ee8ba8362089c31fdd7d88b32eaf63e files/win4lin-sources-2.6.binfmt_elf.patch 1938
MD5 452e04a312368605e145428c35bd0e05 files/win4lin-sources-2.6.devPtmx.patch 572
MD5 c9da1bc82b906f6abc648c056e7bf662 files/win4lin-sources-2.4.26.FPULockup-53804.patch 354
MD5 d1ccc2047be533c992f67270a150a210 files/win4lin-sources-2.4.26.cmdlineLeak.patch 388
+MD5 9cae5cdb5da7ef0bbe13fbbf6daee5dd files/digest-win4lin-sources-2.6.7-r8 359
MD5 aa595005721b58929ee55e2e8f4b6ba0 files/win4lin-sources-2.6.CAN-2004-0816.patch 1693
MD5 dc18e982f8149588a291956481885a8c files/win4lin-sources-2.4.26.CAN-2004-0495.patch 17549
MD5 60d25ff310fc6abfdce39ec9e47345af files/win4lin-sources-2.4.26.CAN-2004-0685.patch 2809
MD5 39361f8d16b1fe5891aab62e92f8cd30 files/win4lin-sources-2.6.IPTables-RDoS.patch 390
MD5 d4a740ae56c2049247083af387a22a85 files/win4lin-sources-2.4.26.CAN-2004-0394.patch 350
-MD5 65254b087906bead43e7e7bf9eba7610 files/digest-win4lin-sources-2.4.26-r7 353
+MD5 24c53f49954dab29cfc172d4a3ba1a31 files/win4lin-sources-2.4.26.binfmt_elf.patch 1928
MD5 02c062ec3a11a6a1498cdf0b1716c90a files/win4lin-sources-2.6.6.FPULockup-53804.patch 895
MD5 0f66013f643c79c97fda489618a4e2fd files/win4lin-sources-2.4.26.CAN-2004-0535.patch 476
MD5 95708646470a95668e8789cd415844ed files/win4lin-sources.CAN-2004-0497.patch 846
--- /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.7-uc0-r8/fs/binfmt_elf.c 2004-11-12 11:50:08 -08:00
++++ linux-2.6.7-uc0-r8-plasmaroo/fs/binfmt_elf.c 2004-11-12 11:50:08 -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;
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-kernel/win4lin-sources/win4lin-sources-2.4.26-r7.ebuild,v 1.1 2004/11/07 16:58:28 plasmaroo Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-kernel/win4lin-sources/win4lin-sources-2.4.26-r8.ebuild,v 1.1 2004/11/12 20:30:32 plasmaroo Exp $
# OKV=original kernel version, KV=patched kernel version. They can be the same.
epatch ${FILESDIR}/${P}.FPULockup-53804.patch || die "Failed to apply FPU-lockup patch!"
epatch ${FILESDIR}/${P}.cmdlineLeak.patch || die "Failed to apply the /proc/cmdline patch!"
epatch ${FILESDIR}/${P}.XDRWrapFix.patch || die "Failed to apply the kNFSd XDR patch!"
+ epatch ${FILESDIR}/${P}.binfmt_elf.patch || die "Failed to apply the binfmt_elf patch!"
kernel_universal_unpack
}
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-kernel/win4lin-sources/win4lin-sources-2.6.7-r7.ebuild,v 1.1 2004/11/07 16:58:28 plasmaroo Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-kernel/win4lin-sources/win4lin-sources-2.6.7-r8.ebuild,v 1.1 2004/11/12 20:30:32 plasmaroo Exp $
ETYPE="sources"
inherit kernel-2
${FILESDIR}/${PN}-2.6.ProcPerms.patch
${FILESDIR}/${PN}-2.6.cmdlineLeak.patch
${FILESDIR}/${PN}-2.6.CAN-2004-0816.patch
- ${FILESDIR}/${PN}-2.6.devPtmx.patch"
+ ${FILESDIR}/${PN}-2.6.devPtmx.patch
+ ${FILESDIR}/${PN}-2.6.binfmt_elf.patch"
S=${WORKDIR}/linux-${KV}