r2195 - in trunk/kernel/source/kernel-source-2.6.10-2.6.10/debian: . patches patches/series

Andres Salomon dilinger-guest@costa.debian.org
Sat, 08 Jan 2005 14:29:38 +0100


Author: dilinger-guest
Date: 2005-01-08 14:29:38 +0100 (Sat, 08 Jan 2005)
New Revision: 2195

Added:
   trunk/kernel/source/kernel-source-2.6.10-2.6.10/debian/patches/032-do_brk_security_fixes.dpatch
   trunk/kernel/source/kernel-source-2.6.10-2.6.10/debian/patches/series/2.6.10-3
Modified:
   trunk/kernel/source/kernel-source-2.6.10-2.6.10/debian/changelog
Log:
  * Drop 028-do_brk_security_fixes.dpatch (from the -ac tree), use
    Linus' patch instead; 032-do_brk_security_fixes.dpatch
    (Andres Salomon).


Modified: trunk/kernel/source/kernel-source-2.6.10-2.6.10/debian/changelog
===================================================================
--- trunk/kernel/source/kernel-source-2.6.10-2.6.10/debian/changelog	2005-01-08 13:19:35 UTC (rev 2194)
+++ trunk/kernel/source/kernel-source-2.6.10-2.6.10/debian/changelog	2005-01-08 13:29:38 UTC (rev 2195)
@@ -9,6 +9,10 @@
 
   * Small README.Debian update.
 
+  * Drop 028-do_brk_security_fixes.dpatch (from the -ac tree), use
+    Linus' patch instead; 032-do_brk_security_fixes.dpatch
+    (Andres Salomon).
+
  -- Simon Horman <horms@debian.org>  Sat,  8 Jan 2005 11:58:20 +0900
 
 kernel-source-2.6.10 (2.6.10-2) unstable; urgency=low

Added: trunk/kernel/source/kernel-source-2.6.10-2.6.10/debian/patches/032-do_brk_security_fixes.dpatch
===================================================================
--- trunk/kernel/source/kernel-source-2.6.10-2.6.10/debian/patches/032-do_brk_security_fixes.dpatch	2005-01-08 13:19:35 UTC (rev 2194)
+++ trunk/kernel/source/kernel-source-2.6.10-2.6.10/debian/patches/032-do_brk_security_fixes.dpatch	2005-01-08 13:29:38 UTC (rev 2195)
@@ -0,0 +1,58 @@
+#! /bin/sh -e
+## <PATCHNAME>.dpatch by <PATCH_AUTHOR@EMAI>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Description: Fix do_brk() locking in library loader
+## DP: Patch author: torvalds@ppc970.osdl.org
+## DP: Upstream status: backported
+
+. $(dirname $0)/DPATCH
+
+@DPATCH@
+# This is a BitKeeper generated diff -Nru style patch.
+#
+# ChangeSet
+#   2005/01/07 15:58:52-08:00 torvalds@ppc970.osdl.org 
+#   Fix do_brk() locking in library loader
+#   
+#   The regular executable loader path doesn't need the locking,
+#   because it's the only user of its VM. But the same is not true
+#   at library load time. So get the mmap semaphore.
+# 
+# fs/binfmt_aout.c
+#   2005/01/07 15:58:44-08:00 torvalds@ppc970.osdl.org +2 -0
+#   Fix do_brk() locking in library loader
+# 
+# fs/binfmt_elf.c
+#   2005/01/07 15:58:45-08:00 torvalds@ppc970.osdl.org +4 -1
+#   Fix do_brk() locking in library loader
+# 
+diff -Nru a/fs/binfmt_aout.c b/fs/binfmt_aout.c
+--- a/fs/binfmt_aout.c	2005-01-08 01:41:21 -08:00
++++ b/fs/binfmt_aout.c	2005-01-08 01:41:21 -08:00
+@@ -512,7 +512,9 @@
+ 	len = PAGE_ALIGN(ex.a_text + ex.a_data);
+ 	bss = ex.a_text + ex.a_data + ex.a_bss;
+ 	if (bss > len) {
++		down_write(&current->mm->mmap_sem);
+ 		error = do_brk(start_addr + len, bss - len);
++		up_write(&current->mm->mmap_sem);
+ 		retval = error;
+ 		if (error != start_addr + len)
+ 			goto out;
+diff -Nru a/fs/binfmt_elf.c b/fs/binfmt_elf.c
+--- a/fs/binfmt_elf.c	2005-01-08 01:41:21 -08:00
++++ b/fs/binfmt_elf.c	2005-01-08 01:41:21 -08:00
+@@ -1024,8 +1024,11 @@
+ 
+ 	len = ELF_PAGESTART(elf_phdata->p_filesz + elf_phdata->p_vaddr + ELF_MIN_ALIGN - 1);
+ 	bss = elf_phdata->p_memsz + elf_phdata->p_vaddr;
+-	if (bss > len)
++	if (bss > len) {
++		down_write(&current->mm->mmap_sem);
+ 		do_brk(len, bss - len);
++		up_write(&current->mm->mmap_sem);
++	}
+ 	error = 0;
+ 
+ out_free_ph:

Added: trunk/kernel/source/kernel-source-2.6.10-2.6.10/debian/patches/series/2.6.10-3
===================================================================
--- trunk/kernel/source/kernel-source-2.6.10-2.6.10/debian/patches/series/2.6.10-3	2005-01-08 13:19:35 UTC (rev 2194)
+++ trunk/kernel/source/kernel-source-2.6.10-2.6.10/debian/patches/series/2.6.10-3	2005-01-08 13:29:38 UTC (rev 2195)
@@ -0,0 +1,2 @@
+- 028-do_brk_security_fixes.dpatch
++ 032-do_brk_security_fixes.dpatch