Re: [PATCH v1] iommu/vsi: Fix use-after-free during module unload

From: Yibo Tan

Date: Mon Sep 07 2026 - 15:27:58 EST


Thanks for the review.

I agree that devm_free_irq() is unnecessary and have removed it. The
same KASAN A/B test still passes: the unmodified driver reports two
use-after-free accesses, while the revised driver removes the IOMMU
registration and completes the later device registration without KASAN
or other diagnostics.

For v2, I propose keeping the bug fix local so it remains small,
independently testable and suitable for stable backporting. The remove
callback revokes the non-managed IOMMU and sysfs registrations and
balances the clock preparation, while leaving the managed IRQ to
devres.

Reusable managed helpers for the IOMMU registrations and clock
preparation could then be developed and reviewed as a separate series,
without making this UAF fix depend on a cross-subsystem API change.

Regards,
Yibo