Version bump for the AF_UNIX and a.out security vulnerabilities; bugs #72452 and...
authorTim Yamin <plasmaroo@gentoo.org>
Sat, 27 Nov 2004 17:22:56 +0000 (17:22 +0000)
committerTim Yamin <plasmaroo@gentoo.org>
Sat, 27 Nov 2004 17:22:56 +0000 (17:22 +0000)
sys-kernel/alpha-sources/ChangeLog
sys-kernel/alpha-sources/Manifest
sys-kernel/alpha-sources/alpha-sources-2.4.21-r16.ebuild [moved from sys-kernel/alpha-sources/alpha-sources-2.4.21-r15.ebuild with 93% similarity]
sys-kernel/alpha-sources/files/alpha-sources.AF_UNIX.patch [new file with mode: 0644]
sys-kernel/alpha-sources/files/alpha-sources.binfmt_a.out.patch [new file with mode: 0644]
sys-kernel/alpha-sources/files/digest-alpha-sources-2.4.21-r16 [moved from sys-kernel/alpha-sources/files/digest-alpha-sources-2.4.21-r15 with 100% similarity]

index 4adf8c21f9d1547783f227e85fdd29a8a3913b89..b0e4be4dd36f363c28b3939703b6a77cb50be3ed 100644 (file)
@@ -1,6 +1,14 @@
 # ChangeLog for sys-kernel/alpha-sources
 # Copyright 2002-2004 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-kernel/alpha-sources/ChangeLog,v 1.37 2004/11/19 21:09:47 plasmaroo Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-kernel/alpha-sources/ChangeLog,v 1.38 2004/11/27 17:22:56 plasmaroo Exp $
+
+*alpha-sources-2.4.21-r16 (27 Nov 2004)
+
+  27 Nov 2004; <plasmaroo@gentoo.org> -alpha-sources-2.4.21-r15.ebuild,
+  +alpha-sources-2.4.21-r16.ebuild, +files/alpha-sources.AF_UNIX.patch,
+  +files/alpha-sources.binfmt_a.out.patch:
+  Version bump for the AF_UNIX and a.out security vulnerabilities; bugs #72452
+  and #72317.
 
 *alpha-sources-2.4.21-r15 (19 Nov 2004)
 
index 130cf6e39689e29ba33920b6284a740ca62e29fc..b66d450331fe24046a9aaa7283411b0466e7a43c 100644 (file)
@@ -1,5 +1,5 @@
-MD5 86bc0a14ff3ad62e193d735552847695 ChangeLog 6941
-MD5 4440624a9efb94861c5b60fa30ec78cf alpha-sources-2.4.21-r15.ebuild 4608
+MD5 5b33ee28ca94333ee96be884d2c00f71 alpha-sources-2.4.21-r16.ebuild 4779
+MD5 f24529241dd1b78a6aa2b29b0645b0cc ChangeLog 7263
 MD5 2b3ddb8b8b15f8da35ade38544b57857 files/alpha-sources.XDRWrapFix.patch 1499
 MD5 5bf9836a632a861728d33f9736bb7431 files/alpha-sources.CAN-2004-0133.patch 427
 MD5 d1ccc2047be533c992f67270a150a210 files/alpha-sources.cmdlineLeak.patch 388
@@ -7,10 +7,11 @@ MD5 c460ea130cb4ae84a5063ba044e3ce72 files/alpha-sources.CAN-2004-0427.patch 460
 MD5 9c816c892d6e3d3f0b7b77d3d503ab10 files/alpha-sources.CAN-2004-0075.patch 634
 MD5 d4a740ae56c2049247083af387a22a85 files/alpha-sources.CAN-2004-0394.patch 350
 MD5 147fec50180ad91b6260fc7201dcb90f files/alpha-sources.CAN-2004-0010.patch 6050
+MD5 b9a94233e1457787352e5f85e3e3582d files/alpha-sources.binfmt_a.out.patch 2009
 MD5 dc18e982f8149588a291956481885a8c files/alpha-sources.CAN-2004-0495.patch 17549
 MD5 fce867333f0c9d905d426396371bc9b4 files/alpha-sources.binfmt_elf.patch 2511
 MD5 a61e57d5483a06f20da339d91f98fbb8 files/alpha-sources.rtc_fix.patch 6769
