Re: [PATCH] s390/mm: Skip holes in identity mapping in set_memory()
From: Alexander Gordeev
Date: Tue Dec 01 2026 - 07:41:58 EST
On Sun, Nov 29, 2026 at 05:53:27PM +0100, Heiko Carstens wrote:
> With debug_pagealloc=on, vmem_map_init() panics with "Failed to set
> kernel mapping permissions" if the identity mapping contains holes, e.g.
> standby memory. __set_memory_4k() is called for [0, ident_map_size),
> which may include holes, and change_page_attr() returns -EINVAL for the
> first empty page table entry, which was silently ignored before [1].
>
> Fix this by skipping empty entries if the range is within the identity
> mapping, similar to x86.
>
> Note: the fixes tag points to the commit which reveals this bug, but it
> exists since much longer. Nobody noticed so far, since hardly anybody
> uses debug_pagealloc, and also hardly anybody has configurations with
> holes within the identity mapping.
>
> Fixes: 4634f260683b ("s390/mm: Add error handling to vmem_map_init()") [1]
> Signed-off-by: Heiko Carstens <hca@xxxxxxxxxxxxx>
> ---
> arch/s390/mm/pageattr.c | 53 +++++++++++++++++++++++++++++++----------
> 1 file changed, 41 insertions(+), 12 deletions(-)
Reviewed-by: Alexander Gordeev <agordeev@xxxxxxxxxxxxx>