linux-stable/arch/s390/mm
Linus Torvalds 5f50096f0a mm: always expand the stack with the mmap write lock held
commit 8d7071af89 upstream.

This finishes the job of always holding the mmap write lock when
extending the user stack vma, and removes the 'write_locked' argument
from the vm helper functions again.

For some cases, we just avoid expanding the stack at all: drivers and
page pinning really shouldn't be extending any stacks.  Let's see if any
strange users really wanted that.

It's worth noting that architectures that weren't converted to the new
lock_mm_and_find_vma() helper function are left using the legacy
"expand_stack()" function, but it has been changed to drop the mmap_lock
and take it for writing while expanding the vma.  This makes it fairly
straightforward to convert the remaining architectures.

As a result of dropping and re-taking the lock, the calling conventions
for this function have also changed, since the old vma may no longer be
valid.  So it will now return the new vma if successful, and NULL - and
the lock dropped - if the area could not be extended.

Tested-by: Vegard Nossum <vegard.nossum@oracle.com>
Tested-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de> # ia64
Tested-by: Frank Scheiner <frank.scheiner@web.de> # ia64
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-07-01 13:14:46 +02:00
..
cmm.c s390/cmm: add missing virt_to_phys() conversion 2021-12-10 16:14:25 +01:00
dump_pagetables.c s390/mm,ptdump: avoid Kasan vs Memcpy Real markers swapping 2023-01-31 18:56:36 +01:00
extable.c s390/extable: add EX_TABLE_UA_LOAD_REGPAIR() macro 2022-11-21 13:36:15 +01:00
extmem.c s390/extmem: return correct segment type in __segment_load() 2023-03-01 20:01:34 +01:00
fault.c mm: always expand the stack with the mmap write lock held 2023-07-01 13:14:46 +02:00
gmap.c KVM: s390: pv: fix asynchronous teardown for small VMs 2023-05-17 14:01:46 +02:00
hugetlbpage.c s390/hugetlb: switch to generic version of follow_huge_pud() 2022-09-11 20:26:01 -07:00
init.c s390/mm: start kernel with DAT enabled 2023-01-13 14:15:05 +01:00
kasan_init.c s390/mem_detect: do not truncate online memory ranges info 2023-02-14 11:45:40 +01:00
maccess.c s390/mm: allocate Absolute Lowcore Area in decompressor 2023-01-13 14:15:06 +01:00
Makefile s390/extable: move extable related functions to mm/extable.c 2022-03-08 00:33:00 +01:00
mmap.c treewide: use get_random_u32() when possible 2022-10-11 17:42:58 -06:00
page-states.c s390/mm: remove unused get_page_state() function 2022-11-23 16:24:07 +01:00
pageattr.c s390/mm: fix direct map accounting 2023-05-17 14:02:08 +02:00
pgalloc.c s390/mm: use CRST_ALLOC_ORDER instead of number 2022-02-09 22:56:04 +01:00
pgtable.c s390/mm: add support for RDP (Reset DAT-Protection) 2023-02-14 11:45:39 +01:00
vmem.c s390/vmem: remove unnecessary KASAN checks 2023-02-06 11:13:53 +01:00