iommufd: Fix UAF in selftest IOPF reporting
- Published
- Last modified
- Where the record stands: published, rejected by its publisher, or superseded by another id.What do these mean? →
- published
- Whether CISA lists it in its Known Exploited Vulnerabilities catalog: proof that attackers are using it.What do these mean? →
- Not listed in CISA KEV
- Fix
- Fixed in 6.12.112, 6.18.50, 7.2.4
- Whether working attack code is public (Exploit-DB, Metasploit, Nuclei or GitHub). Public code makes attacks easier.What do these mean? →
- None on Exploit-DB, Metasploit or GitHub
Summary
In the Linux kernel, the following vulnerability has been resolved: iommufd: Fix UAF in selftest IOPF reporting IOMMUFD selftest TRIGGER_IOPF borrows an attach handle from group->pasid_array without synchronizing against PASID detach, then a concurrent iommu_report_device_fault() can dereference that borrowed handle's domain pointer after the detach erases the handle and frees the backing struct iommufd_attach_handle. TRIGGER_IOPF then dereferences the freed handle, causing a UAF. Fix by adding a iopf_rwsem in mock_dev to follow the expected design of a real driver. Hold its read side across the whole iommu_report_device_fault() call, and its write side around every path that attaches, detaches, or replaces a device domain. This can block new reports and drains in-flight reports before an old attach handle or the IOPF fault parameter can be removed. Also take the write side while registering a mock device, since it can invoke the mock driver's default-domain attach callback.
Timeline
- CVE published
- Record last updated
Affected versions
- Linux Linux
From ddee19971081b42615d62f4fdada21274708ed4d · fixed in fd2e7ac94d6d813548b021473c3dddc30c8c07d1; From ddee19971081b42615d62f4fdada21274708ed4d · fixed in cab2895729516799384d48560e6fca105fb3f927; From ddee19971081b42615d62f4fdada21274708ed4d · fixed in e27e90bde68b2ab92e63ed19caad1ef57188bea0; From ddee19971081b42615d62f4fdada21274708ed4d · fixed in 8c07df7cdfcf52f1ff276c588612aabc6c6b8399
- Linux Linux
6.11
- KernelLinux
From 6.11.0 · fixed in 6.12.112; From 6.13.0 · fixed in 6.18.50; From 6.19.0 · fixed in 7.2.4