-MD5 76cc0c8530da5b9d8f6db7182df4d591 files/digest-alpha-sources-2.4.21-r15 304
+MD5 b0a1f80aff51d6601e8924329023b241 files/alpha-sources.AF_UNIX.patch 515
 MD5 174438d215b70cad5ffb00ca8123c062 files/alpha-sources.munmap.patch 837
 MD5 60d25ff310fc6abfdce39ec9e47345af files/alpha-sources.CAN-2004-0685.patch 2809
 MD5 3bdf00d5f80fe9dfbfe8220e076cd04c files/alpha-sources.CAN-2004-0497.patch 707
@@ -20,5 +21,6 @@ MD5 de75cfa969ed092578d9ddda6c5be334 files/alpha-sources.CAN-2004-0181.patch 123
 MD5 eaeda68a619caaddd5b8fdc5e7c39932 files/alpha-sources.CAN-2004-0177.patch 384
 MD5 21f3a4f186017d925067335e24db36a1 files/alpha-sources.CAN-2004-0109.patch 1877
 MD5 ac42024b6e6ee1e2165914db4b22a61c files/alpha-sources.CAN-2004-0178.patch 424
+MD5 76cc0c8530da5b9d8f6db7182df4d591 files/digest-alpha-sources-2.4.21-r16 304
 MD5 082e410301c2522521b0d3843db19c9e files/alpha-sources.CAN-2004-0535.patch 502
 MD5 e637c6fa41097ea2c4693d0766f2e1c5 files/do_brk_fix.patch 242
similarity index 93%
rename from sys-kernel/alpha-sources/alpha-sources-2.4.21-r15.ebuild
rename to sys-kernel/alpha-sources/alpha-sources-2.4.21-r16.ebuild
index 476d584bb101f3e02b22d1bcb6120c6c2e38c896..94a35ab5d985c43efb163fdd5cc5defa891e853a 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/alpha-sources/alpha-sources-2.4.21-r15.ebuild,v 1.1 2004/11/19 21:09:47 plasmaroo Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-kernel/alpha-sources/alpha-sources-2.4.21-r16.ebuild,v 1.1 2004/11/27 17:22:56 plasmaroo Exp $
 
 # OKV=original kernel version, KV=patched kernel version.  They can be the same.
 
@@ -16,7 +16,7 @@ S=${WORKDIR}/linux-${KV}
 
 DESCRIPTION="Full sources for the Gentoo Linux Alpha kernel"
 SRC_URI="mirror://kernel/linux/kernel/v2.4/linux-${OKV}.tar.bz2
-       mirror://gentoo/patches-${KV/15/3}.tar.bz2
+       mirror://gentoo/patches-${KV/16/3}.tar.bz2
        http://dev.gentoo.org/~plasmaroo/patches/kernel/misc/security/linux-${OKV}-CAN-2004-0415.patch
        http://dev.gentoo.org/~plasmaroo/patches/kernel/misc/security/${P}-CAN-2004-0814.patch"
 SLOT="${KV}"
