{"id":"CVE-2026-89958","title":"In the Linux kernel, the following vulnerability has been resolved:\n\ns390/vfio-ap: Fix dereference matrix_mdev->kvm without checking for NULL\n\nThe ap_driver structure has two fields which are function pointers to\ncallbacks:\n\n* .on_config…","summary":"In the Linux kernel, the following vulnerability has been resolved:\n\ns390/vfio-ap: Fix dereference matrix_mdev->kvm without checking for NULL\n\nThe ap_driver structure has two fields which are function pointers to\ncallbacks:\n\n* .on_config…","severity":"none","vendor":"Linux","product":"Linux","affected":["Linux >= eeb386aeb5b7c8d2dae6a3ba49255d8a97803182 < 5e932abfcce6189d067fffb0eb8214443bc04374","Linux >= eeb386aeb5b7c8d2dae6a3ba49255d8a97803182 < 334b435b951353f934d5110c4630e0cb58d2f9a7","Linux >= eeb386aeb5b7c8d2dae6a3ba49255d8a97803182 < 178ea7a1c2c3c0c01d14b8f60aa35f1e0cdc6b78","Linux >= eeb386aeb5b7c8d2dae6a3ba49255d8a97803182 < 4f7e869d0db24ae07b4c888fd3bc21554eef775d","Linux >= eeb386aeb5b7c8d2dae6a3ba49255d8a97803182 < d50346801b4f144e42b49cd4f1496010498ab114","Linux 6.0"],"published":"2026-09-16","updated":"2026-09-16","sourceUpdated":"2026-09-16T11:17:06.177","source":"NVD","sourceUrl":"https://nvd.nist.gov/vuln/detail/CVE-2026-89958","references":[{"url":"https://git.kernel.org/stable/c/178ea7a1c2c3c0c01d14b8f60aa35f1e0cdc6b78","label":"416baaa9-dc9f-4396-8d5f-8c081fb06d67"},{"url":"https://git.kernel.org/stable/c/334b435b951353f934d5110c4630e0cb58d2f9a7","label":"416baaa9-dc9f-4396-8d5f-8c081fb06d67"},{"url":"https://git.kernel.org/stable/c/4f7e869d0db24ae07b4c888fd3bc21554eef775d","label":"416baaa9-dc9f-4396-8d5f-8c081fb06d67"},{"url":"https://git.kernel.org/stable/c/5e932abfcce6189d067fffb0eb8214443bc04374","label":"416baaa9-dc9f-4396-8d5f-8c081fb06d67"},{"url":"https://git.kernel.org/stable/c/d50346801b4f144e42b49cd4f1496010498ab114","label":"416baaa9-dc9f-4396-8d5f-8c081fb06d67"}],"tags":["nvd","cve.org"],"ingestedAt":"2026-09-16T10:53:53.960Z","epss":0.002,"epssPercentile":0.10123,"slug":"CVE-2026-89958","body":"## Overview\n\nIn the Linux kernel, the following vulnerability has been resolved:\n\ns390/vfio-ap: Fix dereference matrix_mdev->kvm without checking for NULL\n\nThe ap_driver structure has two fields which are function pointers to\ncallbacks:\n\n* .on_config_changed: called at the start of the AP bus scan function to\n                      notify the device driver that the host AP\n                      configuration has changed and the associated AP\n                      devices will be added or removed accordingly. This\n                      gives the implementor a chance to evaluate the\n                      configuration changes and respond to them before\n                      the associated devices are added or removed.\n\n* .on_scan_complete:  Called at the end of the AP bus scan function to\n                      notify the device driver that the host AP\n                      configuration has changed and the AP devices have\n                      been added or removed accordingly. This gives the\n                      implementor the opportunity to respond to the\n                      changes after the associated devices are added or\n                      removed.\n\nThese two callbacks are implemented in the vfio_ap device driver via the\nvfio_ap_on_cfg_changed and vfio_ap_on_scan_complete functions respectively.\n\nWithin the call stack of these two callback functions the\nmatrix_mdev->kvm->lock mutex is taken without checking whether\nmatrix_mdev->kvm is NULL or not. If matrix_mdev->kvm has never been set,\ntrying to take the lock will trigger a NULL pointer dereference. This patch\nadds checks for matrix_mdev->kvm == NULL before taking the\nmatrix_mdev->kvm->lock mutex.\n\nNote that the matrix_mdev->kvm->lock mutex taken in the\nvfio_ap_mdev_hot_plug_config function is moved to the calling function\nalong with the matrix_dev->mdevs_lock which is needed there to access\nthe fields of the matrix_mdev. It makes little sense to make the change\nthe check for matrix_mdev->kvm there before taking the kvm->lock\nmutex only to have to move it out via another patch, so it is done in\nthis patch.\n\nIt is important to make note of the following:\n1. The matrix_dev->guests_lock is acquired at the start of both callback\n   functions. This ensures that matrix_mdev will not be removed via the\n   vfio_ap_mdev_remove function because it too takes matrix_dev_guests_lock\n   before removing the object; so, matrix_mdev will be available for the\n   duration of the callback functions.\n\n2. The matrix_dev->mdevs_lock mutex must be taken in order to access\n   fields within the matrix_mdev structure\n\n3. matrix_mdev->kvm->lock mutex must be taken before the\n   matrix_dev->mdevs_lock to prevent a lockdep splat.\n\n4: The kvm->lock must be held while plugging the guest's AP configuration\n   into its SIE state description via the vfio_ap_mdev_update_guest_apcb\n   function.\n\n5. The vfio_ap_mdev_update_guest_apcb checks matrix_mdev->kvm to verify it\n   is not NULL before doing the hot plug of the guest's AP configuration.\n\n## Remediation\n\nRefer to the linked advisories for vendor-supplied fixes and affected version ranges.","depth":"sunlit","depthScore":3,"depthScoreParts":{"impact":2.8,"likelihood":0,"exploitation":0,"ransomware":0},"changes":[]}