From nobody Thu Sep 19 15:49:02 2024 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 4X8g1B5hJzz5X8cb for ; Thu, 19 Sep 2024 15:49:02 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4X8g1B3wszz4RCY; Thu, 19 Sep 2024 15:49:02 +0000 (UTC) (envelope-from security-advisories@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726760942; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc; bh=2FjUZgxBnUT6Al2jZ82pTZprEnjzBacYLGSUtY3h4+U=; b=mPtITLYiNB3eXfxUPq02IKBqNkJu0tfLJ5RCarjJhA2GKO8EwXf3d4vlLCJcLbX6cQn4nN gA0pJvkGeGAw4WXG/3mh3gODmEFUYJpoAIgRqo83evHjrLsKuHA9Z85r2Q3d90syYSV8x8 x1hQWsRgDDLW6vxAN71fDaXh3Hh7lm5ZJA4298hHeZpc5GY5exTO0eEkHHmV3Vn09nECew kxPHH1NjjQu75tf+L2PM/2H3vdWYTs5y6bQhlxyevAVtEar6jJgWslo8ClauloC4zLMG8A z4asvt+v71BHV0sBTv2c3DzHMqz2+Iteq+OM4vCa56KuWH3QmWII6IUnFkIAsQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726760942; a=rsa-sha256; cv=none; b=cOrzKmYyT16qTJImWYIPbuBZNizgO8ZUdCU6khYwFlvMuWoaKejTtA6oZFa9MNBEbja7rq xinEXbxJuQnGXFEMfvQS+BD1cJlrQnDNp6cZQJL6q77+ityuYhIsyd9DQmyFVnOZMpy3Mi fIICjVGmMSTCxZElBSdfUvA+DVKXAuZEELNnu3o6He4qeJ/bj3nnaxFCI4xjOh/3BPFSXu oyb56UfnW7cq83aQXwAbN1wJ15fgyvhfPi0JJBU9/jt9nvqcpLDkkILgL6RPQ1TUMOQzgj NDAK+cOK+8p4tXfnAZqBxukoJFr2tC0AgIoS5NBR+IC9PN2rTW9MLYVD2hH1Wg== 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=1726760942; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc; bh=2FjUZgxBnUT6Al2jZ82pTZprEnjzBacYLGSUtY3h4+U=; b=nwAkGApceQnS48W8LWR6/cVt5Tcnn3sUjnqSaNpI2RDY1XFxmTrVTuLNvCMAKYrVOudHW0 vcxut356YKMOyMC1Md240tPxaLy0vAPA14FeUQscc9i7ZTeIxUr7ADhI/k0HqwVuwQ445c x4uq1PUQLVber2TF+96mCgKe2Bozhpd2aXXfbwVXfe3Wh1G5atBeuVcjexLng/ol5h7nPo v+oZ05Y62278d6TDcQW0/p7vYQ/zpGLjgH05ScRUaWvl/HiJmowEWt3MLa2bx+KndEnB+3 aa8udTHk84RdxFne6PHboqVh6LXm1GF3yD94BR/isfkmWTkowvVy4RUgSRwMjA== Received: by freefall.freebsd.org (Postfix, from userid 945) id 6541C1C2FA; Thu, 19 Sep 2024 15:49:02 +0000 (UTC) From: FreeBSD Security Advisories To: FreeBSD Security Advisories Subject: FreeBSD Security Advisory FreeBSD-SA-24:16.libnv Reply-To: freebsd-security@freebsd.org Precedence: bulk Message-Id: <20240919154902.6541C1C2FA@freefall.freebsd.org> Date: Thu, 19 Sep 2024 15:49:02 +0000 (UTC) List-Id: Project Announcements [moderated] List-Archive: https://lists.freebsd.org/archives/freebsd-announce List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: freebsd-announce@freebsd.org Sender: owner-freebsd-announce@FreeBSD.org -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 ============================================================================= FreeBSD-SA-24:16.libnv Security Advisory The FreeBSD Project Topic: Integer overflow in libnv Category: core Module: libnv Announced: 2024-09-19 Credits: MiƂosz Kaniewski Affects: All supported versions of FreeBSD. Corrected: 2024-09-15 16:59:15 UTC (stable/14, 14.1-STABLE) 2024-09-19 13:30:20 UTC (releng/14.1, 14.1-RELEASE-p5) 2024-09-19 13:30:45 UTC (releng/14.0, 14.0-RELEASE-p11) 2024-09-15 16:59:51 UTC (stable/13, 13.4-STABLE) 2024-09-19 13:35:07 UTC (releng/13.4, 13.4-RELEASE-p1) 2024-09-19 13:35:38 UTC (releng/13.3, 13.3-RELEASE-p7) CVE Name: CVE-2024-45287 For general information regarding FreeBSD Security Advisories, including descriptions of the fields above, security branches, and the following sections, please visit . I. Background libnv (also called nvlist) is a general-purpose library designed for storing name-value pairs. This library can serve as an Inter-Process Communication (IPC) framework, enabling processes to exchange data. For example, it is used in libcasper to communicate between privileged and unprivileged processes. Additionally, libnv can function as an interface for communication between userland and kernel. Originally, libnv was inspired by OpenZFS nvlist. However, the implementations are separate. This advisory is only about base system implementation of libnv, not a OpenZFS one. II. Problem Description A malicious value of size in a structure of packed libnv can cause an integer overflow, leading to the allocation of a smaller buffer than required for the parsed data. The introduced check was incorrect, as it took into account the size of the pointer, not the structure. This vulnerability affects both kernel and userland. This issue was originally intended to be addressed as part of FreeBSD-SA-24:09.libnv, but due to a logic issue, this issue was not properly addressed. III. Impact It is possible for an attacker to overwrite portions of memory (in userland or the kernel) as the allocated buffer might be smaller than the data received from a malicious process. This vulnerability could result in privilege escalation or cause a system panic. IV. Workaround No workaround is available. V. Solution Upgrade your vulnerable system to a supported FreeBSD stable or release / security branch (releng) dated after the correction date and reboot. 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 # shutdown -r +10min "Rebooting for a security update" 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:16/libnv.patch # fetch https://security.FreeBSD.org/patches/SA-24:16/libnv.patch.asc # gpg --verify libnv.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 . d) Recompile your kernel as described in and 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/ 056c50c48be3 stable/14-n268739 releng/14.1/ f67468e6e5e2 releng/14.1-n267717 releng/14.0/ e9d57be06e23 releng/14.0-n265454 stable/13/ d84fced6b468 stable/13-n258342 releng/13.4/ 2cffa6354d9f releng/13.4-n258259 releng/13.3/ 417e81a40091 releng/13.3-n257469 - ------------------------------------------------------------------------- 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----- iQIzBAEBCgAdFiEEthUnfoEIffdcgYM7bljekB8AGu8FAmbsPQ8ACgkQbljekB8A Gu9aMBAA1N3FliBdeklIU0XGoyrvS0z7goFpFKeLVlkIHssYzZQAWHMILHET6O9n Gv5vICw5vGDWv/1Rb9muCMQ4wcEW/c/YFEU0FM3VFTgJ+fQrA4ZO/NjpRSixiGDk uVkJ25Fo2TMp58ITPWmT3Nj1MJ0x9xNzMxXhLk2JgK/sEMH+/Giju8Zq7XojHHC0 QluYmz1V3EClPXiArkcgt/pagQ24b5yYmOAKGQGHEdRM18QWeJzJ4kUBzATcUVjv RWkLHz69emH6aQ3JNwyuEQlK/Xda3ge2zMIJ4tYObg21dEFdgqnFoLFrylCUkgIE T86QPQfb0HGTRhnSjdh/NN5qyiOo9q4FzpIsI3eJ3XJgk0/T/O8Rv+2fexAm0g3+ 37kgkxohETi6RQc3D4ClpmW7bP1DEK8uUwUGeJgCNmkpE4DVpLmGZ0tNbSf/0Mk6 slYSHb6dF6wNB4AV/1HIusp6i2GlPziNYkhlslkRQgeyXO9T1bWxYqdkYihDFLRs PStlk1Diu0p+h3r08sX3LQrszBp1bLGkqaipFPLBwWStxYne9nsClORFhN4q9i+4 fAnWxIRBXH62fJTy1DCPFqpI9zyvQTkVHQVKu5d+JgaTmTPsfJ3MIXdkGdAEV6+m xbZSFwd2e8uzPIlZke2JmaT4xVv1T92lWu7Ywf8M0eEYWg5WQi8= =OHm5 -----END PGP SIGNATURE-----