CVE-2026-139538: iommu/arm-smmu-v3: Don't rb_erase() a never-inserted stream node
In the Linux kernel, the following vulnerability has been resolved:
iommu/arm-smmu-v3: Don't rberase() a never-inserted stream node
armsmmuinsertmaster() skips inserting a stream whose StreamID duplicates one the same master already owns (bridged PCI devices can present duplicate IDs), leaving that master->streams[i].node zeroed and unlinked from the smmu->streams rb-tree.
Both the insert error-rollback loop and armsmmuremovemaster() then call rberase() on every master->streams[i].node unconditionally. rberase() on a zeroed node sees a NULL parent, treats the node as the tree root and sets root->rbnode = NULL, silently emptying the whole SID tree and breaking SID lookups (and DMA) for every other master on the SMMU.
Mark each node with RBCLEARNODE() after sortnonatomic() reorders the array, since sorting relocates the entries and would leave the earlier self-referential RBCLEARNODE() pointer stale. An un-inserted node then stays RBEMPTYNODE() and is skipped in both erase loops; inserted nodes are linked by rbfindadd() and erased as before.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Compensating control
In arm-smmu-v3, call RB_CLEAR_NODE() on each stream node after sort_nonatomic() reorders the streams array, so uninserted nodes are skipped by the erase loops.
Event History
Frequently Asked Questions
Which systems are exposed to this issue?
Systems using the Linux kernel arm-smmu-v3 driver are affected when a single master presents duplicate StreamIDs, a condition that can occur with bridged PCI devices. The issue concerns the SMMU stream-ID tree shared by masters on that SMMU.
What is the practical impact when the condition is triggered?
Cleanup of an uninserted duplicate stream node can silently clear the entire SID tree. This breaks SID lookups and DMA for every other master using the same SMMU.