CVE-2026-139403: hisi_acc_vfio_pci: fix NULL dereference in reset_prepare on PF passthrough
In the Linux kernel, the following vulnerability has been resolved:
hisiaccvfiopci: fix NULL dereference in resetprepare on PF passthrough
When a PF is bound to the driver via driveroverride and passed through to a VM, its pfqm stays NULL. The PCI error handler resetprepare() runs during opendevice through pcitryresetfunction(), before the migops gate, and dereferences the NULL pfqm for the timeout log, crashing the kernel.
Move the migops check to the entry of resetprepare() and aerresetdone() so non-migration devices skip the QMRESETTING coordination. The dev local resolved &qm->pdev->dev before the gate, so open code it at the deverr() call where qm is known valid. Also clear setresetflag together with QMRESETTING in aerresetdone(); the flag was never cleared before, so a later timed-out reset could release a foreign lock.
Affected Software
Event History
Frequently Asked Questions
Which systems are exposed to the NULL dereference?
Systems are exposed when a HiSilicon accelerator PF is bound through driver_override and passed through to a VM, leaving its pf_qm NULL. The crash occurs when open_device triggers pci_try_reset_function() and invokes reset_prepare().
Does this affect devices that do not support migration?
The vulnerable reset path incorrectly performed QM_RESETTING coordination before checking mig_ops. The fix makes reset_prepare() and aer_reset_done() skip that coordination for non-migration devices.
What is the practical impact if the issue is triggered?
The kernel can crash due to a NULL pf_qm dereference during the PCI error handler's reset_prepare() path. A separate reset-state flaw could also allow a later timed-out reset to release a foreign lock because set_reset_flag was not cleared.
How can administrators identify a potentially affected configuration?
Check for HiSilicon accelerator PFs that are bound using driver_override and assigned directly to virtual machines. Such PF passthrough configurations can enter the affected reset path during device open/reset operations.