[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 2/3] VT-d: correct off-by-1 in fault register range check
- To: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- From: Jan Beulich <jbeulich@xxxxxxxx>
- Date: Tue, 23 Nov 2021 14:40:03 +0100
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=7UpnXoNN4OOD8dNV51znqRmM214jyttiYXA4qdhkm0s=; b=aPV6ZGQDmhBwY73MeCiBIdoC4qL4PYKtsBFnEO/ClZTM80w1wsBmKQz9tLOpXf3R9ZAwiaYNm1M9x1yGBkpMocKOBMxCNyaJbpnnKG3OgVgQJJ8u24fAfBMsI2F6HikQQytB29iowopvErJO39hIxGhb4PbxvUWJkcJ/jkoqfq6KI1c2lIlQV7wP4zXRVqU8EuOjxb/Bc+8PSxdL088y21/KO+jx1y0SE6b0LJqOSfdbU+5JOP+ZFWjTLEchq3nGkTy7Z83L797hOX0MK2RXEmYysLJLotv69E0D81NnkPnlL/YEETv5bmNk2sP9U4uKxQV38kJwg2s24aOEj5ePkQ==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Kbs2bI/JfnKfMCpQwEF4YQg4k4MW4uhLmnEkb7zVXApJRQHOnx0qQ6Ewht0kuJuxabtbLXp8xZLI40Bm5DEJxzK1iCmCV+ficfoffhjgrwqJHIYRFec5HM84gW+Q2v0ddNoW9/nBID1x21EBw2E8iEIzKOfVsuXNBCa+mjIBcaNlg1fiOHSHi+WOaMJb1SqJO36wAgRDKOxEDqzAGpGDG7xcdRfg7a03Q8bhVP+JmZme+feHde1P3HaDwm1hDjizgqjm7rnIUi3K/Jwv1yXHgGCIEyh842czyTBOuBIUZhJoo3SP69h/SULxCsJoXin7SkHXoRzWT+KKTH0PspM5eA==
- Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
- Cc: Kevin Tian <kevin.tian@xxxxxxxxx>
- Delivery-date: Tue, 23 Nov 2021 13:40:20 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
All our present implementation requires is that the range fully fits
in a single page. No need to exclude the case of the last register
extending right to the end of that page.
Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -1229,7 +1229,7 @@ int __init iommu_alloc(struct acpi_drhd_
quirk_iommu_caps(iommu);
if ( cap_fault_reg_offset(iommu->cap) +
- cap_num_fault_regs(iommu->cap) * PRIMARY_FAULT_REG_LEN >= PAGE_SIZE ||
+ cap_num_fault_regs(iommu->cap) * PRIMARY_FAULT_REG_LEN > PAGE_SIZE ||
ecap_iotlb_offset(iommu->ecap) >= PAGE_SIZE )
{
printk(XENLOG_ERR VTDPREFIX "IOMMU: unsupported\n");
|