{"id":40945,"date":"2026-10-19T00:31:38","date_gmt":"2026-10-18T16:31:38","guid":{"rendered":"https:\/\/www.54iter.cn\/?vuln=cve-2026-98473"},"modified":"2026-10-19T00:31:38","modified_gmt":"2026-10-18T16:31:38","slug":"cve-2026-98473","status":"publish","type":"vuln","link":"https:\/\/www.54iter.cn\/?vuln=cve-2026-98473","title":{"rendered":"CVE-2026-98473 &#8211; In the Linux kernel, the following vulnerability has been resolved:\n\ns390\/vfio-ap: fix KVM"},"content":{"rendered":"<p>In the Linux kernel, the following vulnerability has been resolved:<\/p>\n<p>s390\/vfio-ap: fix KVM GISC and page leak when queue removed from host config<\/p>\n<p>Three related problems exist in the handling of KVM interrupt and page<br \/>\nresources when a queue is removed from the host&#8217;s AP configuration<br \/>\nwhile assigned to a mediated device (mdev).<\/p>\n<p>Problem 1:<br \/>\n~~~~~~~~~<br \/>\nAP_RESPONSE_Q_NOT_AVAIL not handled in vfio_ap_mdev_reset_queue()<\/p>\n<p>When the AP bus removes a queue device whose adapter or domain has<br \/>\nbeen removed from the host&#8217;s AP configuration,<br \/>\nvfio_ap_mdev_remove_queue() is called. If the queue is still in the<br \/>\nhost&#8217;s AP configuration at that point, it calls<br \/>\nvfio_ap_mdev_reset_queue(), which issues a PQAP(ZAPQ). Since the<br \/>\nadapter is already gone from the host configuration, ap_zapq() returns<br \/>\nAP_RESPONSE_Q_NOT_AVAIL (0x01). This response code is not handled in<br \/>\nvfio_ap_mdev_reset_queue()&#8217;s switch statement and falls through to<br \/>\nthe default case, which issues a WARN but does not call<br \/>\nvfio_ap_free_aqic_resources(). As a result, if IRQ handling was<br \/>\nenabled for the queue by the guest, the KVM GISC registration and<br \/>\nthe pinned guest page holding the notification indicator byte (NIB)<br \/>\nare both leaked.<\/p>\n<p>This is fixed by adding AP_RESPONSE_Q_NOT_AVAIL to the same case as<br \/>\nAP_RESPONSE_DECONFIGURED and AP_RESPONSE_CHECKSTOPPED in<br \/>\nvfio_ap_mdev_reset_queue(). Like those response codes, Q_NOT_AVAIL<br \/>\nindicates the queue is not operational and no further reset attempts<br \/>\nare possible; the correct action is to free the IRQ resources<br \/>\nimmediately.<\/p>\n<p>Problem 2:<br \/>\n~~~~~~~~~<br \/>\n AP_RESPONSE_Q_NOT_AVAIL not handled in apq_status_check()<\/p>\n<p>In vfio_ap_mdev_reset_queue(), there are four cases that indicate a queue<br \/>\nreset has not yet completed, in which case apq_reset_check() is queued to<br \/>\na work queue to verify completion of the reset operation. This function<br \/>\nuses the PQAP(TAPQ) function to get the queue&#8217;s status and calls<br \/>\napq_status_check() to verify whether the reset has completed, failed or<br \/>\nneeds to be executed again. As described in Problem #1 above,<br \/>\napq_reset_check() does not specifically check for AP_RESPONSE_Q_NOT_AVAIL,<br \/>\nthereby potentially leaking KVM GISC registration and the pinned guest page<br \/>\nholding the NIB.<\/p>\n<p>This is fixed by adding a case statement for AP_RESPONSE_Q_NOT_AVAIL to<br \/>\napq_status_check() and returning -ENODEV for that case. The caller,<br \/>\napq_reset_check() will then check for this return code and call<br \/>\nvfio_ap_free_aqic_resources() to prevent the leak.<\/p>\n<p>Problem 3:<br \/>\n~~~~~~~~~<br \/>\nvfio_ap_free_aqic_resources() leaks saved_isc when kvm is NULL<\/p>\n<p>vfio_ap_free_aqic_resources() guards the call to<br \/>\nkvm_s390_gisc_unregister() with:<\/p>\n<p>    if (q-&gt;saved_isc != VFIO_AP_ISC_INVALID &amp;&amp;<br \/>\n        !WARN_ON(!(q-&gt;matrix_mdev &amp;&amp; q-&gt;matrix_mdev-&gt;kvm)))<\/p>\n<p>If matrix_mdev-&gt;kvm is NULL &#8212; which can happen when<br \/>\nvfio_ap_mdev_unset_kvm() has already run and cleared kvm before a<br \/>\nsubsequent cleanup path reaches this function &#8212; the WARN_ON fires<br \/>\nand the entire block is skipped. This leaves q-&gt;saved_isc set to a<br \/>\nnon-invalid value, creating a potential double-free on any subsequent<br \/>\ncall to this function.<\/p>\n<p>When kvm is NULL the KVM guest is already torn down, so<br \/>\nkvm_s390_gisc_unregister() need not and cannot be called; however,<br \/>\nq-&gt;saved_isc must always be cleared. Fix this by separating the<br \/>\nkvm_s390_gisc_unregister() call from the q-&gt;saved_isc reset. The<br \/>\nWARN_ON now guards only the genuinely impossible case of matrix_mdev<br \/>\nbeing NULL. A NULL kvm is handled gracefully by skipping only the<br \/>\nunregister call, and q-&gt;saved_isc = VFIO_AP_ISC_INVALID is set<br \/>\nunconditionally whenever saved_isc was not already invalid.<\/p>\n<p>Additionally, add an else clause to the host-config check in<br \/>\nvfio_ap_mdev_remove_queue() to call vfio_ap_free_aqic_resources()<br \/>\ndirectly when the queue is not in the host&#8217;s AP configuration. This<br \/>\nserves as a backstop: when the AP bus fires the driver .remove<br \/>\ncallback after an adapter is removed from the host config, the queue<br \/>\nis by definition no longer addressable, so vfio_ap_mdev_reset_queue<br \/>\n&#8212;truncated&#8212;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In the Linux kernel, the following vulnerability has been resolved:<\/p>\n<p>s390\/vfio-ap: fix KVM GISC and page leak when queue removed from host config<\/p>\n<p>Three related problems exist in the handling of KVM i<\/p>\n","protected":false},"template":"","meta":[],"categories":[],"tags":[],"class_list":["post-40945","vuln","type-vuln","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.54iter.cn\/index.php?rest_route=\/wp\/v2\/vuln\/40945","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=40945"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.54iter.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=40945"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.54iter.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=40945"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}