Skip to content

Commit b6ab71a

Browse files
author
Claudio Imbrenda
committed
KVM: s390: vsie: Fix race in walk_guest_tables()
It is possible that walk_guest_tables() is called on a shadow gmap that has been removed already, in which case its parent will be NULL. In such case, return -EAGAIN and let the callers deal with it. Fixes: e38c884 ("KVM: s390: Switch to new gmap") Acked-by: Janosch Frank <frankja@linux.ibm.com> Reviewed-by: Christoph Schlameuss <schlameuss@linux.ibm.com> Signed-off-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
1 parent 8988854 commit b6ab71a

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

arch/s390/kvm/gaccess.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1287,7 +1287,10 @@ static int walk_guest_tables(struct gmap *sg, unsigned long saddr, struct pgtwal
12871287
union asce asce;
12881288
int rc;
12891289

1290+
if (!parent)
1291+
return -EAGAIN;
12901292
kvm = parent->kvm;
1293+
WARN_ON(!kvm);
12911294
asce = sg->guest_asce;
12921295
entries = get_entries(w);
12931296

0 commit comments

Comments
 (0)