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 998963B8BBF for ; Wed, 25 Mar 2026 10:34:19 +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=1774434859; cv=none; b=HGbZfbBMpPTPXCAZwH6ez64aEzqFO2NIOtGVajrOmdtT7vyX8DkAGSrrhXCSCptTD2AU8GIs2f9V/yv+r+tLJJwMhbBmgYnLQ9GeLvfjdf39LIOTnxJ7lZ/r85faYzcZ2+8HWoVA+gWMkHTnl/KAMLh7nr2ff9gW+k5h/41B3Rc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774434859; c=relaxed/simple; bh=yU03mgfS5pMg9QURWWdFr1wwC7ZV+Z//k2XAFx+iMCk=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=NunEF8z3n1xriRaifjvlQQPjfoekOfd7hHIt/bavO3H9UDwX8qahhZ2ypVvgNVigqyY5tcEdL+KrDVhbAlOuaxLG5osKG+e+xW9MQEZTX5agPlUm3Xe79GaDUTXXgLC3FuxD+L6X3AHax0K/CP3heW8lP+nthFyeeDt6ll9XpAo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=mCXpalM7; 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="mCXpalM7" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 25371C4CEF7; Wed, 25 Mar 2026 10:34:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1774434859; bh=yU03mgfS5pMg9QURWWdFr1wwC7ZV+Z//k2XAFx+iMCk=; h=From:To:Cc:Subject:Date:Reply-To:From; b=mCXpalM7TnHY9BSG5hAacWtl8rR1x4S4gyRfTrE7YguTQLU7+spqdT93gTBDVBpNO qOlR4TuBQ3kmhO9cv8oHpUmWaL4Q5HJaeIxedWasNY86NLo367d72EpoMMBQ9fJ29n MFSn7yzRCQzQu05ywGc17sSLBY/tPnyBpUHchrzU= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2026-23394: af_unix: Give up GC if MSG_PEEK intervened. Date: Wed, 25 Mar 2026 11:32:52 +0100 Message-ID: <2026032549-CVE-2026-23394-9205@gregkh> X-Mailer: git-send-email 2.53.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=4593; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=GANm+uo4Y2akA35mzWp1SdiHbnQo01grUoCH5V93oG0=; b=kA0DAAIRMUfUDdst+ykByyZiAGnDudGiohmMe8nKrKHI0ePcMYsz4Tw79OEfhd5oJATWBpRJm 4hdBAARAgAdFiEE9LYMxb94wiFKMT3LMUfUDdst+ykFAmnDudEACgkQMUfUDdst+ykjCQCcC3f9 ejDhaLd8s1UJVUHKINYv2eUAoJCHLjdTxyZwycTxmtyw90WTu9Vd 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: Give up GC if MSG_PEEK intervened. Igor Ushakov reported that GC purged the receive queue of an alive socket due to a race with MSG_PEEK with a nice repro. This is the exact same issue previously fixed by commit cbcf01128d0a ("af_unix: fix garbage collect vs MSG_PEEK"). After GC was replaced with the current algorithm, the cited commit removed the locking dance in unix_peek_fds() and reintroduced the same issue. The problem is that MSG_PEEK bumps a file refcount without interacting with GC. Consider an SCC containing sk-A and sk-B, where sk-A is close()d but can be recv()ed via sk-B. The bad thing happens if sk-A is recv()ed with MSG_PEEK from sk-B and sk-B is close()d while GC is checking unix_vertex_dead() for sk-A and sk-B. GC thread User thread --------- ----------- unix_vertex_dead(sk-A) -> true <------. \ `------ recv(sk-B, MSG_PEEK) invalidate !! -> sk-A's file refcount : 1 -> 2 close(sk-B) -> sk-B's file refcount : 2 -> 1 unix_vertex_dead(sk-B) -> true Initially, sk-A's file refcount is 1 by the inflight fd in sk-B recvq. GC thinks sk-A is dead because the file refcount is the same as the number of its inflight fds. However, sk-A's file refcount is bumped silently by MSG_PEEK, which invalidates the previous evaluation. At this moment, sk-B's file refcount is 2; one by the open fd, and one by the inflight fd in sk-A. The subsequent close() releases one refcount by the former. Finally, GC incorrectly concludes that both sk-A and sk-B are dead. One option is to restore the locking dance in unix_peek_fds(), but we can resolve this more elegantly thanks to the new algorithm. The point is that the issue does not occur without the subsequent close() and we actually do not need to synchronise MSG_PEEK with the dead SCC detection. When the issue occurs, close() and GC touch the same file refcount. If GC sees the refcount being decremented by close(), it can just give up garbage-collecting the SCC. Therefore, we only need to signal the race during MSG_PEEK with a proper memory barrier to make it visible to the GC. Let's use seqcount_t to notify GC when MSG_PEEK occurs and let it defer the SCC to the next run. This way no locking is needed on the MSG_PEEK side, and we can avoid imposing a penalty on every MSG_PEEK unnecessarily. Note that we can retry within unix_scc_dead() if MSG_PEEK is detected, but we do not do so to avoid hung task splat from abusive MSG_PEEK calls. The Linux kernel CVE team has assigned CVE-2026-23394 to this issue. Affected and fixed versions =========================== Issue introduced in 6.10 with commit 118f457da9ed58a79e24b73c2ef0aa1987241f0e and fixed in 6.19.10 with commit 37dd7ab332396eb8dd80b2dc7ea4b61abf767436 Issue introduced in 6.10 with commit 118f457da9ed58a79e24b73c2ef0aa1987241f0e and fixed in 7.0-rc5 with commit e5b31d988a41549037b8d8721a3c3cae893d8670 Issue introduced in 6.1.141 with commit 61a75360dca93c945ef6bd757f8b8a96f39b77cb Issue introduced in 6.6.93 with commit 7b1ffbd3b22e755d481d49647dcb7c5cfbde5844 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-2026-23394 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 net/unix/af_unix.h net/unix/garbage.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/37dd7ab332396eb8dd80b2dc7ea4b61abf767436 https://git.kernel.org/stable/c/e5b31d988a41549037b8d8721a3c3cae893d8670