]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
KVM: s390: vsie: Fix race in acquire_gmap_shadow()
authorClaudio Imbrenda <imbrenda@linux.ibm.com>
Fri, 6 Feb 2026 14:35:53 +0000 (15:35 +0100)
committerClaudio Imbrenda <imbrenda@linux.ibm.com>
Tue, 10 Feb 2026 10:33:34 +0000 (11:33 +0100)
commitf8f296ea1c61ce98a03dd9ede370adb864c4cde3
tree5c8ecce558f6b6047853cf7f0113184b9caa2833
parentb6ab71a27c50942cfc10d12ca3f3c0cfb1634d19
KVM: s390: vsie: Fix race in acquire_gmap_shadow()

The shadow gmap returned by gmap_create_shadow() could get dropped
before taking the gmap->children_lock. This meant that the shadow gmap
was sometimes being used while its reference count was 0.

Fix this by taking the additional reference inside gmap_create_shadow()
while still holding gmap->children_lock, instead of afterwards.

Fixes: e38c884df921 ("KVM: s390: Switch to new gmap")
Reviewed-by: Christoph Schlameuss <schlameuss@linux.ibm.com>
Signed-off-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
arch/s390/kvm/gmap.c
arch/s390/kvm/vsie.c