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. Ingo --- 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))
*** This bug has been marked as a duplicate of 161136 ***
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. http://rhn.redhat.com/errata/RHSA-2005-514.html