diff options
author | Helge Deller <deller@gmx.de> | 2023-08-19 00:53:28 +0200 |
---|---|---|
committer | Helge Deller <deller@gmx.de> | 2023-08-22 10:24:46 +0200 |
commit | 3033cd4307681c60db6d08f398a64484b36e0b0f (patch) | |
tree | 41a33f799e22aef056f347b382a1630a268bfe6e /mm/util.c | |
parent | parisc: Fix /proc/cpuinfo output for lscpu (diff) | |
download | linux-3033cd4307681c60db6d08f398a64484b36e0b0f.tar.xz linux-3033cd4307681c60db6d08f398a64484b36e0b0f.zip |
parisc: Use generic mmap top-down layout and brk randomization
parisc uses a top-down layout by default that exactly fits the generic
functions, so get rid of arch specific code and use the generic version
by selecting ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT.
Note that on parisc the stack always grows up and a "unlimited stack"
simply means that the value as defined in CONFIG_STACK_MAX_DEFAULT_SIZE_MB
should be used. So RLIM_INFINITY is not an indicator to use the legacy
memory layout.
Signed-off-by: Helge Deller <deller@gmx.de>
Diffstat (limited to 'mm/util.c')
-rw-r--r-- | mm/util.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/mm/util.c b/mm/util.c index dd12b9531ac4..881020644497 100644 --- a/mm/util.c +++ b/mm/util.c @@ -396,7 +396,10 @@ static int mmap_is_legacy(struct rlimit *rlim_stack) if (current->personality & ADDR_COMPAT_LAYOUT) return 1; - if (rlim_stack->rlim_cur == RLIM_INFINITY) + /* On parisc the stack always grows up - so a unlimited stack should + * not be an indicator to use the legacy memory layout. */ + if (rlim_stack->rlim_cur == RLIM_INFINITY && + !IS_ENABLED(CONFIG_STACK_GROWSUP)) return 1; return sysctl_legacy_va_layout; |