From nobody Tue Jan 02 00:42:37 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 4T3vFp0s6rz560Rr; Tue, 2 Jan 2024 00:42:38 +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 4T3vFn4QgGz3RjX; Tue, 2 Jan 2024 00:42:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704156157; 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=xp4xX1LvpG6gyc54SuAKDKlj3ftwP/Knzw0sdpO0PC8=; b=tFRdydQLxCx081RKw0WMKXhdPhG5NzepTVsrI+fMoywBfAwllhbULmhkmYVA8Ox2B3KtkE NUAycNg9M+nzMyYWEc7xV1WFh/Ni5JjesWEr8xQNtj1V9m5CeFACdOx+QdhfY/5MlAFPLz 1r4417GOQaikxozFpfm1yiU7oKbhOXocf4t0Kn1i/7I6PVboc8OL30RxcavwMlXrlM/5h+ DijbyDKmwzDtBmg35/yXX5p1vv4twrZ3OhEN16SYEPJq+K3avdAfoH3dn0tSFb7r7wDemE +dZEkMgUno4Zg2OTjM21SwwXW1Bc4+L/ylVRX5FBtCIwl+8DAbzI+QK8SF8hwA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704156157; a=rsa-sha256; cv=none; b=hQ8O46H1/tZkG7DlKU3Og/jvhdHWxVDHb10k8o1HNsBFf7J7Td1KQUPahplKVMNikz3Ixk wR2qbisusIwCTIKaGVwaR1n6oql+zrrvw8nDVz27qmM8yl6xhJACn46MIqYv5XWdxdRPfv ViskCl6LdOKedMCJJP9RtmQiYQmmy5R1SygLeXAIgICEZf4KxvvhUCT86SPP79VCJRpR+h GOx6bZujktYmqd5dC0f1TucJKdStJgC0L9DdFkILNR2fWrl+jsC7js2PJdALnmrU7F7r07 XqcsU3f8uIJhdps7gYR8+wdiaNsIF6KIesJd4/UdRCm25NrMVQ8mEC9MoB1Mcg== 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=1704156157; 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=xp4xX1LvpG6gyc54SuAKDKlj3ftwP/Knzw0sdpO0PC8=; b=yKhwPx38kZ0S77ZPp6MR/NsiPg7odfmSVoU/BFS/UDvsUyUCEugPfKWZ3IdsNHS/nOI96M Dn31IPpZQ7HI8hVK91rc91SCYYRT/SS6hqN8TazW+8mxpGTmKZXY2mzuLPj8zqX9wK/cOP n+3f7N/MxQZuUcBf5rwddlb6ZoSH1ZNE3uI+chZV/Gy/zfJZNp2ayVSXXT2MZGBaw6fBnE G0ou32bQt5iF/j+QuAkMLZQxw7frQyo+OVZ/miBNPVShJSKU2l9VUlMn/HwYEn/LR/CyIx FKLaS57lfZi/V7iavl1VVHt3vf3rPP/n625fmT0uCj3h1i2eFTmJHJWQeJbzLw== 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 4T3vFn3TbGzfYw; Tue, 2 Jan 2024 00:42:37 +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 4020gbKZ003853; Tue, 2 Jan 2024 00:42:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 4020gbXN003850; Tue, 2 Jan 2024 00:42:37 GMT (envelope-from git) Date: Tue, 2 Jan 2024 00:42:37 GMT Message-Id: <202401020042.4020gbXN003850@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: f7d120eca071 - stable/13 - 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/13 X-Git-Reftype: branch X-Git-Commit: f7d120eca071bb5b259f3ccce511ea059205b594 Auto-Submitted: auto-generated The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=f7d120eca071bb5b259f3ccce511ea059205b594 commit f7d120eca071bb5b259f3ccce511ea059205b594 Author: Konstantin Belousov AuthorDate: 2023-12-26 00:57:00 +0000 Commit: Konstantin Belousov 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;