diff options
author | Heiko Carstens <heiko.carstens@de.ibm.com> | 2013-11-12 15:07:54 -0800 |
---|---|---|
committer | Bharat Nihalani <bnihalani@nvidia.com> | 2014-03-31 20:16:46 -0700 |
commit | 0aa7d6e989e4d105bccee38bb5f0cf9108422266 (patch) | |
tree | 93215b1bb559580d2123bd23c154f9ef07605612 /mm | |
parent | 42322e74860bbfb4447817893631c53d294297c4 (diff) |
mmap: arch_get_unmapped_area(): use proper mmap base for bottom up direction
This is more or less the generic variant of commit 41aacc1eea64 ("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 <heiko.carstens@de.ibm.com>
Cc: Radu Caragea <sinaelgl@gmail.com>
Cc: Michel Lespinasse <walken@google.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Chris Metcalf <cmetcalf@tilera.com>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Bug 1486057
Cherry-pick upstream patch 4e99b02131b280b064d30a5926ef1c4763f3097b
Change-Id: I027ce31f1b9e87c2953bfa0a9d82288d92ba11fd
Signed-off-by: Li Li <lli5@nvidia.com>
Reviewed-on: http://git-master/r/387939
Reviewed-by: Eric Miao <emiao@nvidia.com>
Reviewed-by: Peter Zu <pzu@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Diffstat (limited to 'mm')
-rw-r--r-- | mm/mmap.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/mmap.c b/mm/mmap.c index 93cbba8e0047..e0a152e2dc10 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -1878,7 +1878,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); |