iommu/arm-smmu-v3: Manage teardown with devm
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 395ad89d11fd93f79a6b942e91fc409807a63c4b · < 2bd22a0d40503a65d243b011de146603c8ce1cbc| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
iommu/arm-smmu-v3: Manage teardown with devm
arm_smmu_device_remove() manually frees the IOPF queue, destroys the vmid_map and disables the device, while the IRQs and queues are devm managed. devm unwinds only after remove() returns, so the cleanup runs in the wrong order. The IOPF queue is freed before the event-queue IRQ whose handler uses it.
Manage all of it with devm so the unwind order is correct. Free the IOPF queue and vmid_map via devm actions, and disable the device from one registered after arm_smmu_device_reset().
This is also a prerequisite for fixing a Tegra241 CMDQV CMD_SYNC use-after-free in the subsequent patch.
From the CVE record · Linux
The Linux kernel’s arm-smmu-v3 driver frees the IOPF queue before its event-queue IRQ handler is removed. During device teardown, the handler may access the freed queue. The input does not specify attacker access, authentication requirements, or user interaction.
Engineers running Linux kernels with the arm-smmu-v3 driver should check their kernel; affected versions are not specified.