Re: [PATCH] s390/kdump: write protect the crash kernel memory by its virtual address
From: Heiko Carstens
Date: Tue Nov 17 2026 - 10:31:52 EST
On Tue, Nov 17, 2026 at 04:01:04PM +0200, Mike Rapoport (Microsoft) wrote:
> crash_protect_pages() passes crashk_res.start to set_memory_ro() and
> set_memory_rw(). That is a physical address. Since the identity mapping
> may start above zero, it is not the address of the crash kernel memory
> in the kernel page tables.
>
> With CONFIG_RANDOMIZE_IDENTITY_BASE the page table walk finds no mapping
> at that address and fails. The error is ignored, and the crash kernel
> memory stays writable after "kexec -p" loads it.
>
> Use the identity mapping address of the crash kernel memory.
>
> Fixes: c98d2ecae08f ("s390/mm: Uncouple physical vs virtual address spaces")
> Signed-off-by: Mike Rapoport (Microsoft) <rppt@xxxxxxxxxx>
> ---
> I found this while working on a generic implementation of the set_memory
> APIs. Only build tested.
> ---
> arch/s390/kernel/machine_kexec.c | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
Reviewed-by: Heiko Carstens <hca@xxxxxxxxxxxxx>