From nobody Wed Sep 04 23:37:14 2024 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 4Wzf6M0wH4z5Vrf8 for ; Wed, 04 Sep 2024 23:37:15 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Wzf6L5TLnz43F8; Wed, 4 Sep 2024 23:37:14 +0000 (UTC) (envelope-from security-advisories@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725493034; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc; bh=m1Cpd1Aj0GPEezgbQ0x/T2BZ/WefwsqLvSzT6p8WWe8=; b=wbD6pYNkhwVg4cbrm6FCFlGbkeK4v/NIT1aXEGz6tPMqq/sNJ0TpDgW/j4f1HIIfXijarV YVD9oOGpGrbHKUpen5SIvAYDD2cPbGK+8LP9yBLYkdvBys+RKMkZNZ2tfo9QdSZncq/CL4 +mNyUfBir/SjV7Sl0BVGi+k2SkhMn3QrWeUar9iu3RjPXdS6yKAbYibL1s0PwxNxz+YvZx NQmogbNlfswpjBOflojjmAu+DisqU+h8bEniVEJrybkS0JVAMgkVA4XmKdYXSB48i6nJUf gxHgTjrtUhiVNoqHHU8feQ9cZN21qYDPpcpSd5oFhYBbA+7I5LxY2d1cbzEUzA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725493034; a=rsa-sha256; cv=none; b=ZjCBCH7nReu6GesjeMjvBlwMKsGpGR5SytCgQVZHmpfjLJLQr2JQ1s2CEcqX5Ct1Bwjcaw VNZ9pyhvEPJ867xjL8BFuuRgbcyStj0LMVtvJoZn7FSnVUu0esfmKbg3v9OqpXrq6O5mDP 6OR7j4YQIsmBW7Jaw4iHFs2zPYW4GFFFu4BXzn120io2Lyqs24pz5Dus0MtPrNcMVLJl4D qjdHXJGxaMhGWhDrumJTtKq2y81sfXEL+LTbqkHs3OOzn+W0E95wy49ELD9g1MBZ18BHDD 9nqxpujJ0YD6TDNsd3IGC3Ldaiw4LumYsbpd95F7Ld9WPiTtRgdav/+m4FE8zQ== 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=1725493034; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc; bh=m1Cpd1Aj0GPEezgbQ0x/T2BZ/WefwsqLvSzT6p8WWe8=; b=akVezUhT1NIuGS4P2HLzE2GxkSodkSOIrbY4/PW3sPjHEBwUzDeYWvGeTyc/VXDo0cjlmR QtfEYEpvX0Kdp0kMs1FbDRybE0aiWucYXmAMWl4eoOMeYPdKdIQjlVtoVXpLjX4/LLdG8J 5C43nQdjhMSmtSApuwtVTUXoKro60Dqz+T+ik13oBWlmtgW6dW2Pqn7QmAHuSg8Xmhpzam PLSW+EypS+BhPpIJy4MQ7cAunpMcs01z0wzDmB2ac7qLb26Iw6guSpOIxh6+gmv8iuBliJ k5w/XUuJpStDyo3UJ6Txzr8/XMs0kqXIXuFn7/HDOB9NHPuO93xyswKozr2VUQ== Received: by freefall.freebsd.org (Postfix, from userid 945) id 84D5E2724A; Wed, 04 Sep 2024 23:37:14 +0000 (UTC) From: FreeBSD Security Advisories To: FreeBSD Security Advisories Subject: FreeBSD Security Advisory FreeBSD-SA-24:10.bhyve Reply-To: freebsd-security@freebsd.org Precedence: bulk Message-Id: <20240904233714.84D5E2724A@freefall.freebsd.org> Date: Wed, 04 Sep 2024 23:37:14 +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: X-BeenThere: freebsd-security-notifications@freebsd.org Sender: owner-freebsd-security-notifications@FreeBSD.org -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 ============================================================================= FreeBSD-SA-24:10.bhyve Security Advisory The FreeBSD Project Topic: bhyve(8) privileged guest escape via TPM device passthrough Category: core Module: bhyve Announced: 2024-09-04 Credits: Synacktiv Sponsored by: The FreeBSD Foundation, The Alpha-Omega Project Affects: FreeBSD 14.x Corrected: 2024-09-04 15:42:29 UTC (stable/14, 14.1-STABLE) 2024-09-04 21:07:28 UTC (releng/14.1, 14.1-RELEASE-p4) 2024-09-04 20:54:13 UTC (releng/14.0, 14.0-RELEASE-p10) CVE Name: CVE-2024-41928 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) is a hypervisor that runs guest operating systems inside a virtual machine. II. Problem Description bhyve can be configured to provide access to the host's TPM device, where it passes the communication through an emulated device provided to the guest. This may be performed on the command-line by starting bhyve with the `-l tpm,passthru,/dev/tpmX` parameters. The MMIO handler for the emulated device did not validate the offset and size of the memory access correctly, allowing guests to read and write memory contents outside of the memory area effectively allocated. III. Impact Malicious 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, but guests that do not use TPM passthrough are not impacted. V. Solution Upgrade your vulnerable system to a supported FreeBSD stable or release / security branch (releng) dated after the correction date. Guest operating systems exposing the TPM device need to be restarted for the correction to be applied. (i.e., their corresponding bhyve process needs to be terminated and started again) 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 or arm64 platforms, or the i386 platform on FreeBSD 13, can be updated via the freebsd-update(8) utility: # freebsd-update fetch # freebsd-update install 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. # fetch https://security.FreeBSD.org/patches/SA-24:10/bhyve.patch # fetch https://security.FreeBSD.org/patches/SA-24:10/bhyve.patch.asc # gpg --verify bhyve.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 the corresponding bhyve processes, or reboot the system. VI. Correction details This issue is corrected as of the corresponding Git commit hash in the following stable and release branches: Branch/path Hash Revision - ------------------------------------------------------------------------- stable/14/ 6ce4821f0859 stable/14-n268656 releng/14.1/ eab723be7542 releng/14.1-n267697 releng/14.0/ 429f200688ca releng/14.0-n265434 - ------------------------------------------------------------------------- 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 corresponding part of the security audit report as provided by Synacktiv will be published in due course. The latest revision of this advisory is available at -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEthUnfoEIffdcgYM7bljekB8AGu8FAmbY54kACgkQbljekB8A Gu9vGg//YkEx8/3PWE8GUfdwfGrzMD+bpXoJViBIW+CX4tYYDU05CzF9i/FbB93B 629nWU4HMmTrQfARtpC/VCRASz+v6kSJvsOwt2120GVx5SUuFkP2nw3fCWdH5tqu c/M4GRT2Brl4ZJFZGdfXCKYvGKnw68qhuX6CWFhXgAPAlj2VHNCluElriGMsuPs9 mmu6/YX5vwVps8dj1XJqx8TFv81PXyatBbzmDi4VMpeBkcM6RBjzDl3C9XVh2k9S ahPVp9yW/bXLS2U5GA+rTK4PNIJukZ5tRb2DXH3g5Ku9l6s2l3b8oof6kNifhwf7 1L8QeTYabkeeGgCfpKmQb7ouZoAHw2fe6M64X/IAkWM46XejiV0mzRokjrG9VIPf Ushi7hnEbI7Kzxw/H280R/lgsQh/o8+fF+3iFDij/GPKoWlLVy4WnLluihXkE2Xd wlFxD80CKVxGi18JBjCIo7sFrLPuec1rGPn9sULCf2Yi5TnRnBYp9OzD7wSx5zIR ohm6zKfajdyVlis9HLm1Xee4B7dEEbZWn6seo3DclCTIO22esN3Kjs8ovSyv1KFn B0m0bR8YbJ0qVT/jDYdWkZmJW/EmmZpMMAN91G0q+M9m8Od4e81iQZknvujPsw+I QjM5FlKvEuYXjt2tMxP35Dq8PXdl3jvY0fqTNrkCpuzKK0q76sM= =VI0d -----END PGP SIGNATURE-----