From nobody Thu Sep 19 15:48:49 2024 X-Original-To: freebsd-security@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 4X8g0x6LStz5X8RG for ; Thu, 19 Sep 2024 15:48:49 +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 4X8g0x3z1Lz4Qb1; Thu, 19 Sep 2024 15:48:49 +0000 (UTC) (envelope-from security-advisories@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726760929; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc; bh=BJNKaD5q2HZcveB+sT+jmRqRYb5p5lxHsO/6QsTd4nc=; b=jrM7XpvY1Sqp3i1lHlGwIO4wT65HHxJ7RX4KdRSlPcpna19E7qfLEWTEn26ozAF/pmybYN x98XpfFmjEQ5RbhYFlqhn19wUMpjexjKbs8Zn5AA/6MUyUd8H5LZ1c0vgtsREwV+NqxQqz a7qBZknnU9/tjSZEuUE8Ntjz4qJrrNFbuNFw6KdBFLMAP6y7dWS9XboSmbpBw5Sf2PAXcd qWhB+dptd4tgUXRk9W4icJdPOnSuJL3oEcCOFlvh5nmGqyRQfGS7Fc93XhlRfslaOm8+81 oBxVQ0z3gkbBuY0pJ4W9H1Knjoh8QEtLqXVYZvezJqvZ37/OI72wr/Fx+yMmrg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726760929; a=rsa-sha256; cv=none; b=Y2sHlu4rkl4IEjQ0XwxULx7pCQW40NLvYY7PMu82VaAbECz5Z89gf0G81D9OE3DXjyUY7g m00ApnQI51Rw7zEQpFend0bSBh/dgFAgJRpoyaZ7N498t5oIPdsbXgJBaGh93MDgZLe3q7 Rk5f/z4Vlq0oYn0xDp0GFOz1k41Q+7ZuDPWJvRwPvaDUCBDBfpLKgFw/c/UAbE37tea8d2 8tG5+s3t1KCCgugynU5q7pIX2kRdEdC+Bv1Uum4ePqCXilL9kWr6XCptgYaTYnkVBRWo9u 8EeneliTbv9EupvqlASSaAvx27dj5u5z/DQR3O0Z+KGV8fdMB/CtmK/RtB3jMg== 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=1726760929; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc; bh=BJNKaD5q2HZcveB+sT+jmRqRYb5p5lxHsO/6QsTd4nc=; b=ya9v3aD80SVca9Cs8mOP1obhHPvsPQr3ZeZpCfoZ2eCpaaSUq19+gtHDRHlwX4i6PW8PuC YDuoz6LEM4Wd2tnFe4R+rm7F6AFjG9uWaOABYi9hvL+mxqNz0JA7tGcE6JpUsdFrBCzus8 iPM3Mj/ERiFa4oQgqc5hWgWU7+Avkau9ItrzRCfZ5rDiQfOxDsRyxq8WPj1lk3+Zg4SUce xWk7/Ie3gLD8+bUkqBgfD0E0rjhFjwvHwxOmQgr8ssgSwkVmpR9XB+CYra+auA1qibruLe S8uFSiJ9DDuPO1RgiVgl48klnxc2wgQDCxK/2as+zCrN2rDbflVzTsPluQsQxA== Received: by freefall.freebsd.org (Postfix, from userid 945) id 70DA91C274; Thu, 19 Sep 2024 15:48:49 +0000 (UTC) From: FreeBSD Security Advisories To: FreeBSD Security Advisories Subject: FreeBSD Security Advisory FreeBSD-SA-24:15.bhyve Reply-To: freebsd-security@freebsd.org Precedence: bulk Message-Id: <20240919154849.70DA91C274@freefall.freebsd.org> Date: Thu, 19 Sep 2024 15:48:49 +0000 (UTC) List-Id: Security issues List-Archive: https://lists.freebsd.org/archives/freebsd-security List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: freebsd-security@freebsd.org Sender: owner-freebsd-security@FreeBSD.org -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 ============================================================================= FreeBSD-SA-24:15.bhyve Security Advisory The FreeBSD Project Topic: bhyve(8) out-of-bounds read access via XHCI emulation Category: core Module: bhyve Announced: 2024-09-19 Credits: Synacktiv Sponsored by: The FreeBSD Foundation, The Alpha-Omega Project Affects: All supported versions of FreeBSD. Corrected: 2024-09-19 12:40:17 UTC (stable/14, 14.1-STABLE) 2024-09-19 13:30:18 UTC (releng/14.1, 14.1-RELEASE-p5) 2024-09-19 13:30:44 UTC (releng/14.0, 14.0-RELEASE-p11) 2024-09-19 12:48:52 UTC (stable/13, 13.4-STABLE) 2024-09-19 13:35:06 UTC (releng/13.4, 13.4-RELEASE-p1) 2024-09-19 13:35:37 UTC (releng/13.3, 13.3-RELEASE-p7) CVE Name: CVE-2024-41721 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 emulate devices on a virtual USB controller (XHCI), such as USB tablet devices. An insufficient boundary validation in the USB code could lead to an out-of-bounds read on the heap, which could potentially lead to an arbitrary write and remote code execution. III. Impact A malicious, privileged software running in a guest VM can exploit the vulnerability to crash the hypervisor process or potentially 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 XHCI emulation 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 emulating USB devices with XHCI 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:15/bhyve.patch # fetch https://security.FreeBSD.org/patches/SA-24:15/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/ 419da61f8203 stable/14-n268745 releng/14.1/ 3c6c0dcb5acb releng/14.1-n267716 releng/14.0/ ba46f1174972 releng/14.0-n265453 stable/13/ 2abd2ad64899 stable/13-n258347 releng/13.4/ 5f035df278cc releng/13.4-n258258 releng/13.3/ e7a790dc3ffe releng/13.3-n257468 - ------------------------------------------------------------------------- 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----- iQIzBAEBCgAdFiEEthUnfoEIffdcgYM7bljekB8AGu8FAmbsPQ0ACgkQbljekB8A Gu/6chAAzST6xGx6RCb7MAHeZbqE3mTTUFoEkElPG3OiFsnFDySDnk0kKIjCNRbq GssLGYfUerFYD4/jDhGLApZnBnPhaTruNgwi38d8Pg4pkcqGv8Y5xSdOQBN83Rjq WiEgRqysuaE6HhvNN+JYf690M1Z6Tz0WkqoUJa8ZB8WcDnvBNQwMM0Prmo1RTZGR UXxftj+is3EQFUQs/3GcPRzTcp8Cu5QZnfFdbGph6Da/ZIQ6NaslYgslWvmsYHzP AVb/WI54VnIuMVoRIDWGtjjQa8p2H+dRih67clZYFxl2ya85aK78UrrtPk8x4dci 9KsISpKidqC/ofdT4mHpNH3Uxx4N2ymPJG6xJ/MGmDmrIIk1vjKejy9RVSJzt4QN Iu1u/8d5NVXsMxbKQMEKqXY2dPFKi17S+EnhKzJUjtXeBxcMbNPh2Xcl+BmI8cZ2 WuJvfplzu5Wcvd3LUa7s0Z3AHKktiMr1IGIlk8XEEee0b7k164imZlRUZFTCYA6S dNGTQ2UcHZz7W2Sk2HZf8CdNEgQQftW0BDc2IIs3lyA2WyPsIjGByUl987k3veQa fQCXzf7cp/a0rOZ9KngMxdJap+TBKCsPLEFm46i074ngmuoJZsW3xd7ZD8hLFlPX eaKh5MjWsHHfTYPRxeUKk2j9dobzN1ZP7AYWDasaDxZ4kmVIuEE= =FVQ2 -----END PGP SIGNATURE-----