From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796204568; b=NNKBHGFE3mI0oEWDIcweTUXdu1LjUjz/a2zhR1JGfQtn7HjAd1nBXPgEaTUqjOSNZen1 +1Msv+GYNJkBX4jVQDN+JlUPdxP4t/+WzMVEiFzv8Mc0f2SvgakDnRNWWFS5RKv3UMi9D 0Y1og9kwwGGYW//KpmKlsBi6kseG8SNdDxXglv+XKEVvzFoxQe4HlkGaglrvkAYJ49+zJ XsaPKAGZHXhrNKfdrqNb9FKiriam+2Vcqxli0s/xNMTlLyWqgxdS3QWPAWvgzaztMn+Cr zuzF5mq6ZrhP+hWQVzBXPwU/+U7Xy7sd7RtYHltTu0T6OwZg4hl+xdzrzibpWkircKw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796204568; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=XXTgJBWRslkSVH3Dx8EKprSNEilSB9g7KXKSC36JpKI=; b=iQt4L+49ej+Guz51pIdkBWzS0DP2DvEeAUeexhGLwDuvwYo/KLf3MbwvFE+hFDUyRwLn kC17/qJifpCles+DfWHrMyj7HvTTWwGjyrfs34QElrongOSxJWv+SizNMNCSaw2s40oNa I+Zh4vut5ah4L8zoJ6I/JFLTEtxW4JZN8Tww/c/9wwhpdib82ktu7VvAXIhfmkQvcFomk mZCnF2apx7eubytGf2ZvpX48znykWLyBnm7Y0+USpNv5GrS9WbWyz2Bv1N9oNBNTNR89a nlE8O4WK3FNBLYetuLwL1CVD4qIoQvYVHIx/gCzi2a2ammQzua1xTPfdG85SEsX+inw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=T+YVdEZR; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 826EE606A31A; Wed, 2 Dec 2026 09:42:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=T+YVdEZR Received: by smtp.kernel.org (Postfix) with ESMTPSA id 63CF11F000C1; Wed, 2 Dec 2026 09:42:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796204567; bh=XXTgJBWRslkSVH3Dx8EKprSNEilSB9g7KXKSC36JpKI=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=T+YVdEZRUCYqq0dq3AuJUbj9PfGkcIqnsFAQeYx7tqQKHE330ITbX3IVhJNRTZeze sNKLT3j+KjlYW/1/K5AWWMskCFTBDbpEXQYIMn4NZBXkQCEZx2OeLlDSy+6/TiD6zV FNHTuuv3NutIzt5fQ/INyoga86cg9A4G7zWe+k/Vli7gNOyi05ZoEfwlji5O5liK90 XcMwe6TogH+7DnE2k0L9p0LTTmocYg/2D0kRXw1rSHsBwRs6nm9Fd4aYaRg+O8nnSA 1+YVn7JJYeDqNj2m+3GPJv6CEtTwWpAgPpd4orFy1BEfkgAHHfbGOCT5SpPD3S7jub zGIe3+tsnRETQ== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH 5/5] vfio/pci: Refuse ioeventfds and dma-buf exports over excluded ranges Reply-To: sashiko-reviews@lists.linux.dev To: mhonap@nvidia.com Cc: kvm@vger.kernel.org, virtualization@lists.linux.dev, dri-devel@lists.freedesktop.org, linux-cxl@vger.kernel.org, media-ci@linuxtv.org, "Michael S. Tsirkin" , "Eugenio Perez" In-Reply-To: <20261202093250.1683744-6-mhonap@nvidia.com> References: <20261202093250.1683744-1-mhonap@nvidia.com> <20261202093250.1683744-6-mhonap@nvidia.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Wed, 02 Dec 2026 09:42:47 +0000 X-Mailing-List: linux-cxl@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Thank you for your contribution! Sashiko AI review found no new issues in this patch, but noticed 1 related pre-existing issue it does not introduce: - [Critical] vfio/pci: missing alignment check in vfio_pci_ioeventfd() [1] -- commit a0e0e83a63bca771356893cca68d9c824c8b8bc6 Author: Manish Honap vfio/pci: Refuse ioeventfds and dma-buf exports over excluded ranges This commit rejects ioeventfds that overlap write-excluded BAR ranges and dma-buf exports that overlap mmap-excluded BAR ranges. > diff --git a/drivers/vfio/pci/vfio_pci_rdwr.c b/drivers/vfio/pci/vfio_pci= _rdwr.c > index 04aed725325c4..e620798f90078 100644 > --- a/drivers/vfio/pci/vfio_pci_rdwr.c > +++ b/drivers/vfio/pci/vfio_pci_rdwr.c > @@ -475,10 +475,8 @@ int vfio_pci_ioeventfd(struct vfio_pci_core_device *= vdev, loff_t offset, > if (pos + count > pci_resource_len(pdev, bar)) > return -EINVAL; > =20 > - /* Disallow ioeventfds working around MSI-X table writes */ > - if (bar =3D=3D vdev->msix_bar && > - !(pos + count <=3D vdev->msix_offset || > - pos >=3D vdev->msix_offset + vdev->msix_size)) > + if (vfio_pci_bar_range_excluded(vdev, bar, pos, count, > + VFIO_PCI_EXCLUDE_WRITE)) > return -EINVAL; > =20 > io =3D vfio_pci_core_get_iomap(vdev, bar); [Severity: Critical] This problem wasn't introduced by this patch, but should vfio_pci_ioeventfd() reject an offset where pos is not naturally aligned to count [1]? Without an alignment check (such as !IS_ALIGNED(pos, count)), userspace can register an ioeventfd at an unaligned BAR offset. When the eventfd fires, vfio_pci_ioeventfd_do_write() passes the unaligned io + pos address to vfio_pci_core_iowriteN(), which triggers an unhandled alignment fault on device memory on architectures with strict MMIO alignment such as arm64. [1] https://sashiko.dev/#/bug/linux-37b4aa33-2a11-48a3-939f-b70ba1577441 --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261202093250.1683= 744-1-mhonap@nvidia.com?part=3D5