Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 160812 - fixes exec-shield to not randomize to between end-of-binary and start-of-brk
Summary: fixes exec-shield to not randomize to between end-of-binary and start-of-brk
Alias: None
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: kernel
Version: 4.0
Hardware: All
OS: Linux
Target Milestone: ---
: ---
Assignee: Ingo Molnar
QA Contact: Brian Brock
Depends On:
Blocks: 156322
TreeView+ depends on / blocked
Reported: 2005-06-17 14:18 UTC by Tim Burke
Modified: 2007-11-30 22:07 UTC (History)
1 user (show)

Fixed In Version: RHSA-2005-514
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2005-10-05 13:32:30 UTC
Target Upstream Version:

Attachments (Terms of Use)

System ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2005:514 qe-ready SHIPPED_LIVE Important: Updated kernel packages available for Red Hat Enterprise Linux 4 Update 2 2005-10-05 04:00:00 UTC

Description Tim Burke 2005-06-17 14:18:41 UTC
Refer to rhkernel-list, $subject:
[rhel4 patch] heap-gap-fix2.patch
this patch fixes exec-shield to not randomize to between end-of-binary and
start-of-brk, if the first 16MB is full with DSOs. This is a rare but
possible condition that decreases exec-shield protection. (The max() is
there to make sure we have a minimum end-area of 128MB, as start_brk can
be low on PIE binaries) This patch improves the nonexec coverage of the
exec-shield when the segment limit is used. Build and boot tested.


--- mm/mmap.c.orig
+++ mm/mmap.c
@@ -1303,7 +1303,7 @@ unsigned long arch_get_unmapped_exec_are
 			 * as much as possible:
 			if (addr >= 0x01000000) {
-				tmp = randomize_range(0x01000000, mm->brk, len);
+				tmp = randomize_range(0x01000000, PAGE_ALIGN(max(mm->start_brk,
0x08000000)), len);
 				vma = find_vma(mm, tmp);
 				if (TASK_SIZE - len >= tmp &&
 				    (!vma || tmp + len <= vma->vm_start))

Comment 1 Jason Baron 2005-06-20 19:28:14 UTC

*** This bug has been marked as a duplicate of 161136 ***

Comment 4 Red Hat Bugzilla 2005-10-05 13:32:31 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

Note You need to log in before you can comment on or make changes to this bug.