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: e38c884df9 ("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>
This commit is contained in:
Claudio Imbrenda 2026-02-06 15:35:52 +01:00
parent 898885477e
commit b6ab71a27c

View File

@ -1287,7 +1287,10 @@ static int walk_guest_tables(struct gmap *sg, unsigned long saddr, struct pgtwal
union asce asce;
int rc;
if (!parent)
return -EAGAIN;
kvm = parent->kvm;
WARN_ON(!kvm);
asce = sg->guest_asce;
entries = get_entries(w);