{"id":24647,"date":"2026-09-16T20:32:35","date_gmt":"2026-09-16T12:32:35","guid":{"rendered":"https:\/\/www.54iter.cn\/?vuln=cve-2026-89960"},"modified":"2026-09-16T20:32:35","modified_gmt":"2026-09-16T12:32:35","slug":"cve-2026-89960","status":"publish","type":"vuln","link":"https:\/\/www.54iter.cn\/?vuln=cve-2026-89960","title":{"rendered":"CVE-2026-89960 &#8211; In the Linux kernel, the following vulnerability has been resolved:\n\ns390\/vfio-ap: fix sta"},"content":{"rendered":"<p>In the Linux kernel, the following vulnerability has been resolved:<\/p>\n<p>s390\/vfio-ap: fix stale pqap_hook pointer on error in vfio_ap_mdev_set_kvm()<\/p>\n<p>In vfio_ap_mdev_set_kvm(), kvm-&gt;arch.crypto.pqap_hook is set to<br \/>\n&amp;matrix_mdev-&gt;pqap_hook before the update locks are acquired and the<br \/>\nmdev list is checked for a conflicting assignment. If another mdev is<br \/>\nalready attached to the same KVM instance, the function returns -EPERM<br \/>\nwithout restoring the hook pointer, leaving kvm-&gt;arch.crypto.pqap_hook<br \/>\npointing at the failing matrix_mdev instead of the mdev that legitimately<br \/>\nowns the KVM.<\/p>\n<p>Since matrix_mdev-&gt;kvm is never set on this error path,<br \/>\nvfio_ap_mdev_unset_kvm() will not clean up the hook when matrix_mdev<br \/>\nis later closed. If matrix_mdev is subsequently freed, any PQAP<br \/>\ninstruction executed by the guest will dereference the stale pointer<br \/>\nthrough pqap_hook_rwsem, resulting in a use-after-free.<\/p>\n<p>Since kvm-&gt;arch.crypto.pqap_hook is only set in the vfio_ap_mdev_set_kvm()<br \/>\nfunction and is cleared in the vfio_ap_mdev_unset_kvm() function, a check<br \/>\nfor &#8216;kvm-&gt;arch.crypto.pqap_hook != NULL&#8217; is all that is needed to determine<br \/>\nwhether it belongs to another mdev. This will alleviate the need to iterate<br \/>\nthe matrix_dev-&gt;mdev_list list to see if the kvm object is assigned to<br \/>\nanother mdev.This was introduced in v3 to alleviate the need to take the<br \/>\nmdevs_lock while iterating the list; however, this did not prevent a<br \/>\npotential race condition.<\/p>\n<p>The pqap_hook_rwsem(write) is now performed inside<br \/>\nget_update_locks_for_kvm(), which is updated to acquire<br \/>\npqap_hook_rwsem(write) between kvm-&gt;lock and mdevs_lock. This ordering<br \/>\nis consistent with the PQAP intercept path, which acquires pqap_hook_rwsem<br \/>\nin read mode while srcu is held under vcpu-&gt;mutex, establishing the<br \/>\ndependency: kvm-&gt;lock -&gt; vcpu-&gt;mutex -&gt; srcu -&gt; pqap_hook_rwsem(read).<\/p>\n<p>The pqap_hook_rwsem is now released inside the<br \/>\nrelease_update_locks_for_kvm(), which is updated to release<br \/>\npqap_hook_rwsem(write) between mdevs_lock and kvm-&gt;lock.<\/p>\n<p>Additionally, kvm_put_kvm() in vfio_ap_mdev_unset_kvm() is moved<br \/>\nafter release_update_locks_for_kvm(). Previously it was called while<br \/>\nkvm-&gt;lock was held; if it were ever the last reference, kvm_destroy_vm()<br \/>\nwould run under kvm-&gt;lock, which would deadlock.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In the Linux kernel, the following vulnerability has been resolved:<\/p>\n<p>s390\/vfio-ap: fix stale pqap_hook pointer on error in vfio_ap_mdev_set_kvm()<\/p>\n<p>In vfio_ap_mdev_set_kvm(), kvm-&gt;arch.crypto.pqap_hook<\/p>\n","protected":false},"template":"","meta":[],"categories":[],"tags":[],"class_list":["post-24647","vuln","type-vuln","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.54iter.cn\/index.php?rest_route=\/wp\/v2\/vuln\/24647","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.54iter.cn\/index.php?rest_route=\/wp\/v2\/vuln"}],"about":[{"href":"https:\/\/www.54iter.cn\/index.php?rest_route=\/wp\/v2\/types\/vuln"}],"wp:attachment":[{"href":"https:\/\/www.54iter.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=24647"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.54iter.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=24647"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.54iter.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=24647"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}