Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AFB8731AA82 for ; Wed, 24 Dec 2025 10:58:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766573894; cv=none; b=gw5Qs6rmk44vUZtvj3x3Bb+pLxgbG94EYaX0J0XWkOohfJA57fhLDnznU9qwhocbzV5cAjS4R2amTFntXEddRsNuUrO4GBhNSaCVbQg3Zh0FD4SoVV+WqVPwTKP4tE+13ZLr/11C+Oo8LXon6Tlvh+7Wz5HLWzanzb4JJgSuK40= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766573894; c=relaxed/simple; bh=EuTp0EkrTv/dc1GVSDbK1ljGJTrtHhhkEKsMOVHO98w=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=fShoWwJY9PQ85R1OPqWhQTK5DZt3VGKnApnrIhtwVKqXHnCV5QD34k55lhCxss+CtS6nwseL27xL+AfcvVO6bHuD204hft+bB3bS2hFNKEArGva861SGslfPCgOgqGKFiUFQNn3ATQe5+FBRRTd0Icu9r/eAcCY/SXlqCEE8Qiw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=NuoFOBTk; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="NuoFOBTk" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 34BD5C4CEFB; Wed, 24 Dec 2025 10:58:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1766573894; bh=EuTp0EkrTv/dc1GVSDbK1ljGJTrtHhhkEKsMOVHO98w=; h=From:To:Cc:Subject:Date:Reply-To:From; b=NuoFOBTkrZQK9lnJMtP24OzedHVLXKAAXnyTHNqmzCzAHNrzplpYhpY8u/6QljOCp M3XZwqKmeX8C3KxTNSzYfjHwk4/9ZHTkyC7hnnvh9B2x7CQFyNIyUCbymI2+uFltvV fLyWYvonbI8peuYIZiMoWZ9R22lTvIjnZ/Lif6IA= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2023-54006: af_unix: Fix data-race around unix_tot_inflight. Date: Wed, 24 Dec 2025 11:56:50 +0100 Message-ID: <2025122428-CVE-2023-54006-d646@gregkh> X-Mailer: git-send-email 2.52.0 Reply-To: , Precedence: bulk X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=5397; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=+qukRH45JTRBiD3jRR1uweMy7+ylQmfAtR35lqFPgTM=; b=owGbwMvMwCRo6H6F97bub03G02pJDJnex+5aam5/8GRN45zsjYIKdxdpH9JeHy7v7ux1OWVZd bx5xxr5jlgWBkEmBlkxRZYv23iO7q84pOhlaHsaZg4rE8gQBi5OAZjInRyG+cndRoXnVSUSowx/ 9lkqv0q7c/r8WYY5vK7iirsT9prM3P7/apOIVK/G3NhyAA== X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit From: Greg Kroah-Hartman Description =========== In the Linux kernel, the following vulnerability has been resolved: af_unix: Fix data-race around unix_tot_inflight. unix_tot_inflight is changed under spin_lock(unix_gc_lock), but unix_release_sock() reads it locklessly. Let's use READ_ONCE() for unix_tot_inflight. Note that the writer side was marked by commit 9d6d7f1cb67c ("af_unix: annote lockless accesses to unix_tot_inflight & gc_in_progress") BUG: KCSAN: data-race in unix_inflight / unix_release_sock write (marked) to 0xffffffff871852b8 of 4 bytes by task 123 on cpu 1: unix_inflight+0x130/0x180 net/unix/scm.c:64 unix_attach_fds+0x137/0x1b0 net/unix/scm.c:123 unix_scm_to_skb net/unix/af_unix.c:1832 [inline] unix_dgram_sendmsg+0x46a/0x14f0 net/unix/af_unix.c:1955 sock_sendmsg_nosec net/socket.c:724 [inline] sock_sendmsg+0x148/0x160 net/socket.c:747 ____sys_sendmsg+0x4e4/0x610 net/socket.c:2493 ___sys_sendmsg+0xc6/0x140 net/socket.c:2547 __sys_sendmsg+0x94/0x140 net/socket.c:2576 __do_sys_sendmsg net/socket.c:2585 [inline] __se_sys_sendmsg net/socket.c:2583 [inline] __x64_sys_sendmsg+0x45/0x50 net/socket.c:2583 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3b/0x90 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x72/0xdc read to 0xffffffff871852b8 of 4 bytes by task 4891 on cpu 0: unix_release_sock+0x608/0x910 net/unix/af_unix.c:671 unix_release+0x59/0x80 net/unix/af_unix.c:1058 __sock_release+0x7d/0x170 net/socket.c:653 sock_close+0x19/0x30 net/socket.c:1385 __fput+0x179/0x5e0 fs/file_table.c:321 ____fput+0x15/0x20 fs/file_table.c:349 task_work_run+0x116/0x1a0 kernel/task_work.c:179 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline] exit_to_user_mode_loop kernel/entry/common.c:171 [inline] exit_to_user_mode_prepare+0x174/0x180 kernel/entry/common.c:204 __syscall_exit_to_user_mode_work kernel/entry/common.c:286 [inline] syscall_exit_to_user_mode+0x1a/0x30 kernel/entry/common.c:297 do_syscall_64+0x4b/0x90 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x72/0xdc value changed: 0x00000000 -> 0x00000001 Reported by Kernel Concurrency Sanitizer on: CPU: 0 PID: 4891 Comm: systemd-coredum Not tainted 6.4.0-rc5-01219-gfa0e21fa4443 #5 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.16.0-0-gd239552ce722-prebuilt.qemu.org 04/01/2014 The Linux kernel CVE team has assigned CVE-2023-54006 to this issue. Affected and fixed versions =========================== Issue introduced in 2.6.24 with commit 9305cfa4443dbfb99faf35c5603ec0c0e91b5ef8 and fixed in 4.14.326 with commit 31b46d5e7c4e295bd112960614a66a177a057dca Issue introduced in 2.6.24 with commit 9305cfa4443dbfb99faf35c5603ec0c0e91b5ef8 and fixed in 4.19.295 with commit 20aa8325464d8905450089eed96ca102a074d853 Issue introduced in 2.6.24 with commit 9305cfa4443dbfb99faf35c5603ec0c0e91b5ef8 and fixed in 5.4.257 with commit 5d91b7891f4a9a9d69d75e9f44ab4bf1f3b11840 Issue introduced in 2.6.24 with commit 9305cfa4443dbfb99faf35c5603ec0c0e91b5ef8 and fixed in 5.10.195 with commit cf29b42766ad4af2ae6a449f583796951551b48d Issue introduced in 2.6.24 with commit 9305cfa4443dbfb99faf35c5603ec0c0e91b5ef8 and fixed in 5.15.132 with commit e5edc6e44a882c0458878ab10eaddfe60ac34e57 Issue introduced in 2.6.24 with commit 9305cfa4443dbfb99faf35c5603ec0c0e91b5ef8 and fixed in 6.1.54 with commit 2d8933ca863e252fb09ad0be483255e3dfeb1f54 Issue introduced in 2.6.24 with commit 9305cfa4443dbfb99faf35c5603ec0c0e91b5ef8 and fixed in 6.5.4 with commit afc284a4a781defbb12b2a40427fae34c3d20e17 Issue introduced in 2.6.24 with commit 9305cfa4443dbfb99faf35c5603ec0c0e91b5ef8 and fixed in 6.6 with commit ade32bd8a738d7497ffe9743c46728db26740f78 Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community. Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at https://cve.org/CVERecord/?id=CVE-2023-54006 will be updated if fixes are backported, please check that for the most up to date information about this issue. Affected files ============== The file(s) affected by this issue are: net/unix/af_unix.c Mitigation ========== The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits: https://git.kernel.org/stable/c/31b46d5e7c4e295bd112960614a66a177a057dca https://git.kernel.org/stable/c/20aa8325464d8905450089eed96ca102a074d853 https://git.kernel.org/stable/c/5d91b7891f4a9a9d69d75e9f44ab4bf1f3b11840 https://git.kernel.org/stable/c/cf29b42766ad4af2ae6a449f583796951551b48d https://git.kernel.org/stable/c/e5edc6e44a882c0458878ab10eaddfe60ac34e57 https://git.kernel.org/stable/c/2d8933ca863e252fb09ad0be483255e3dfeb1f54 https://git.kernel.org/stable/c/afc284a4a781defbb12b2a40427fae34c3d20e17 https://git.kernel.org/stable/c/ade32bd8a738d7497ffe9743c46728db26740f78