From nobody Tue Aug 01 21:38:10 2023 X-Original-To: freebsd-announce@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 4RFpPg06DXz4psxb for ; Tue, 1 Aug 2023 21:38:11 +0000 (UTC) (envelope-from security-advisories@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (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 4RFpPZ1q9kz3Nkw; 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=swdAiu4upLZ460aPf3O47YCHsPQMapaVMUhJfSs/cIx253PhuWPPTchn+dxc351z5MvNHT v3hXNL6YhbwA4rKEn/R1cHDlWCOxHovIoz1VewsaLau8+UOtPirgCTkg+Tpvlg/3MLr9aE Wg/AwHWzxzBMs67F7V1NcSNsqjGkZXCo4Lj85yCGipn296gamiCRUemYW1fdj4w2+PekK0 xWFzk4a1lAwEooJsHISwWKvnFU8XijR9sOSNHJo4084ncZT+tjzJKxOkVgOHD6als8ACuM 5n7xzU2NQNrMU+aJ03/ujy8jki+L9s1LHMiWnSFS08RZ2iqb7izViuOEXYul6w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1690925890; a=rsa-sha256; cv=none; b=fdfcgs022xlMKrENYsgdu7Bv/MHJ8bnFDkJ8Z3z9594c1oNksLWMQclO6VuGFQt8JwGiGN dtGeYtIo3GnoVNS1u7XHPy0FcdmGszdr5zyASeSxB86JA6d+PJZ1LH6MW6ipWiANZZsTcv aK4l9Jul/xmGpG7pToDY1UiW7r1qiXMk6jCr1lVWlpOtawgCOBWDlhowaCVUX6BvZqwl0b 0xJMHsfH4fcMLs+hRXWZdDHAjiD89mxe1euM43skddXbRcfCf7qvsK3Ar6mfPG8JVxWbvW lmX7Ljxyo5RN3AL9bMI0TE8EIqlT0ASgtmuCftMBGtt/3bk0AK7vp3e66lWhAQ== 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=mTJwz7thOSQ9kwRjYYUfYqf9+T+gJ7d7GJRQCYX3FqzT6TiyzgNmd6P1OM/XdbNwL8AvWr d1kyJiGP1suj++2Oo5KA+UPeUrSHClf8afN6HN3gaSA7xYP8XYwpnr3FajNYrUkgpDq0i7 msAxQq5G03OGvq/Wd7V7mmDAecz+/WPeqBLC2E/QNujuJQ6YUurdjXIjma6FYuysPHRxjR S9tWjiwJmO8ZpgaZLyRGGwVIDPB6CsCMhKwN19tijI1FTIYUwcp8YPN3cQEgW3dcQBRZm5 chnn5tVGqcVbpUKYn3/y94q84+r9+xihX38EDTnTLHynzotEVVBKIAaAAc9rkg== Received: by freefall.freebsd.org (Postfix, from userid 945) id 0E48D19D3E; 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.0E48D19D3E@freefall.freebsd.org> Date: Tue, 1 Aug 2023 21:38:10 +0000 (UTC) List-Id: Project Announcements [moderated] List-Archive: https://lists.freebsd.org/archives/freebsd-announce List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-announce@freebsd.org X-BeenThere: freebsd-announce@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-----