Re: [PATCH 6.6] iommu/sva: move x86 disable check before allocation

Sasha Levin <[email protected]>
Newsgroups org.kernel.vger.linux-kernel,dev.linux.lists.iommu,org.kernel.vger.stable
Message-ID <[email protected]>
On Mon, Aug 03, 2026 at 07:40:39PM +0800, Wei Yang wrote:
> Backport of commit 72f98ef9a4be ("iommu: disable SVA when CONFIG_X86 is
> set") placed the IS_ENABLED(CONFIG_X86) early-return in
> iommu_sva_bind_device() after iommu_sva_alloc_pasid() and kzalloc(handle),
> while upstream puts it at the function start.
>
> On x86 this leaks the kzalloc'd struct iommu_sva (early return skips
> kfree) and a globally allocated PASID (mm->pasid wrongly set, never
> unbound). Move the check before any allocation/side effect.

An ack from one of the maintainers would be appreciated on this.

-- 
Thanks,
Sasha
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.