{"id":24645,"date":"2026-09-16T20:32:35","date_gmt":"2026-09-16T12:32:35","guid":{"rendered":"https:\/\/www.54iter.cn\/?vuln=cve-2026-89958"},"modified":"2026-09-16T20:32:35","modified_gmt":"2026-09-16T12:32:35","slug":"cve-2026-89958","status":"publish","type":"vuln","link":"https:\/\/www.54iter.cn\/?vuln=cve-2026-89958","title":{"rendered":"CVE-2026-89958 &#8211; In the Linux kernel, the following vulnerability has been resolved:\n\ns390\/vfio-ap: Fix der"},"content":{"rendered":"<p>In the Linux kernel, the following vulnerability has been resolved:<\/p>\n<p>s390\/vfio-ap: Fix dereference matrix_mdev-&gt;kvm without checking for NULL<\/p>\n<p>The ap_driver structure has two fields which are function pointers to<br \/>\ncallbacks:<\/p>\n<p>* .on_config_changed: called at the start of the AP bus scan function to<br \/>\n                      notify the device driver that the host AP<br \/>\n                      configuration has changed and the associated AP<br \/>\n                      devices will be added or removed accordingly. This<br \/>\n                      gives the implementor a chance to evaluate the<br \/>\n                      configuration changes and respond to them before<br \/>\n                      the associated devices are added or removed.<\/p>\n<p>* .on_scan_complete:  Called at the end of the AP bus scan function to<br \/>\n                      notify the device driver that the host AP<br \/>\n                      configuration has changed and the AP devices have<br \/>\n                      been added or removed accordingly. This gives the<br \/>\n                      implementor the opportunity to respond to the<br \/>\n                      changes after the associated devices are added or<br \/>\n                      removed.<\/p>\n<p>These two callbacks are implemented in the vfio_ap device driver via the<br \/>\nvfio_ap_on_cfg_changed and vfio_ap_on_scan_complete functions respectively.<\/p>\n<p>Within the call stack of these two callback functions the<br \/>\nmatrix_mdev-&gt;kvm-&gt;lock mutex is taken without checking whether<br \/>\nmatrix_mdev-&gt;kvm is NULL or not. If matrix_mdev-&gt;kvm has never been set,<br \/>\ntrying to take the lock will trigger a NULL pointer dereference. This patch<br \/>\nadds checks for matrix_mdev-&gt;kvm == NULL before taking the<br \/>\nmatrix_mdev-&gt;kvm-&gt;lock mutex.<\/p>\n<p>Note that the matrix_mdev-&gt;kvm-&gt;lock mutex taken in the<br \/>\nvfio_ap_mdev_hot_plug_config function is moved to the calling function<br \/>\nalong with the matrix_dev-&gt;mdevs_lock which is needed there to access<br \/>\nthe fields of the matrix_mdev. It makes little sense to make the change<br \/>\nthe check for matrix_mdev-&gt;kvm there before taking the kvm-&gt;lock<br \/>\nmutex only to have to move it out via another patch, so it is done in<br \/>\nthis patch.<\/p>\n<p>It is important to make note of the following:<br \/>\n1. The matrix_dev-&gt;guests_lock is acquired at the start of both callback<br \/>\n   functions. This ensures that matrix_mdev will not be removed via the<br \/>\n   vfio_ap_mdev_remove function because it too takes matrix_dev_guests_lock<br \/>\n   before removing the object; so, matrix_mdev will be available for the<br \/>\n   duration of the callback functions.<\/p>\n<p>2. The matrix_dev-&gt;mdevs_lock mutex must be taken in order to access<br \/>\n   fields within the matrix_mdev structure<\/p>\n<p>3. matrix_mdev-&gt;kvm-&gt;lock mutex must be taken before the<br \/>\n   matrix_dev-&gt;mdevs_lock to prevent a lockdep splat.<\/p>\n<p>4: The kvm-&gt;lock must be held while plugging the guest&#8217;s AP configuration<br \/>\n   into its SIE state description via the vfio_ap_mdev_update_guest_apcb<br \/>\n   function.<\/p>\n<p>5. The vfio_ap_mdev_update_guest_apcb checks matrix_mdev-&gt;kvm to verify it<br \/>\n   is not NULL before doing the hot plug of the guest&#8217;s AP configuration.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In the Linux kernel, the following vulnerability has been resolved:<\/p>\n<p>s390\/vfio-ap: Fix dereference matrix_mdev-&gt;kvm without checking for NULL<\/p>\n<p>The ap_driver structure has two fields which are function<\/p>\n","protected":false},"template":"","meta":[],"categories":[],"tags":[],"class_list":["post-24645","vuln","type-vuln","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.54iter.cn\/index.php?rest_route=\/wp\/v2\/vuln\/24645","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=24645"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.54iter.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=24645"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.54iter.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=24645"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}