iommu/arm-smmu-v3: Fix Tegra241 CMDQV CMD_SYNC use-after-free
Status from this message: Applied to iommu (arm/smmu/updates), thanks!
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v3 Latest2 patches 3 repliesApplied
- v22 patches 2 repliesSuperseded
Changes in v3 from the cover letter
Patches in v3 Applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | iommu/arm-smmu-v3: Manage teardown with devmdrivers/ | +40 | 1 reply | |
| 2/2 | iommu/tegra241-cmdqv: Fix CMD_SYNC use-after-free on teardowndrivers/ drivers/ drivers/ | +16 | 1 reply |
Reviews trailers per patch
All 2 patches have a Reviewed-by or Acked-by.
| Patch | Nicolin Chen | Jason Gunthorpe |
|---|---|---|
| 1/2 | R-b | R-b |
| 2/2 | R-b | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v3 0/2] iommu/arm-smmu-v3: Fix Tegra241 CMDQV CMD_SYNC use-after-free
Hi,
Changes from v2:
https://lore.kernel.org/linux-iommu/[email protected]/
-Addressed feedback and picked up R-by tags(Thanks!). -Use explicit type casts in devm action callbacks(patch #1) -Add Cc: stable to patch #1 as it is a pre requisite for patch #2.
Please take a look and let me know.
Thanks,
Shameer
From v2:
The arm-smmu-v3 probe teardown mixes devm and manual cleanup, so resources unwind in the wrong order. The IOPF queue is freed before the event-queue IRQ whose handler uses it. On Tegra241 this is worse: devres frees smmu->cmdq.q.base before arm_smmu_impl_remove() runs, and the CMDQV teardown then issues a CMD_SYNC on the freed queue, a use-after-free.
Patch 1 moves the remaining manual teardown (IOPF queue, vmid_map, device disable) onto devm so the unwind order is correct. Patch 2 adds a device_disable() impl op and uses it to quiesce the Tegra241 VINTFs while the CMDQ is still up, fixing the UAF.
Shameer Kolothum (2):
iommu/arm-smmu-v3: Manage teardown with devm iommu/tegra241-cmdqv: Fix CMD_SYNC use-after-free on teardown
drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h | 1 + drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 58 ++++++++++++++----- .../iommu/arm/arm-smmu-v3/tegra241-cmdqv.c | 15 ++++- 3 files changed, 56 insertions(+), 18 deletions(-)
Signature · 1 line
2.43.0