diff options
| author | Nicolin Chen <nicolinc@nvidia.com> | 2026-09-23 13:11:25 -0700 |
|---|---|---|
| committer | Will Deacon <will@kernel.org> | 2026-10-04 16:05:02 +0000 |
| commit | 2888520bdcbe0599cfc77b2fad8dc6c95505a3cb (patch) | |
| tree | c5b077e7fe33664f0147995f02fc31c0bffc4c2c /scripts/git.orderFile | |
| parent | 02b5c4639bcd3a07f1fad7662da32b8b73371597 (diff) | |
| download | lwn-2888520bdcbe0599cfc77b2fad8dc6c95505a3cb.tar.gz lwn-2888520bdcbe0599cfc77b2fad8dc6c95505a3cb.zip | |
iommu/arm-smmu-v3: Don't rb_erase() a never-inserted stream node
arm_smmu_insert_master() 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 arm_smmu_remove_master() then call
rb_erase() on every master->streams[i].node unconditionally. rb_erase() on
a zeroed node sees a NULL parent, treats the node as the tree root and sets
root->rb_node = NULL, silently emptying the whole SID tree and breaking SID
lookups (and DMA) for every other master on the SMMU.
Mark each node with RB_CLEAR_NODE() after sort_nonatomic() reorders the
array, since sorting relocates the entries and would leave the earlier
self-referential RB_CLEAR_NODE() pointer stale. An un-inserted node then
stays RB_EMPTY_NODE() and is skipped in both erase loops; inserted nodes
are linked by rb_find_add() and erased as before.
Fixes: b00d24997a11 ("iommu/arm-smmu-v3: Fix iommu_device_probe bug due to duplicated stream ids")
Assisted-by: LLM
Signed-off-by: Nicolin Chen <nicolinc@nvidia.com>
Reviewed-by: Mostafa Saleh <smostafa@google.com>
Signed-off-by: Will Deacon <will@kernel.org>
Diffstat (limited to 'scripts/git.orderFile')
0 files changed, 0 insertions, 0 deletions
