From nobody Tue Aug 1 21:38:10 2023 X-Original-To: freebsd-security-notifications@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 4RFpPg07v3z4pt7G for ; Tue, 1 Aug 2023 21:38:11 +0000 (UTC) (envelope-from security-advisories@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (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 "freefall.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4RFpPZ1vs9z3Npf; Tue, 1 Aug 2023 21:38:10 +0000 (UTC) (envelope-from security-advisories@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1690925890; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc; bh=zYC8cFpOR5T8CjoO2Zz8jJoWc4Vkdi+UpAhQbNAxqbw=; b=ynKNkv2d/cfhZxWp46TTghBp4Fn2PFZUiQEcR2DC3aXFzwfwWoxLbbUwzaOuU0VSdofsc0 u6I8utmq3Ly4ipSUr6oJnDd60S/VrEY4oqJ3IPpW9Ccpt69qZAmbRp1eFcZny6+kvb5YQU YQvGMiZVt1nUEq4YZYtVtskq1RzgTMk/ZvMXn5/eWvZ24lDzc1SHc81YOt4RX88/drckBk URLcUr5Qkp3tKoymLjEb1zlc2dzd+vW1XNrbMxGyyXzZQKcIxQetU4+hLUpk3Q0nE/zYnO xf+i8ukIK0yj1TJxQAChbBWTR/obkBWz38XgGXcuIFYlpbyWpW2FGU523s6GWg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1690925890; a=rsa-sha256; cv=none; b=SS+gNhMSiAeXGP4KeZzHI7Dng1x8FarVcJU21boMLoKD9L+WcCRKLTwcqsmH1tfAcAwQ6B RaV3kjmYNifNLcuYnB/ZyqsoDtXHOw9js2zMV1oUK2leSIJcj/lD0M+va7dnlLZFGdRYe8 NAmhdgOxB9Zy6wM5+dKWmPdutzL74dMF6o6y+m3DqKKjRjUEt+9abmX4cMk/JflHV3fUcZ Wrz9Aa4hUD2gtVhfTNvX9tAdZMMKmz+N8rKD35xEZlxUi/JVaCzVxP/edFWOmuISYbhb87 JywOdFsp0U7iyjGfW50yzMiRHEYdNVuoSTXGUplaJnkWocz2uh48r6CQJd0cvA== 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=1690925890; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc; bh=zYC8cFpOR5T8CjoO2Zz8jJoWc4Vkdi+UpAhQbNAxqbw=; b=bxKLB9kbwI7G7o3u41sen16k7jdDRlEMJ8Efdpe3HD3umqAOQJ4P/HtTV3UIjSn80t/IJ3 P4oIB3AVOoqQ9jQIsVVg+knWp5TQeGQjngIvPfYsbVMdUMx4VuP/HqeVgZJ9FVP/75KvyH RjCF9rn81jTrl3H1GJ6oqIDIPseVUfCzOwtFv8M2bP+GxoDBujcAwpjcCqXPH8ohKThJUg DwtVcp6artPaCJmxdJTNTD3vZiiS9uMMcaJz/6gKbd0Hk2gGi5SIo3XxJLa6CCNWLId4Bx XfhqX9YY0ESR+ibNOrmjlQBGeAESlOGJuRFFJ66QfZopv0EbbCVHJ7dnFwlN6g== Received: by freefall.freebsd.org (Postfix, from userid 945) id 235D219CC3; Tue, 1 Aug 2023 21:38:10 +0000 (UTC) From: FreeBSD Security Advisories To: FreeBSD Security Advisories Subject: FreeBSD Security Advisory FreeBSD-SA-23:07.bhyve Reply-To: freebsd-security@freebsd.org Precedence: bulk Message-Id: <20230801213810.235D219CC3@freefall.freebsd.org> Date: Tue, 1 Aug 2023 21:38:10 +0000 (UTC) List-Id: Moderated Security Notifications [moderated, low volume] List-Archive: https://lists.freebsd.org/archives/freebsd-security-notifications List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-security-notifications@freebsd.org X-BeenThere: freebsd-security-notifications@freebsd.org -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 ============================================================================= FreeBSD-SA-23:07.bhyve Security Advisory The FreeBSD Project Topic: bhyve privileged guest escape via fwctl Category: core Module: bhyve Announced: 2023-08-01 Credits: Omri Ben Bassat and Vladimir Eli Tokarev from Microsoft Affects: FreeBSD 13.1 and 13.2 Corrected: 2023-08-01 19:48:53 UTC (stable/13, 13.2-STABLE) 2023-08-01 19:50:47 UTC (releng/13.2, 13.2-RELEASE-p2) 2023-08-01 19:48:26 UTC (releng/13.1, 13.1-RELEASE-p9) CVE Name: CVE-2023-3494 For general information regarding FreeBSD Security Advisories, including descriptions of the fields above, security branches, and the following sections, please visit . I. Background bhyve(8)'s fwctl interface provides a mechanism through which guest firmware can query the hypervisor for information about the virtual machine. The fwctl interface is available to guests when bhyve is run with the "-l bootrom" option, used for example when booting guests in UEFI mode. bhyve is currently only supported on the amd64 platform. II. Problem Description The fwctl driver implements a state machine which is executed when the guest accesses certain x86 I/O ports. The interface lets the guest copy a string into a buffer resident in the bhyve process' memory. A bug in the state machine implementation can result in a buffer overflowing when copying this string. III. Impact A malicious, privileged software running in a guest VM can exploit the buffer overflow to achieve code execution on the host in the bhyve userspace process, which typically runs as root. Note that bhyve runs in a Capsicum sandbox, so malicious code is constrained by the capabilities available to the bhyve process. IV. Workaround No workaround is available. bhyve guests that are executed without the "-l bootrom" option are unaffected. V. Solution Upgrade your vulnerable system to a supported FreeBSD stable or release / security branch (releng) dated after the correction date. Perform one of the following: 1) To update your vulnerable system via a binary patch: Systems running a RELEASE version of FreeBSD on the amd64, i386, or (on FreeBSD 13 and later) arm64 platforms can be updated via the freebsd-update(8) utility: # freebsd-update fetch # freebsd-update install Restart all affected virtual machines. 2) To update your vulnerable system via a source code patch: The following patches have been verified to apply to the applicable FreeBSD release branches. a) Download the relevant patch from the location below, and verify the detached PGP signature using your PGP utility. [FreeBSD 13.2] # fetch https://security.FreeBSD.org/patches/SA-23:07/bhyve.13.2.patch # fetch https://security.FreeBSD.org/patches/SA-23:07/bhyve.13.2.patch.asc # gpg --verify bhyve.13.2.patch.asc [FreeBSD 13.1] # fetch https://security.FreeBSD.org/patches/SA-23:07/bhyve.13.1.patch # fetch https://security.FreeBSD.org/patches/SA-23:07/bhyve.13.1.patch.asc # gpg --verify bhyve.13.1.patch.asc b) Apply the patch. Execute the following commands as root: # cd /usr/src # patch < /path/to/patch c) Recompile the operating system using buildworld and installworld as described in . Restart all affected virtual machines. VI. Correction details This issue is corrected by the corresponding Git commit hash or Subversion revision number in the following stable and release branches: Branch/path Hash Revision - ------------------------------------------------------------------------- stable/13/ 9fe302d78109 stable/13-n255918 releng/13.2/ 2bae613e0da3 releng/13.2-n254625 releng/13.1/ 87702e38a4b4 releng/13.1-n250190 - ------------------------------------------------------------------------- Run the following command to see which files were modified by a particular commit: # git show --stat Or visit the following URL, replacing NNNNNN with the hash: To determine the commit count in a working tree (for comparison against nNNNNNN in the table above), run: # git rev-list --count --first-parent HEAD VII. References The latest revision of this advisory is available at -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEthUnfoEIffdcgYM7bljekB8AGu8FAmTJdsIACgkQbljekB8A Gu8Q1Q/7BFw5Aa0cFxBzbdz+O5NAImj58MvKS6xw61bXcYr12jchyT6ENC7yiR+K qCqbe5TssRbtZ1gg/94gSGEXccz5OcJGxW+qozhcdPUh2L2nzBPkMCrclrYJfTtM cnmQKjg/wFZLUVr71GEM95ZFaktlZdXyXx9Z8eBzow5rXexpl1TTHQQ2kZZ41K4K KFhup91dzGCIj02cqbl+1h5BrXJe3s/oNJt5JKIh/GBh5THQu9n6AywQYl18HtjV fMb1qRTAS9WbiEP5QV2eEuOG86ucuhytqnEN5MnXJ2rLSjfb9izs9HzLo3ggy7yb hN3tlbfIPjMEwYexieuoyP3rzKkLeYfLXqJU4zKCRnIbBIkMRy4mcFkfcYmI+MhF NPh2R9kccemppKXeDhKJurH0vsetr8ti+AwOZ3pgO21+9w+mjE+EfaedIi+JWhip hwqeFv03bAQHJdacNYGV47NsJ91CY4ZgWC3ZOzBZ2Y5SDtKFjyc0bf83WTfU9A/0 drC0z3xaJribah9e6k5d7lmZ7L6aHCbQ70+aayuAEZQLr/N1doB0smNi0IHdrtY0 JdIqmVX+d1ihVhJ05prC460AS/Kolqiaysun1igxR+ZnctE9Xdo1BlLEbYu2KjT4 LpWvSuhRMSQaYkJU72SodQc0FM5mqqNN42Vx+X4EutOfvQuRGlI= =MlAY -----END PGP SIGNATURE-----