From 3033cd4307681c60db6d08f398a64484b36e0b0f Mon Sep 17 00:00:00 2001 From: Helge Deller Date: Sat, 19 Aug 2023 00:53:28 +0200 Subject: 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 --- mm/util.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'mm/util.c') 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; -- cgit