From nobody Tue Jan 02 00:41:52 2024 X-Original-To: dev-commits-src-all@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 4T3vDx1psVz55yn9; Tue, 2 Jan 2024 00:41:53 +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 4T3vDw6j47z3PW7; Tue, 2 Jan 2024 00:41:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704156112; 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=rzrSuvLFM0pK8JM0N2M//AGCxLTDmYtWMiJXKJNAwW4=; b=e6oxi3tF/CfCvygxaFOvIiDwIv4GqG1yImVNCdHd1gSOVMEWXijQvo5F4FpxDulwIi0Vjx s58PzDcXWI7bQys9u5UxCfsgBOZKWWWe2ZnILj0unVZXJg0rCjVgWlkF3fBXhsnlnZJqjo OYPs5Gmn1hG8wFHaA69VuNczhGjzJzCGBIZBjuFwllu8cgSvdq+XUw57cHZr/5RlIJgEhX k5KSm1gJ/8TyyrvGqPQ3NWBTq/znG6PLj3d550pjHHpqEF+SzzAb8725Col7OpCpm9rxjm 4a6TE+Y7R9uSHna/JOy1/vPBqZWNPyO/FK8JaqPKwRV+m6WhAPoeXanyzGf2Yg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704156112; a=rsa-sha256; cv=none; b=jAZ+avRnaInuSTXNlMhVyjCPi1lD3Y3MBIT7SJrcW2l26blVMFklUOzk4YMNLAdsxHYjf+ BUj1xqHnQg6lPviaVoWlz/hqHi4q5FMX2v6pNxqYM5nPRTI43+TIuR3eb52BZv+D/eK4Wy X51Fzc9x+5dLKphHQTc9y4yEc4NhITygwdSLUduWBzSqFqEexIZgHSti8HBPcgLHZ+QsNq Vikut6ISxoctQjOot13aniav/CLhKftzE/fdX6eKqVKzJ76M4k/1TXeHr6kYo35OFfN0dv uo8JYC7z6lONnMSqT8wAa8ks+kcFkev0uZFTafTsaKIzEBcVN1KJ5FIEkL1M9A== 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=1704156112; 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=rzrSuvLFM0pK8JM0N2M//AGCxLTDmYtWMiJXKJNAwW4=; b=RxQiaCoseor3VemgBD2JTJScFuHtnbUGoDNGjGGzw5p6Gw2sX8SlQJe7JJe0pYhALdolP4 Z7pyvUaFNBLrwSk/PoZmfyJPBtl5WlWcdjdUeYBtI1nmhN60qh39AuKXRVF8DR+33cXec+ D8gdwB/kPn/34Ienu26h5nzFengHGL8xB5OSFDUUrbaEmANIzpx9vkOye3f7IEKiO13Q4w wgOz9B6X9bl5IfgXWPr83TDN8eRH6ryDbSVQ/iYQLHcbJvH/t24zomnML6a0Id5qbkfdzQ RFfeQeCSG31/3zK1sro3C4+l9qyBqAu3rG5oQGnNBuWmP99kG1Pv9MwRhYO1xQ== 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 4T3vDw5prdzfnF; Tue, 2 Jan 2024 00:41:52 +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 4020fq00096672; Tue, 2 Jan 2024 00:41:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 4020fqTr096669; Tue, 2 Jan 2024 00:41:52 GMT (envelope-from git) Date: Tue, 2 Jan 2024 00:41:52 GMT Message-Id: <202401020041.4020fqTr096669@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: eb0d8cb12166 - stable/14 - iommu_gas_match_one(): check for underflow List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@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/stable/14 X-Git-Reftype: branch X-Git-Commit: eb0d8cb121667bf2c2632a6cc48b44c036cd173a Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=eb0d8cb121667bf2c2632a6cc48b44c036cd173a commit eb0d8cb121667bf2c2632a6cc48b44c036cd173a Author: Konstantin Belousov AuthorDate: 2023-12-26 00:57:00 +0000 Commit: Konstantin Belousov CommitDate: 2024-01-02 00:41:38 +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;