From: Heiko Carstens Date: Mon, 11 May 2026 10:52:39 +0000 (+0200) Subject: s390/mm: Map empty zero pages read-only X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=29f23176e79a52ce4aa09cf1101bc0427aa0e075;p=thirdparty%2Fkernel%2Flinux.git s390/mm: Map empty zero pages read-only On arm64 the empty zero page is going to be mapped read-only [1]. Do the same for s390 with an explicit set_memory_ro() call. [1] https://lore.kernel.org/all/20260427153416.2103979-19-ardb+git@google.com/ Suggested-by: Christian Borntraeger Acked-by: Alexander Gordeev Signed-off-by: Heiko Carstens Signed-off-by: Alexander Gordeev --- diff --git a/arch/s390/mm/init.c b/arch/s390/mm/init.c index 1f72efc2a579f..36bd9530db528 100644 --- a/arch/s390/mm/init.c +++ b/arch/s390/mm/init.c @@ -84,6 +84,8 @@ void __init arch_setup_zero_pages(void) empty_zero_page = (unsigned long)memblock_alloc_or_panic(PAGE_SIZE << order, PAGE_SIZE); zero_page_mask = ((PAGE_SIZE << order) - 1) & PAGE_MASK; + + set_memory_ro(empty_zero_page, 1UL << order); } void __init arch_zone_limits_init(unsigned long *max_zone_pfns)