linux/arch/s390/mm
Claudio Imbrenda 2af2abbcbf KVM: s390: Fix gmap_helper_zap_one_page() again
[ Upstream commit 2f393c228c ]

A few checks were missing in gmap_helper_zap_one_page(), which can lead
to memory corruption in the guest under specific circumstances.

Add the missing checks.

Fixes: 5deafa27d9 ("KVM: s390: Fix to clear PTE when discarding a swapped page")
Cc: stable@vger.kernel.org
Reported-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Tested-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Acked-by: Christian Borntraeger <borntraeger@linux.ibm.com>
Signed-off-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
[ adapted ptep_zap_softleaf_entry() and softleaf_from_pte() calls to ptep_zap_swap_entry() and pte_to_swp_entry() ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
History 2026-01-08 10:16:41 +01:00
..
cmm.c treewide: Switch/rename to timer_delete[_sync]() 2025-04-05 10:30:12 +02:00
dump_pagetables.c s390/mm: Fix memory leak in add_marker() when kvrealloc() fails 2025-10-29 14:17:50 +01:00
extable.c s390/uaccess: Shorten raw_copy_from_user() / raw_copy_to_user() inline assemblies 2025-03-04 17:18:03 +01:00
extmem.c s390/extmem: Add workaround for DCSS unload diag 2025-05-17 10:55:00 +02:00
fault.c more s390 updates for 6.16 merge window 2025-06-06 18:02:37 -07:00
gmap.c mm: introduce memdesc_flags_t 2025-09-13 16:55:07 -07:00
gmap_helpers.c KVM: s390: Fix gmap_helper_zap_one_page() again 2026-01-08 10:16:41 +01:00
hugetlbpage.c mm: introduce memdesc_flags_t 2025-09-13 16:55:07 -07:00
init.c s390: Handle KCOV __init vs inline mismatches 2025-07-21 21:44:01 -07:00
maccess.c s390: Remove superfluous newlines from inline assemblies 2025-09-29 13:52:08 +02:00
Makefile KVM: s390: Refactor and split some gmap helpers 2025-05-28 17:48:04 +02:00
mmap.c mm: constify arch_pick_mmap_layout() for improved const-correctness 2025-09-21 14:22:14 -07:00
page-states.c s390/cmma: rework no-dat handling 2023-11-05 22:34:58 +01:00
pageattr.c s390/cpufeature: Convert MACHINE_HAS_IDTE to cpu_has_idte() 2025-03-04 17:18:05 +01:00
pfault.c s390/asm-offsets: Remove ASM_OFFSETS_C 2025-03-31 12:20:39 +02:00
pgalloc.c more s390 updates for 6.18 merge window 2025-10-09 10:51:43 -07:00
pgtable.c s390/mm: Fix __ptep_rdp() inline assembly 2025-11-14 15:58:20 +01:00
physaddr.c s390/mm: provide simple ARCH_HAS_DEBUG_VIRTUAL support 2024-03-13 09:23:49 +01:00
vmem.c s390/mm: Allocate page table with PAGE_SIZE granularity 2025-08-05 14:23:20 +02:00