From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f169.google.com (mail-pl1-f169.google.com [209.85.214.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EB31547AF65 for ; Tue, 14 Jul 2026 14:23:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.169 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784039015; cv=none; b=Ce0rc0cyy90pxFml6oQ+ULgfGAAZ0IhEiPhYGDp+Ph6SPfGIAQVF5BxBNKdQcQ6LaFuNYSTiZ4OMHkhFLuXiMld87Of9NLG6willnn3gn0mmjRWyinsh8ClBWQJVApwdbAcqEg/Lc0B727qIiPKAlaFJmM1Kt1m/janUfLeqpwQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784039015; c=relaxed/simple; bh=eX92KqheksDKBQ6r9bH0KvEMVEg9f8Ux4Qm+X6nv1ME=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=r0xy+Ld+ckpE5qPWtnTW/Hgz4i2aHgXn8g+d+d3BYKj7CBfh3IvWoC3CxASJ/jb45a3pQOAFgOJ2MjtHu2YGIRL1/TjIEyuuRYFAsOgGLoSth74e+BOWz87LCNFlw7oVzKks02LKXmywjqlSueG/+XLge4rzQ50RPRpyGoylIxE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=vshsiJ7L; arc=none smtp.client-ip=209.85.214.169 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="vshsiJ7L" Received: by mail-pl1-f169.google.com with SMTP id d9443c01a7336-2ccdf36f63dso139965ad.0 for ; Tue, 14 Jul 2026 07:23:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1784039013; x=1784643813; darn=vger.kernel.org; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=lCzoPTpV/z5B2tKPQZt3PsPAo+HT8Vi32iw6SgMRUdg=; b=vshsiJ7Lss2q7rHYxsyLPc3Y0qOXXxyZMsTvrPoDkkfxCY0OFp0Crbd/9dNrYm+FRj ZSutYRfD1WACf24wHQuLBSEzAw+Y/MGIOIeI4Vr76Ia724IRFfPzHYBE7FN00mcWlHfo Aub61qoKujLkZo5dWbGWQHsTGJz05uP936TMrU2jt3qKToyZWdf4PmdzT14OhUTQZe+0 BsH69t+8FpRlHz0wQtQR1l3UtoWKgaYBvFnfAj9Q7iXdeMCYkD8PF1ZU8VuAS+iC1bCH dKtrp2+g1O9c0VxxV/0aOH7MParjIURm5AHLXTc6eo0QxCpQMN8ubGC+5Z4Q38/A/wup zLVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784039013; x=1784643813; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=lCzoPTpV/z5B2tKPQZt3PsPAo+HT8Vi32iw6SgMRUdg=; b=spMjX+/6mb1w00T2193pVNyefLhkZDYw57BG/vqflWkf/rMfV5MWVaHduaDEWh7UPh wJ6bF7uZAwOSub7hsLwPbj4Spm/UhmxJOaM/0NMotmKDwl545yqpx2BJPpTdhixE49iy unDdXLEPCvC3E1riQUUlxP2ROylJeecnlRgLji3uqY69YTXtWxkJuVkN7y14Csdd8IPn pLmSQhgprT5raOErzFCf2gFgM8IhICatBdC7iSad3SuCnT3BKOW7nVMfHErBXKSONOVY 19T5SUaEtGTG4ZpBN8pjjERXRrmuM29RRsS2TEBYOXGMtcBtp/IYyQLHLPgvya1eAqU8 2SNg== X-Forwarded-Encrypted: i=1; AHgh+RqlNjwV727wPzSlfoQBeYUzEupjy97ZON9/42CGUbdgfKmm/2DxR6kx6LXxO3q2qcpuqJ0I7waJDlGaWb4=@vger.kernel.org X-Gm-Message-State: AOJu0YwGTSNGqtA43A3lx5EaZkMY/CObFoBkYmqEU0Ttemd474RRRQJf 69/duaDYlBruV5djTDOgjwnTMS9xjVdVvgmIT2tQcND74BB5O6Dc5t80YCqwAJPObg== X-Gm-Gg: AfdE7ck4TtRu4z7Ko44K/vMyo+pSfJmsebsNI9Oy+4RmlQ7jpyedRjqHF+puQWciKQ1 8E6zyfumC3lO2dbDhmkpMQ8e+SCXp1Po4hgfYm8FCW7M5SxesnnmqCkQxV4eOFoivBqnuo1a5BX XYmYbKcDUghXtlqVS/Wo7EqewkAsliDhQBKsbKHljEnPKllevKMXvohFddVZcty+y7eykoooe4S cU0TvVQXTnyUyat/d/Dw2ihXr/whspcIaaEuiiNjYbxPSTbXDcysEQcSc4XQMIFKBsQsGwP9Zbj NkucOJIR3Sn1tk8FzuDYd0nMcoxcrXWvtLS+ZUwW0drrrDeS5oSH2MWjPaacmxE3NRKOgrE7ICM f1Z3TxfpHoItalUFdAkHsircNe+jzRwTgzQ+9cbQhq0Z+8lVPC5Qt/wagFUHeA0XEglObibSvTR jNa9N7nJjxd33LyZjhbw4GWHf3wp9sy1Q++oQKX6oTvsU5g+g= X-Received: by 2002:a17:903:2311:b0:2c7:7c7d:fb8f with SMTP id d9443c01a7336-2cee1c08769mr5822805ad.17.1784039012483; Tue, 14 Jul 2026 07:23:32 -0700 (PDT) Received: from google.com (10.129.124.34.bc.googleusercontent.com. [34.124.129.10]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-38e172cf903sm1577377a91.8.2026.07.14.07.23.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Jul 2026 07:23:31 -0700 (PDT) Date: Tue, 14 Jul 2026 14:23:26 +0000 From: Pranjal Shrivastava To: Jason Gunthorpe Cc: Nicolin Chen , Will Deacon , Robin Murphy , joro@8bytes.org, Kevin Tian , linux-arm-kernel@lists.infradead.org, iommu@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 0/3] iommufd: Fix vDEVICE allocation lifecycle bugs Message-ID: References: <20260714140607.GB3695849@nvidia.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260714140607.GB3695849@nvidia.com> On Tue, Jul 14, 2026 at 11:06:07AM -0300, Jason Gunthorpe wrote: > On Sun, Jul 05, 2026 at 10:36:08PM -0700, Nicolin Chen wrote: > > Sashiko flagged a few bugs in how IOMMU_VDEVICE_ALLOC creates and validates > > a vDEVICE on a vIOMMU: > > > > - the core publishes a vDEVICE into the vIOMMU xarray before the driver's > > vdevice_init() runs, so a concurrent invalidation can reach one it has > > not yet accepted; > > - the undersized-vdevice_size guard returns holding the igroup mutex, > > deadlocking later vDEVICE operations on that group; > > - the Arm SMMUv3 vIOMMU accepts a device without exactly one Stream ID: > > an out-of-bounds streams[] read for none, stale ATC/IOTLB for several. > > > > Fix each of them properly. > > > > This is on Github: > > https://github.com/nicolinc/iommufd/commits/fix_vdevice_sashiko-v2 > > > > Changelog > > v2 > > * Add "Reviewed-by" from Kevin > > * Patch-2: Add "Cc stable"; drop the out_release label by inlining the > > xa_release() call > > * Patch-2: Note that the reserved slot is hidden only via xa_* helpers > > * Patch-3: Return -EOPNOTSUPP instead of -EINVAL > > v1 > > https://lore.kernel.org/all/cover.1782767110.git.nicolinc@nvidia.com/ > > > > Nicolin Chen (3): > > iommufd/viommu: Release the igroup lock on the vdevice_size error path > > iommufd/viommu: Publish a vDEVICE only after vdevice_init() succeeds > > iommu/arm-smmu-v3-iommufd: Require exactly one Stream ID for a vDEVICE > > > > .../arm/arm-smmu-v3/arm-smmu-v3-iommufd.c | 15 +++++++++++++ > > drivers/iommu/iommufd/viommu.c | 22 ++++++++++++++----- > > 2 files changed, 31 insertions(+), 6 deletions(-) > > Applied to for-rc > Oops, sorry. I missed this while looking at patches in mutt. Feel free to ignore my R-b if I'm too late. Thanks, Praan