Commit b96a53cc authored by Helge Deller's avatar Helge Deller Committed by Zheng Zengkai
Browse files

parisc: fix mmap_base calculation when stack grows upwards

stable inclusion
from stable-v6.6.3
commit 2345ef960d6663c9b52f8f73fb5ca05732c56144
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I8LBQP

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=2345ef960d6663c9b52f8f73fb5ca05732c56144

--------------------------------

commit 5f74f820f6fc844b95f9e5e406e0a07d97510420 upstream.

Matoro reported various userspace crashes on the parisc platform with kernel
6.6 and bisected it to commit 3033cd43 ("parisc: Use generic mmap top-down
layout and brk randomization").

That commit switched parisc to use the common infrastructure to calculate
mmap_base, but missed that the mmap_base() function takes care for
architectures where the stack grows downwards only.

Fix the mmap_base() calculation to include the stack-grows-upwards case
and thus fix the userspace crashes on parisc.

Link: https://lkml.kernel.org/r/ZVH2qeS1bG7/1J/l@p100


Fixes: 3033cd43 ("parisc: Use generic mmap top-down layout and brk randomization")
Signed-off-by: default avatarHelge Deller <deller@gmx.de>
Reported-by: default avatarmatoro <matoro_mailinglist_kernel@matoro.tk>
Tested-by: default avatarmatoro <matoro_mailinglist_kernel@matoro.tk>
Cc: <stable@vger.kernel.org>	[6.6+]
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
parent e0da1b10
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment