Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 2 Jan 2024 00:42:37 GMT
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: f7d120eca071 - stable/13 - iommu_gas_match_one(): check for underflow
Message-ID:  <202401020042.4020gbXN003850@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by kib:

URL: https://cgit.FreeBSD.org/src/commit/?id=f7d120eca071bb5b259f3ccce511ea059205b594

commit f7d120eca071bb5b259f3ccce511ea059205b594
Author:     Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2023-12-26 00:57:00 +0000
Commit:     Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2024-01-02 00:42:12 +0000

    iommu_gas_match_one(): check for underflow
    
    (cherry picked from commit a869643e184a73382ef7939b465fd42785e096d1)
---
 sys/dev/iommu/iommu_gas.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/sys/dev/iommu/iommu_gas.c b/sys/dev/iommu/iommu_gas.c
index 4e0bfb116116..cc541e748f48 100644
--- a/sys/dev/iommu/iommu_gas.c
+++ b/sys/dev/iommu/iommu_gas.c
@@ -329,6 +329,8 @@ iommu_gas_match_one(struct iommu_gas_match_args *a, iommu_gaddr_t beg,
 	start = roundup2(beg, a->common->alignment);
 	if (start < beg)
 		return (false);
+	if (end < IOMMU_PAGE_SIZE + 1)
+		return (false);
 	end = MIN(end - IOMMU_PAGE_SIZE - 1, ubound);
 	offset = a->offset;
 	size = a->size;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202401020042.4020gbXN003850>