From nobody Tue Dec 26 01:28:48 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4SzccK36LJz55GcN; Tue, 26 Dec 2023 01:28:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SzccK1673z3g1J; Tue, 26 Dec 2023 01:28:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703554129; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wG2lnas2ax8UZUTM6/N+p907+0kuGw6mrRT0emf+Vlw=; b=VA0yFI9VnodLazzG6CA3MUnUEkg401f+1UZLuR6Os7vh/pmqg6jVoCfQyGizfWIJJjnmeY S8oUVR6UHmy+qOREiJGEuUfa/qGn5ubMd5XN3tYVBUk/QUlmcIbjZRL8+191Ixfqs/q3K2 7hvCWSVEDItbhxdhXaPH3wixyz0FVJsinrLa9++a9+p2HDukm/TdGeBcgJuof2BOhDdDBi V/7JcUhyzO70lo1+fltjWEqDBZZuu117PP+Nm/we25r33NWZHJZNxoA3a05tqz9hLtyonY EiSxqKBFrzU+vqWauRVQ92BsSXVv7Wv3N6FJCHb7E6/txnApSqS/pbKClDOdug== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703554129; a=rsa-sha256; cv=none; b=D+G/ZNs6UdN25Ttiul+J548YRZmfHy33aKAlxBKuuTYFZfkSTyLzQ5gyWrCCijBOyF72Zc SibhsE7hSQPvk1HRAalVhegw8XmKl/qWzyzlZc0feLuXKTIf4tEJn4qEd16RyNR7jyYUH3 o4OL9E2Fx3AISz2st5nlfdifPceOrc62f5uvmBSB6ADnIUkzKonaIqBxX7SP3LiMSKuJO8 DoQcAutNBQhpveNXG2ZBBcZUifQP6WUZB2HdayryyE9w1BaH21pEmjsnJnI1nPARY2LxUq ogmvS740zOLX0iHpdOSvqqstAwLr+t6hIR9aLBGnXzhSKGRLNEMnJkNiGrOhXQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703554129; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=wG2lnas2ax8UZUTM6/N+p907+0kuGw6mrRT0emf+Vlw=; b=aewv55MRYKWoY8uMoxXtLgWhGX0WTdTBRGDMbUjFOeRaYPKKsZzc/o1lAkbGRLqR27mo5X WOAObJVA7U9Z/Mdd+V29X7087uRsEaCzDyABW4lzoXF+gBYU9lchbjo1aVrXbIw3mT3Zdk dfw326aWPJUULF+CynYjZb8o5aBB/NodYjTXYJQVinAgJFfFCNruqvq8YjpP6lAvJ4i4gI RGAhW4+nveQa8jmK2qeo1fcmU2xwr36FoSGbzzjbq4R5pHpLMF9mZdb/8xIvJ+hDEttNvy aRsIAKZyQntQLKlHyzYUiyPZCdqe3TFuy8InFPtI5DiQghl18JmH5Z8C2DRtnQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4SzccK0DQRzZk7; Tue, 26 Dec 2023 01:28:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BQ1SmE0035392; Tue, 26 Dec 2023 01:28:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BQ1SmJb035389; Tue, 26 Dec 2023 01:28:48 GMT (envelope-from git) Date: Tue, 26 Dec 2023 01:28:48 GMT Message-Id: <202312260128.3BQ1SmJb035389@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: a869643e184a - main - iommu_gas_match_one(): check for underflow List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a869643e184a73382ef7939b465fd42785e096d1 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=a869643e184a73382ef7939b465fd42785e096d1 commit a869643e184a73382ef7939b465fd42785e096d1 Author: Konstantin Belousov AuthorDate: 2023-12-26 00:57:00 +0000 Commit: Konstantin Belousov CommitDate: 2023-12-26 01:28:22 +0000 iommu_gas_match_one(): check for underflow Sponsored by: The FreeBSD Foundation MFC after: 1 week --- 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;