Skip to content

Commit

Permalink
mmap: arch_get_unmapped_area(): use proper mmap base for bottom up di…
Browse files Browse the repository at this point in the history
…rection

This is more or less the generic variant of commit 41aacc1 ("x86
get_unmapped_area: Access mmap_legacy_base through mm_struct member").

So effectively architectures which use an own arch_pick_mmap_layout()
implementation but call the generic arch_get_unmapped_area() now can
also randomize their mmap_base.

All architectures which have an own arch_pick_mmap_layout() and call the
generic arch_get_unmapped_area() (arm64, s390, tile) currently set
mmap_base to TASK_UNMAPPED_BASE.  This is also true for the generic
arch_pick_mmap_layout() function.  So this change is a no-op currently.

Signed-off-by: Heiko Carstens <[email protected]>
Cc: Radu Caragea <[email protected]>
Cc: Michel Lespinasse <[email protected]>
Cc: Catalin Marinas <[email protected]>
Cc: Will Deacon <[email protected]>
Cc: Chris Metcalf <[email protected]>
Cc: Martin Schwidefsky <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
heicarst authored and torvalds committed Nov 13, 2013
1 parent b349acc commit 4e99b02
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mm/mmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -1872,7 +1872,7 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr,

info.flags = 0;
info.length = len;
info.low_limit = TASK_UNMAPPED_BASE;
info.low_limit = mm->mmap_base;
info.high_limit = TASK_SIZE;
info.align_mask = 0;
return vm_unmapped_area(&info);
Expand Down

0 comments on commit 4e99b02

Please sign in to comment.