From nobody Wed Nov 8 06:49:44 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 4SQG0n2CWnz506Jy for ; Wed, 8 Nov 2023 06:49:45 +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 4SQG0m6pg2z3GRN; Wed, 8 Nov 2023 06:49:44 +0000 (UTC) (envelope-from security-advisories@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1699426185; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc; bh=b5bmOjktNT56Tb9kaWgvwNuvEHvZD8L5kspKUw9pr1A=; b=Sxaps2ixxoioigpCtOQUOcw8nxri/keC8v93JsNGQAJy7TtzyQ5X4hHFv4JYWE3FAqes0+ kRpkgqlxu4oJJ/8XOC1lS5YQfRz25/e1zb/blfzNw0RtYUJxshxEBVRHPs9A4+roqUDMfk NLsaengob8YTGUwCROQb1aYSIYQGMuKHYg9RSwDsYRsM2b8PrBsMk3NY0tnxKkRtgm2pNO D1CMDOV2iCOWiY7d043XecNUWJ2/j3ZEE08CoDTrPSZRbHYLrqbgZTzdu7NbK78YegzQB4 qhYJBtpFuVvwqQmx/yZ5oF71Yx0aCaf8CViBpDLbmtQK12yF/HIJ4JQvgxV2sw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1699426185; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc; bh=b5bmOjktNT56Tb9kaWgvwNuvEHvZD8L5kspKUw9pr1A=; b=geKaXXcCahDTKz+3ycIbytQ4lU8hKpvUdNh6u+OJqYbSSl+7jH0o0LT9eFbzkKS4m9kwGS PE72+PsBBXkDmUxjc2GizL7s5zR7WamNuQsa1mDdiVkkwcmUcdX5+wq1aTDE3XgS+l6tNu E6nFhJaKfL0+61GScLfGyhJfkHzB8bidQE9hWtx1n3LIA58HBXXjPhqWOVj2oXPfmUoLnd lnAmEkG1OErPuS10YAmwDPt2p9z/vEQiFGHOkFsa9CwEhaCNjdolFgCbO4gx/15xHMsgml TGmjAyZ7bo5kAdgCT3Bb6akVNyn2pCRwLqERLSYeDzXo4iHsClb/sVqd10lrZQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1699426185; a=rsa-sha256; cv=none; b=FTKbw4eWICGxuaXalNWZoDlGTGBGEIvogija3v1n7KRUxkXLgx8BBfSWi7B2Bz7kL+J7Lm Ie5cMPPz0p3i2B1Ql1ZQSsaMqx5QGeFFdrSDrA5z458WvJtFM3/vwJekqRzbUdhXGOfqPi pdVuucT+LnxR+1OLfuqcF7ZsRU+96KL738MPgodx1pE/BUoM6RFuFSY2El6nYDQMKPVj65 MSsK3qZEPz0fHNS/5J2QwBJRiJydsfOIoHtHO9Nmzze7CCve2pdjEhL1APPm7t57+T1ukZ 843MAt1gDMihR4EyvttQ3RXsEqxb9WIonjRB/MipHkXc/1tgev/LdV8NojPTPQ== Received: by freefall.freebsd.org (Postfix, from userid 945) id BF6B61A24E; Wed, 8 Nov 2023 06:49:44 +0000 (UTC) From: FreeBSD Security Advisories To: FreeBSD Security Advisories Subject: FreeBSD Security Advisory FreeBSD-SA-23:15.stdio Reply-To: freebsd-security@freebsd.org Precedence: bulk Message-Id: <20231108064944.BF6B61A24E@freefall.freebsd.org> Date: Wed, 8 Nov 2023 06:49:44 +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:15.libc Security Advisory The FreeBSD Project Topic: libc stdio buffer overflow Category: core Module: libc Announced: 2023-11-07 Credits: inooo All supported versions of FreeBSD. Corrected: 2023-11-07 17:29:20 UTC (stable/14, 14.0-STABLE) 2023-11-08 00:45:25 UTC (releng/14.0, 14.0-RC4-p1) 2023-11-07 18:41:49 UTC (stable/13, 13.2-STABLE) 2023-11-08 00:48:03 UTC (releng/13.2, 13.2-RELEASE-p5) 2023-11-08 14:30:51 UTC (stable/12, 12.4-STABLE) 2023-11-08 01:09:31 UTC (releng/12.4, 12.4-RELEASE-p7) CVE Name: CVE-2023-5941 For general information regarding FreeBSD Security Advisories, including descriptions of the fields above, security branches, and the following sections, please visit . I. Background The FreeBSD C library (libc) Standard I/O (stdio) component provides essential functionality for input and output operations including file handling and buffering. It includes functions like "fopen", "printf", and "fflush". Streams may be unbuffered, line buffered, or fully buffered. The library writes buffered data when the buffer is full or when the application explicitly requests so by calling the fflush(3) function. II. Problem Description For line-buffered streams the __sflush() function did not correctly update the FILE object's write space member when the write(2) system call returns an error. III. Impact Depending on the nature of an application that calls libc's stdio functions and the presence of errors returned from the write(2) system call (or an overridden stdio write routine) a heap buffer overfly may occur. Such overflows may lead to data corruption or the execution of arbitrary code at the privilege level of the calling program. 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. 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 # 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. [FreeBSD 14.0] # fetch https://security.FreeBSD.org/patches/SA-23:15/stdio.14.patch # fetch https://security.FreeBSD.org/patches/SA-23:15/stdio.14.patch.asc # gpg --verify stdio.14.patch.asc [FreeBSD 13.2] # fetch https://security.FreeBSD.org/patches/SA-23:15/stdio.13.patch # fetch https://security.FreeBSD.org/patches/SA-23:15/stdio.13.patch.asc # gpg --verify stdio.13.patch.asc [FreeBSD 12.4] # fetch https://security.FreeBSD.org/patches/SA-23:15/stdio.12.patch # fetch https://security.FreeBSD.org/patches/SA-23:15/stdio.12.patch.asc # gpg --verify stdio.12.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 daemons that use the library, or reboot the system. 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/14/ abe12d2f4ce3 stable/14-n265706 releng/14.0/ 1f9c4610dde5 releng/14.0-n265376 stable/13/ 59ec3ffdd7ce stable/13-n256680 releng/13.2/ d51a39b13ee4 releng/13.2-n254639 stable/12/ r373263 releng/12.4/ r373265 - ------------------------------------------------------------------------- For FreeBSD 13 and later: 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 For FreeBSD 12 and earlier: Run the following command to see which files were modified by a particular revision, replacing NNNNNN with the revision number: # svn diff -cNNNNNN --summarize svn://svn.freebsd.org/base Or visit the following URL, replacing NNNNNN with the revision number: VII. References The latest revision of this advisory is available at -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEthUnfoEIffdcgYM7bljekB8AGu8FAmVLKaIACgkQbljekB8A Gu/MXBAA1Aayy2tPhgpV7uwRZWHKLsda8Am0/7Ok6fswejrxntVIlOwg+Vyo1pTW ojDTG2HS9BovXwdhWdSEObNwk+KxZlF8YIYHMOv5HyU4/iTxiBYVUjnk14J0YQAw mywyBjOyULXv1gOlvA8FUMk6M8I/RE9fN8dR0D6xHwdY/a/LUbpqqo3H7fftF5D7 CVZy4Uw0rSJXvJEZIWhgbaqKRyjydXoClX4NS/aMEfLFGDcSQtblVotUVpDedsRZ uhVKLibhNqoaausR75oLB6izclHQXzXz3eh7UefM7Udz4R/M8IfFtxwtpsWl3KGH bB/2BfrWgrj6Emhmy455NShd7YDcw4VdIZZUVwofS8kmw9NMxvtU2EgdFp/TITMD fo/XqMtrwpNTjuyWPY9xM41QansEeidhVBeHsA6B8kmsiZ1XVo8uaAmj5aHldEZx TCCVWOlg8D/OnHHtOY0nBz50f57Lt8z2UcSlR3nZL/wRgxsGDdwh1doeFJupIxbE 1ZS6x4DoQInUhVNTXmSngMCfNOywatVCaOnS2swZETEawI4xAYKUHVJswpA3E0R4 MhUEo5gk2dEYhuvvr51eewvNSE9mIt7rPhNxhSU7hioraWkdLqE7rUkv9eeaSOOu BWaAaCnyS/Vft6aC5nqTg/+2EeRPNJg7JkTHl+pu00h3Y+Q2g48= =wgNS -----END PGP SIGNATURE-----