rpms/kernel/devel linux-2.6-execshield-no-randomization.patch, NONE, 1.1 kernel.spec, 1.2056, 1.2057

Chuck Ebbert cebbert at fedoraproject.org
Thu Jul 1 18:06:03 UTC 2010


Author: cebbert

Update of /cvs/pkgs/rpms/kernel/devel
In directory cvs01.phx2.fedoraproject.org:/tmp/cvs-serv30583

Modified Files:
	kernel.spec 
Added Files:
	linux-2.6-execshield-no-randomization.patch 
Log Message:
Copy fix for BZ#220892 from F-13.

linux-2.6-execshield-no-randomization.patch:
 mmap.c |   11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

--- NEW FILE linux-2.6-execshield-no-randomization.patch ---
fix for bz#220892
Makes execshield honor the no-randomization options.

--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -1588,6 +1588,12 @@
 }
 EXPORT_SYMBOL(get_unmapped_area_prot);
 
+static bool should_randomize(void)
+{
+	return (current->flags & PF_RANDOMIZE) &&
+		!(current->personality & ADDR_NO_RANDOMIZE);
+}
+
 #define SHLIB_BASE	0x00110000
 
 unsigned long
@@ -1606,7 +1612,8 @@
 		return addr;
 
 	if (!addr)
-		addr = randomize_range(SHLIB_BASE, 0x01000000, len);
+		addr = !should_randomize() ? SHLIB_BASE :
+			randomize_range(SHLIB_BASE, 0x01000000, len);
 
 	if (addr) {
 		addr = PAGE_ALIGN(addr);
@@ -1634,7 +1641,7 @@
 			 * Up until the brk area we randomize addresses
 			 * as much as possible:
 			 */
-			if (addr >= 0x01000000) {
+			if (addr >= 0x01000000 && should_randomize()) {
 				tmp = randomize_range(0x01000000,
 					PAGE_ALIGN(max(mm->start_brk,
 					(unsigned long)0x08000000)), len);


Index: kernel.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/kernel.spec,v
retrieving revision 1.2056
retrieving revision 1.2057
diff -u -p -r1.2056 -r1.2057
--- kernel.spec	30 Jun 2010 11:04:57 -0000	1.2056
+++ kernel.spec	1 Jul 2010 18:06:03 -0000	1.2057
@@ -611,6 +611,7 @@ Patch32: utrace-remove-use-of-kref_set.p
 Patch150: linux-2.6.29-sparc-IOC_TYPECHECK.patch
 
 Patch160: linux-2.6-execshield.patch
+Patch161: linux-2.6-execshield-no-randomization.patch
 
 Patch200: linux-2.6-debug-sizeof-structs.patch
 Patch201: linux-2.6-debug-nmi-timeout.patch
@@ -1128,6 +1129,7 @@ ApplyPatch linux-2.6.29-sparc-IOC_TYPECH
 # Exec shield
 #
 ApplyPatch linux-2.6-execshield.patch
+ApplyPatch linux-2.6-execshield-no-randomization.patch
 
 #
 # bugfixes to drivers and filesystems
@@ -1887,6 +1889,9 @@ fi
 #                 ||     ||
 
 %changelog
+* Thu Jul 01 2010 Chuck Ebbert <cebbert at redhat.com>
+- Copy fix for BZ#220892 from F-13.
+
 * Wed Jun 30 2010 Kyle McMartin <kyle at redhat.com> 2.6.35-0.19.rc3.git4
 - 2.6.35-rc3-git4
 



More information about the scm-commits mailing list