The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: gregkh@linuxfoundation.org, baolu.lu@linux.intel.com
Cc: Sasha Levin <sashal@kernel.org>,
	joro@8bytes.org, will@kernel.org, robin.murphy@arm.com,
	jgg@ziepe.ca, akpm@linux-foundation.org, iommu@lists.linux.dev,
	linux-kernel@vger.kernel.org, stable@vger.kernel.org,
	albinwyang@tencent.com, albin_yang@163.com
Subject: Re: [PATCH 6.6] iommu/sva: move x86 disable check before allocation
Date: Tue,  4 Aug 2026 21:13:30 -0400	[thread overview]
Message-ID: <20260805011007.stable-0008@kernel.org> (raw)
In-Reply-To: <20260803114039.319953-1-albin_yang@163.com>

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

  reply	other threads:[~2026-08-05  1:13 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-03 11:40 [PATCH 6.6] iommu/sva: move x86 disable check before allocation albin_yang
2026-08-05  1:13 ` Sasha Levin [this message]
2026-08-05  2:16 ` Baolu Lu
2026-08-05 16:41   ` Sasha Levin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260805011007.stable-0008@kernel.org \
    --to=sashal@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=albin_yang@163.com \
    --cc=albinwyang@tencent.com \
    --cc=baolu.lu@linux.intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=iommu@lists.linux.dev \
    --cc=jgg@ziepe.ca \
    --cc=joro@8bytes.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robin.murphy@arm.com \
    --cc=stable@vger.kernel.org \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox