[PATCH v3 0/5] iommu: Fix domain check on release

Lu Baolu posted 5 patches 1 year, 9 months ago
include/linux/iommu.h       |   1 +
drivers/iommu/intel/pasid.h |   2 +
drivers/iommu/intel/iommu.c | 214 +++++++++++-------------------------
drivers/iommu/intel/pasid.c | 202 ++++++++++++++++++++++++++++++++++
drivers/iommu/iommu.c       |  19 +++-
5 files changed, 283 insertions(+), 155 deletions(-)
[PATCH v3 0/5] iommu: Fix domain check on release
Posted by Lu Baolu 1 year, 9 months ago
This is a follow-up to the discussion thread here:

https://lore.kernel.org/linux-iommu/20240221154012.GC13491@ziepe.ca/

It fixes a NULL pointer dereference issue in the Intel iommu driver and
strengthens the iommu core to possibly prevent similar failures in other
iommu drivers.

There are two parts of this topic:
[x] Introduce release_domain and fix a kernel NULL pointer dereference
    issue in the intel iommu driver.
[x] Follow-up patches to cleanup intel iommu driver.

Best regards,
baolu

Change log:
v3:
 - Avoid global IOTLB and PASID cache invalidation in normal release
   path to mitigate the impact on other devices.
 - Comment and code refinements.

v2:
 - https://lore.kernel.org/linux-iommu/20240229094613.121575-1-baolu.lu@linux.intel.com/
 - https://lore.kernel.org/linux-iommu/20240229094804.121610-1-baolu.lu@linux.intel.com/
 - The scalable mode context entry should be removed in the release path
   as it's not part of the blocking domain.

v1: https://lore.kernel.org/linux-iommu/20240223051302.177596-1-baolu.lu@linux.intel.com/

Lu Baolu (5):
  iommu: Add static iommu_ops->release_domain
  iommu/vt-d: Fix NULL domain on device release
  iommu/vt-d: Setup scalable mode context entry in probe path
  iommu/vt-d: Remove scalable mode context entry setup from attach_dev
  iommu/vt-d: Remove scalabe mode in domain_context_clear_one()

 include/linux/iommu.h       |   1 +
 drivers/iommu/intel/pasid.h |   2 +
 drivers/iommu/intel/iommu.c | 214 +++++++++++-------------------------
 drivers/iommu/intel/pasid.c | 202 ++++++++++++++++++++++++++++++++++
 drivers/iommu/iommu.c       |  19 +++-
 5 files changed, 283 insertions(+), 155 deletions(-)

-- 
2.34.1
Re: [PATCH v3 0/5] iommu: Fix domain check on release
Posted by Joerg Roedel 1 year, 9 months ago
Hi Baolu,

On Tue, Mar 05, 2024 at 09:33:00AM +0800, Lu Baolu wrote:
> It fixes a NULL pointer dereference issue in the Intel iommu driver and
> strengthens the iommu core to possibly prevent similar failures in other
> iommu drivers.

Please send me another pull request once you consider this ready. I
guess it is v6.9 material.

Regards,

	Joerg
Re: [PATCH v3 0/5] iommu: Fix domain check on release
Posted by Baolu Lu 1 year, 9 months ago
On 2024/3/5 15:54, Joerg Roedel wrote:
> On Tue, Mar 05, 2024 at 09:33:00AM +0800, Lu Baolu wrote:
>> It fixes a NULL pointer dereference issue in the Intel iommu driver and
>> strengthens the iommu core to possibly prevent similar failures in other
>> iommu drivers.
> Please send me another pull request once you consider this ready. I
> guess it is v6.9 material.

Sure. I will queue this series in a pull request.

Best regards,
baolu