linux/arch/s390
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
..
appldata s390: Explicitly include <linux/export.h> 2025-06-17 18:18:02 +02:00
boot s390 updates for 6.18 merge window 2025-09-29 19:14:25 -07:00
configs s390: Update defconfigs 2025-10-24 15:25:43 +02:00
crypto crypto: s390/phmac - Do not modify the req->nbytes value 2025-10-23 12:53:23 +08:00
hypfs more s390 updates for 6.18 merge window 2025-10-09 10:51:43 -07:00
include s390/ipl: Clear SBP flag when bootprog is set 2026-01-02 12:57:25 +01:00
kernel s390/ipl: Clear SBP flag when bootprog is set 2026-01-02 12:57:25 +01:00
kvm more s390 updates for 6.18 merge window 2025-10-09 10:51:43 -07:00
lib s390: Remove superfluous newlines from inline assemblies 2025-09-29 13:52:08 +02:00
mm KVM: s390: Fix gmap_helper_zap_one_page() again 2026-01-08 10:16:41 +01:00
net bpf, x86: Add support for signed arena loads 2025-09-23 12:00:22 -07:00
pci s390/pci: Restore IRQ unconditionally for the zPCI device 2025-10-24 15:25:43 +02:00
purgatory lib/crypto: sha256: Make library API use strongly-typed contexts 2025-07-04 10:18:53 -07:00
tools s390: Allow to compile with z17 optimizations 2025-04-09 12:12:41 +02:00
Kbuild - An extensive rework of kexec and crash Kconfig from Eric DeVolder 2023-08-29 14:53:51 -07:00
Kconfig s390: Disable ARCH_WANT_OPTIMIZE_HUGETLB_VMEMMAP 2025-10-30 16:59:28 +01:00
Kconfig.debug s390/mm: Add configurable STRICT_MM_TYPECHECKS 2025-03-11 15:27:34 +01:00
Makefile s390: Add -Wno-pointer-sign to KBUILD_CFLAGS_DECOMPRESSOR 2025-09-29 13:52:08 +02:00
Makefile.postlink kbuild: Create intermediate vmlinux build with relocations preserved 2025-03-17 00:29:50 +09:00