[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <BN9PR11MB52766B3F3ED1F7F14EA3B7B48CCA2@BN9PR11MB5276.namprd11.prod.outlook.com>
Date: Thu, 6 Mar 2025 03:21:03 +0000
From: "Tian, Kevin" <kevin.tian@...el.com>
To: Nicolin Chen <nicolinc@...dia.com>, "jgg@...dia.com" <jgg@...dia.com>
CC: "joro@...tes.org" <joro@...tes.org>, "will@...nel.org" <will@...nel.org>,
"robin.murphy@....com" <robin.murphy@....com>,
"linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>, "iommu@...ts.linux.dev"
<iommu@...ts.linux.dev>, "linux-kernel@...r.kernel.org"
<linux-kernel@...r.kernel.org>, "ankita@...dia.com" <ankita@...dia.com>
Subject: RE: [PATCH] iommufd: Set domain->iommufd_hwpt in all hwpt->domain
allocators
> From: Nicolin Chen <nicolinc@...dia.com>
> Sent: Thursday, March 6, 2025 5:18 AM
>
> Setting domain->iommufd_hwpt in iommufd_hwpt_alloc() only covers the
> HWPT
> allocations from user space, but not for an auto domain. This resulted in
> a NULL pointer access in the auto domain pathway:
> Unable to handle kernel NULL pointer dereference at
> virtual address 0000000000000008
> pc : iommufd_sw_msi+0x54/0x2b0
> lr : iommufd_sw_msi+0x40/0x2b0
> Call trace:
> iommufd_sw_msi+0x54/0x2b0 (P)
> iommu_dma_prepare_msi+0x64/0xa8
> its_irq_domain_alloc+0xf0/0x2c0
> irq_domain_alloc_irqs_parent+0x2c/0xa8
> msi_domain_alloc+0xa0/0x1a8
>
> Since iommufd_sw_msi() requires to access the domain->iommufd_hwpt, it
> is
> better to set that explicitly prior to calling iommu_domain_set_sw_msi().
>
> Fixes: 748706d7ca06 ("iommu: Turn fault_data to iommufd private pointer")
> Reported-by: Ankit Agrawal <ankita@...dia.com>
> Signed-off-by: Nicolin Chen <nicolinc@...dia.com>
Reviewed-by: Kevin Tian <kevin.tian@...el.com>
Powered by blists - more mailing lists