[PATCH 01/17] s390/boot: Initialize asce_limit for init_mm properly

From: Heiko Carstens

Date: Thu Dec 03 2026 - 05:33:58 EST


asce_limit of init_mm is always zero instead of reflecting the
address space size.

The mm_pxd_folded() helpers used in pxd_free() require a proper
asce_limit to work correctly. With asce_limit of init_mm being
zero the pxd_free() functions never free page tables, since
mm_pxd_folded(&init_mm) evaluates to true.

As of now there are only a few corner cases where this matters,
e.g. during concurrent vmalloc allocation races or KASAN shadow
unmapping, leading to memory leaks.

Fix this and initialize asce_limit of init_mm.

Fixes: 2416cefc504b ("s390/mm: add mm_pxd_folded() checks to pxd_free()")
Signed-off-by: Heiko Carstens <hca@xxxxxxxxxxxxx>
---
arch/s390/boot/vmem.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/arch/s390/boot/vmem.c b/arch/s390/boot/vmem.c
index ff6d58a476ba..3111a96e68e9 100644
--- a/arch/s390/boot/vmem.c
+++ b/arch/s390/boot/vmem.c
@@ -554,5 +554,6 @@ void setup_vmem(unsigned long kernel_start, unsigned long kernel_end, unsigned l
local_ctl_load(13, &get_lowcore()->kernel_asce);

init_mm.context.asce = get_lowcore()->kernel_asce.val;
+ init_mm.context.asce_limit = asce_limit;
init_mm.pgd = init_mm_pgd;
}
--
2.53.0