Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Revert "x86 get_unmapped_area(): use proper mmap base for bottom-up direction"

This reverts commit df54d6fa54275ce59660453e29d1228c2b45a826.

The commit isn't necessarily wrong, but because it recalculates the
random mmap_base every time, it seems to confuse user memory allocators
that expect contiguous mmap allocations even when the mmap address isn't
specified.

In particular, the MATLAB Java runtime seems to be unhappy. See

https://bugzilla.kernel.org/show_bug.cgi?id=60774

So we'll want to apply the random offset only once, and Radu has a patch
for that. Revert this older commit in order to apply the other one.

Reported-by: Jeff Shorey <shoreyjeff@gmail.com>
Cc: Radu Caragea <sinaelgl@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

+2 -3
+1 -1
arch/x86/kernel/sys_x86_64.c
··· 101 101 *begin = new_begin; 102 102 } 103 103 } else { 104 - *begin = mmap_legacy_base(); 104 + *begin = TASK_UNMAPPED_BASE; 105 105 *end = TASK_SIZE; 106 106 } 107 107 }
+1 -1
arch/x86/mm/mmap.c
··· 98 98 * Bottom-up (legacy) layout on X86_32 did not support randomization, X86_64 99 99 * does, but not when emulating X86_32 100 100 */ 101 - unsigned long mmap_legacy_base(void) 101 + static unsigned long mmap_legacy_base(void) 102 102 { 103 103 if (mmap_is_ia32()) 104 104 return TASK_UNMAPPED_BASE;
-1
include/linux/sched.h
··· 314 314 struct user_namespace; 315 315 316 316 #ifdef CONFIG_MMU 317 - extern unsigned long mmap_legacy_base(void); 318 317 extern void arch_pick_mmap_layout(struct mm_struct *mm); 319 318 extern unsigned long 320 319 arch_get_unmapped_area(struct file *, unsigned long, unsigned long,