From nobody Tue Sep 03 14:53: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 4WypXw3XN7z5TMr7; Tue, 03 Sep 2024 14:53:52 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WypXw1vnwz4wfR; Tue, 3 Sep 2024 14:53:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725375232; 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=lV3D72rVYW0me+RstxspdDDS552mmUPIOICvniRP+wI=; b=aRaO1T1LhgeJ5w80vLyaJjDx8zUiIsPGB+9cgArFfCbWFNf09Xb4PJbLK/+8bv534aExtu GeFfRwVVJuTDMvqTPPqeeIcUnRLYQGsJOI8NDnJ58EY2m4XAY2iVcd2+OfmUHGHbv/ZT8P oUwjXFHhEWwQSZbbYlwaYR0xN+FH0oUsBjDmcAlDK0d1NsWrl645b+LI7w/wgtH4IR103z gss4QHDNJmMvZtjk/IpUc4R4sF2H6RCUo2LXVNZUguVqEeND+avyiXjHvCH5wty/KUFryi EODEtpvDkNLDNXqodXBh/zgKysgD6w9M/8V5bVqotGX2TGTcUB8zkscZAkTvjw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725375232; a=rsa-sha256; cv=none; b=VmbRFHiMjibxrnaEGmMsQKGJzOyxNfDBcFz7v19ZHHnZbW5ivguoQQGJvKNF/+5BPlISYJ Nn9Qr59sSDjlNPt8DSAXyqsgKIaxbAI/CNjfroJ+A9ZG2I8q8ZvC4om2gJJq/7DL6kkuAJ Zb6ze+cotlSLktxay9abTeY8O2pNmJ3G6SWVgEdrQRvSd+hsotQSJZwGSD9ZWtxV72yTYB tK0x1TeLBYBNZpwJbjZssUKR3XYTJeOOK6JaBm2Dgyt71T0yocsaERMfN+53lume/2k4wt znBItDxd1J+A+DalkGcgdiY1XXzxcxAEw8AjfB4fx6MvtMj3jvn+KEXra2gS0A== 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=1725375232; 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=lV3D72rVYW0me+RstxspdDDS552mmUPIOICvniRP+wI=; b=sAVAPkc/Z2zcclCFkMz3XYHvR7z5gRjB72FXwYv1CgvWT0At6QKrjope8zrJ4yQsrb69NR IfEMik6Hm8gq/TFFF1tt1ftAHCSnPgH5awkKUls5eUI0kX4sH2bErW/WtrN1g/XFyuo+cc 8loQ37qtO2iOhyVmJFjsiUgJMOLQBdCg01FfXuNnMEpJvAY3p90fcTC7LYCQJr7TOK7OxS 8NxdzXZnnpnDHb6OPH8U+UkhKjuDgr79lzG9x777BOzdUOXod2zo2fy4QK+Nd0YAWebtVe G1No32YiupUuEw6h+feNi85oyNF5bbHyGtDCMysIVodIgO7jJm+BrO7itbSx5g== 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 4WypXw1VhWzlcJ; Tue, 3 Sep 2024 14:53:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 483ErqRl070098; Tue, 3 Sep 2024 14:53:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 483ErqW8070095; Tue, 3 Sep 2024 14:53:52 GMT (envelope-from git) Date: Tue, 3 Sep 2024 14:53:52 GMT Message-Id: <202409031453.483ErqW8070095@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 4a81e501337c - stable/14 - bhyve: avoid updating fbaddr when vm_mmap_memseg fails 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 4a81e501337cf160d56af2d638f080983e520654 Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=4a81e501337cf160d56af2d638f080983e520654 commit 4a81e501337cf160d56af2d638f080983e520654 Author: Pierre Pronchery AuthorDate: 2024-07-24 20:51:20 +0000 Commit: Ed Maste CommitDate: 2024-09-03 14:53:19 +0000 bhyve: avoid updating fbaddr when vm_mmap_memseg fails In the function pci_fbuf_baraddr the field sc->fbaddr was set with a user-controlled value, even though the call to vm_mmap_memseg failed. No security risk as currently sc->fbaddr is not really used in the source code. Reported by: Synacktiv Reviewed by: emaste Sponsored by: Alpha-Omega Project Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D46109 (cherry picked from commit 85707cfdaddc179af8bd2623091eb1b8c58fed4a) --- usr.sbin/bhyve/pci_fbuf.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/usr.sbin/bhyve/pci_fbuf.c b/usr.sbin/bhyve/pci_fbuf.c index a6bf508a46e6..e2d34cfef639 100644 --- a/usr.sbin/bhyve/pci_fbuf.c +++ b/usr.sbin/bhyve/pci_fbuf.c @@ -232,7 +232,8 @@ pci_fbuf_baraddr(struct pci_devinst *pi, int baridx, int enabled, if (vm_mmap_memseg(pi->pi_vmctx, address, VM_FRAMEBUFFER, 0, FB_SIZE, prot) != 0) EPRINTLN("pci_fbuf: mmap_memseg failed"); - sc->fbaddr = address; + else + sc->fbaddr = address; } }