linux-stable/arch/s390/mm
Christian Borntraeger 28bb27824f KVM: s390: vsie: fix race during shadow creation
commit fe752331d4 upstream.

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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-02-23 09:51:53 +01:00
..
cmm.c S390: Remove now superfluous sentinel elem from ctl_table arrays 2023-10-10 15:22:02 -07:00
dump_pagetables.c s390/ctlreg: add struct ctlreg 2023-09-19 13:26:56 +02:00
extable.c s390: add support for DCACHE_WORD_ACCESS 2023-10-16 13:04:09 +02:00
extmem.c s390/extmem: improve reporting of -ERANGE error 2023-07-24 12:12:24 +02:00
fault.c arch/mm/fault: fix major fault accounting when retrying under per-VMA lock 2023-12-29 11:06:49 -08:00
gmap.c KVM: s390: vsie: fix race during shadow creation 2024-02-23 09:51:53 +01:00
hugetlbpage.c mm: hugetlb: add huge page size param to set_huge_pte_at() 2023-09-29 17:20:47 -07:00
init.c s390/cmma: rework no-dat handling 2023-11-05 22:34:58 +01:00
maccess.c s390/ctlreg: rename ctl_reg.h to ctlreg.h 2023-09-19 13:26:56 +02:00
Makefile s390/mm: move pfault code to own C file 2023-07-29 14:57:18 +02:00
mmap.c mm: move 'mmap_min_addr' logic from callers into vm_unmapped_area() 2023-04-21 14:52:05 -07:00
page-states.c s390/cmma: rework no-dat handling 2023-11-05 22:34:58 +01:00
pageattr.c s390/ctlreg: add struct ctlreg 2023-09-19 13:26:56 +02:00
pfault.c s390/pfault: use consistent comment style 2023-07-29 14:57:18 +02:00
pgalloc.c s390/mm: make pte_free_tlb() similar to pXd_free_tlb() 2023-11-05 22:34:58 +01:00
pgtable.c KVM: s390/mm: Properly reset no-dat 2023-11-14 18:56:46 +01:00
vmem.c s390/cmma: rework no-dat handling 2023-11-05 22:34:58 +01:00