linux-stable/arch/s390
Christian Borntraeger f5572c0323 KVM: s390: vsie: fix race during shadow creation
[ Upstream commit fe752331d4 ]

Right now it is possible to see gmap->private being zero in
kvm_s390_vsie_gmap_notifier resulting in a crash.  This is due to the
fact that we add gmap->private == kvm after creation:

static int acquire_gmap_shadow(struct kvm_vcpu *vcpu,
                               struct vsie_page *vsie_page)
{
[...]
        gmap = gmap_shadow(vcpu->arch.gmap, asce, edat);
        if (IS_ERR(gmap))
                return PTR_ERR(gmap);
        gmap->private = vcpu->kvm;

Let children inherit the private field of the parent.

Reported-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Fixes: a3508fbe9d ("KVM: s390: vsie: initial support for nested virtualization")
Cc: <stable@vger.kernel.org>
Cc: David Hildenbrand <david@redhat.com>
Reviewed-by: Janosch Frank <frankja@linux.ibm.com>
Reviewed-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@linux.ibm.com>
Link: https://lore.kernel.org/r/20231220125317.4258-1-borntraeger@linux.ibm.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-03-15 10:48:21 -04:00
..
appldata sysctl: Add size to register_sysctl 2023-08-15 15:26:17 -07:00
boot s390/boot: always align vmalloc area on segment boundary 2024-02-05 20:14:16 +00:00
configs cred: get rid of CONFIG_DEBUG_CREDENTIALS 2023-12-20 17:01:51 +01:00
crypto crypto: s390/aes - Fix buffer overread in CTR mode 2024-01-31 16:18:50 -08:00
hypfs s390 updates for 6.6 merge window 2023-08-28 17:22:39 -07:00
include KVM: s390: add stat counter for shadow gmap events 2024-03-15 10:48:21 -04:00
kernel s390/ptrace: handle setting of fpc register correctly 2024-02-05 20:14:17 +00:00
kvm KVM: s390: vsie: fix race during shadow creation 2024-03-15 10:48:21 -04:00
lib s390: replace #include <asm/export.h> with #include <linux/export.h> 2023-08-09 15:20:50 +02:00
mm KVM: s390: vsie: fix race during shadow creation 2024-03-15 10:48:21 -04:00
net s390/bpf: Fix unwinding past the trampoline 2023-10-11 00:08:46 +02:00
pci s390: use the correct count for __iowrite64_copy() 2024-03-01 13:35:08 +01:00
purgatory s390 updates for 6.5 merge window part 2 2023-07-06 13:18:30 -07:00
tools KVM: s390: Add facility 197 to the allow list 2022-07-13 15:25:25 +02:00
Kbuild - An extensive rework of kexec and crash Kconfig from Eric DeVolder 2023-08-29 14:53:51 -07:00
Kconfig kexec: fix KEXEC_FILE dependencies 2024-01-05 15:19:41 +01:00
Kconfig.debug s390/Kconfig.debug: fix indentation 2022-06-01 12:03:15 +02:00
Makefile s390: use obj-y to descend into drivers/s390/ 2023-07-24 12:12:25 +02:00