@@ -25,7 +25,7 @@ KEYWORDS="alpha -sparc -x86 -ppc -hppa -mips"
 src_unpack() {
        unpack ${A}
        mv linux-${OKV} linux-${KV} || die
-       cd ${WORKDIR}/${KV/15/1}
+       cd ${WORKDIR}/${KV/16/1}
 
        # This is the crypt USE flag, keeps {USAGI/superfreeswan/patch-int/loop-jari}
        if ! use crypt; then
@@ -82,6 +82,8 @@ src_unpack() {
        epatch ${FILESDIR}/${PN}.XDRWrapFix.patch || die "Failed to apply the kNFSd XDR fix!"
        epatch ${FILESDIR}/${PN}.binfmt_elf.patch || die "Failed to apply the binfmt_elf fix!"
        epatch ${FILESDIR}/${PN}.smbfs.patch || die "Failed to apply the SMBFS fix!"
+       epatch ${FILESDIR}/${PN}.AF_UNIX.patch || die "Failed to apply the AF_UNIX patch!"
+       epatch ${FILESDIR}/${PN}.binfmt_a.out.patch || die "Failed to apply the a.out patch!"
 
        # Fix multi-line literal in include/asm-alpha/xor.h -- see bug 38354
        # If this script "dies" then that means it's no longer applicable.
diff --git a/sys-kernel/alpha-sources/files/alpha-sources.AF_UNIX.patch b/sys-kernel/alpha-sources/files/alpha-sources.AF_UNIX.patch
new file mode 100644 (file)
index 0000000..6ced784
--- /dev/null
@@ -0,0 +1,24 @@
+--- linux-2.4.27/net/unix/af_unix.c    2004-11-24 08:23:21 -08:00
++++ linux-2.4.28/net/unix/af_unix.c    2004-11-24 08:23:21 -08:00
+@@ -1403,9 +1403,11 @@
+ 
+       msg->msg_namelen = 0;
+ 
++      down(&sk->protinfo.af_unix.readsem);
++
+       skb = skb_recv_datagram(sk, flags, noblock, &err);
+       if (!skb)
+-              goto out;
++              goto out_unlock;
+ 
+       wake_up_interruptible(&sk->protinfo.af_unix.peer_wait);
+ 
+@@ -1449,6 +1451,8 @@
+ 
+ out_free:
+       skb_free_datagram(sk,skb);
++out_unlock:
++      up(&sk->protinfo.af_unix.readsem);
+ out:
+       return err;
+ }
diff --git a/sys-kernel/alpha-sources/files/alpha-sources.binfmt_a.out.patch b/sys-kernel/alpha-sources/files/alpha-sources.binfmt_a.out.patch
new file mode 100644 (file)
index 0000000..4644ae2
--- /dev/null
@@ -0,0 +1,63 @@
+diff -Nru linux-2.4.28/fs/exec.c linux-2.4.28.plasmaroo/fs/exec.c
+--- linux-2.4.28/fs/exec.c     2004-04-15 10:44:45 -07:00
++++ linux-2.4.28.plasmaroo/fs/exec.c   2004-11-12 12:02:40 -08:00
+@@ -342,6 +342,7 @@ int setup_arg_pages(struct linux_binprm 
+       
+       down_write(&current->mm->mmap_sem);
+       {
++              struct vm_area_struct *vma;
+               mpnt->vm_mm = current->mm;
+               mpnt->vm_start = PAGE_MASK & (unsigned long) bprm->p;
+               mpnt->vm_end = STACK_TOP;
+@@ -351,6 +352,12 @@ int setup_arg_pages(struct linux_binprm 
+               mpnt->vm_pgoff = 0;
+               mpnt->vm_file = NULL;
+               mpnt->vm_private_data = (void *) 0;
++              vma = find_vma(current->mm, mpnt->vm_start);
++              if (vma) {
++                      up_write(&current->mm->mmap_sem);
++                      kmem_cache_free(vm_area_cachep, mpnt);
++                      return -ENOMEM;
++              }
+               insert_vm_struct(current->mm, mpnt);
+               current->mm->total_vm = (mpnt->vm_end - mpnt->vm_start) >> PAGE_SHIFT;
+       } 
+diff -Nru linux-2.4.28/fs/exec.c linux-2.4.28.plasmaroo/fs/exec.c
+--- linux-2.4.28/fs/binfmt_aout.c      2002-02-04 23:54:04 -08:00
++++ linux-2.4.28.plasmaroo/fs/binfmt_aout.c    2004-11-12 11:55:14 -08:00
+@@ -39,13 +39,18 @@ static struct linux_binfmt aout_format =
+       NULL, THIS_MODULE, load_aout_binary, load_aout_library, aout_core_dump, PAGE_SIZE
+ };
+ 
+-static void set_brk(unsigned long start, unsigned long end)
++#define BAD_ADDR(x)   ((unsigned long)(x) >= TASK_SIZE)
++
++static int set_brk(unsigned long start, unsigned long end)
+ {
+       start = PAGE_ALIGN(start);
+       end = PAGE_ALIGN(end);
+-      if (end <= start)
+-              return;
+-      do_brk(start, end - start);
++      if (end > start) {
++              unsigned long addr = do_brk(start, end - start);
++              if (BAD_ADDR(addr))
++                      return addr;
++      }
++      return 0;
+ }
+ 
+ /*
+@@ -405,7 +410,11 @@ static int load_aout_binary(struct linux
+ beyond_if:
+       set_binfmt(&aout_format);
+ 
+-      set_brk(current->mm->start_brk, current->mm->brk);
++      retval = set_brk(current->mm->start_brk, current->mm->brk);
++      if (retval < 0) {
++              send_sig(SIGKILL, current, 0);
++              return retval;
++      }
+ 
+       retval = setup_arg_pages(bprm); 
+       if (retval < 0) {