From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 B8C2B3A7F70 for ; Sun, 19 Jul 2026 15:44:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784475857; cv=none; b=CjwivLrxmFe0ofErT0NVyihE9gkjxD16VnrPI4snd5Qys9J0qonV+KA6vVtVOL784WlB2mxCgCRnPBzArGIQcDLcLgyCOzL1ml/AhJSSGMH2wyNUdkT4AuJks5aNJ7QQt63tn/n+Ppj4+GyyTsG8FGzD3B4uhfFSIlajcXEgGDc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784475857; c=relaxed/simple; bh=if9PSdxyZsIkujIfYiytFsuMstceJMaVVCUPaq6byKo=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=VORNhDPC9OTrRRXUAuIdiWaHZQUBD29Fb3rCD+RqII7u5KST+EckYD61WaMPodK0dMebvee+9fZ91AmYe7ExjX5HJpVIaArIt0hC1R9Qsxgsf/CI9ljUNPUE1A2yNHxCHndrPT321yqyS/+5FYdHwEIfwRENIaDz84Fb0Z5eOJo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=KPNKlO3T; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="KPNKlO3T" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 17A491F000E9; Sun, 19 Jul 2026 15:44:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1784475856; bh=fG65VmpM6vF6PfVBPjfvBxXkKzy1ozpL/n4jN1UbkI0=; h=From:To:Cc:Subject:Date:Reply-To; b=KPNKlO3TFFbpJewnu5dYPDxhDc5Vzo6f5ZHhGTKk7TkSNckMOrx88B83UwQT/697v yKvo24e4u/fc4PXPCAGGrw6QmDHXT32731wOnZyeIrTK9Tc6QQAGifO2ZNMG+ohOtn aSxX6NrH+KvThHS3EnC8pPdMWLI/y9bHoL4AYaEw= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2026-64109: af_unix: Fix UAF read of tail->len in unix_stream_data_wait() Date: Sun, 19 Jul 2026 17:39:31 +0200 Message-ID: <2026071922-CVE-2026-64109-efb0@gregkh> X-Mailer: git-send-email 2.55.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=5652; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=tkmYy4SF0tCFCk/t3wreC6uMovLsgN9k8xuMUwBvbYw=; b=owGbwMvMwCRo6H6F97bub03G02pJDFkx7/MCzzmpPHjXW1fmcHjDivOM/JJ9RhXGE233LdDST 5/bkBHWEcvCIMjEICumyPJlG8/R/RWHFL0MbU/DzGFlAhnCwMUpABPZFscw31Nma76ehETQx6ID PVFad2LPsDnZMCw48SHr0tTKNzaT3131ifJatZV/0Zp0AA== 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 UAF read of tail->len in unix_stream_data_wait() unix_stream_data_wait() does skb_peek_tail(&sk->sk_receive_queue) without holding any lock that prevents SKBs on that queue from being dequeued and freed. This has been the case since commit 79f632c71bea ("unix/stream: fix peeking with an offset larger than data in queue"). The first consequence of this is that the pointer comparison `tail != last` can be false even if `last` semantically refers to an already-freed SKB while `tail` is a new SKB allocated at the same address; which can cause unix_stream_data_wait() to wrongly keep blocking after new data has arrived, but only in a weird scenario where a peeking recv() and a normal recv() on the same socket are racing, which is probably not a real problem. But since commit 2b514574f7e8 ("net: af_unix: implement splice for stream af_unix sockets"), `tail` is actually dereferenced, which can cause UAF in the following race scenario (where test_setup() runs single-threaded, and afterwards, test_thread1() and test_thread2() run concurrently in two threads: ``` static int socks[2]; void test_setup(void) { socketpair(AF_UNIX, SOCK_STREAM, 0, socks); send(socks[1], "A", 1, 0); int peekoff = 1; setsockopt(socks[0], SOL_SOCKET, SO_PEEK_OFF, &peekoff, sizeof(peekoff)); } void test_thread1(void) { char dummy; recv(socks[0], &dummy, 1, MSG_PEEK); } void test_thread2(void) { char dummy; recv(socks[0], &dummy, 1, 0); shutdown(socks[1], SHUT_WR); } ``` when racing like this: ``` thread1 thread2 unix_stream_read_generic mutex_lock(&u->iolock) skb_peek(&sk->sk_receive_queue) skb_peek_next(skb, &sk->sk_receive_queue) mutex_unlock(&u->iolock) unix_stream_read_generic unix_state_lock(sk) skb_peek(&sk->sk_receive_queue) unix_state_unlock(sk) unix_stream_data_wait unix_state_lock(sk) tail = skb_peek_tail(&sk->sk_receive_queue) spin_lock(&sk->sk_receive_queue.lock) __skb_unlink(skb, &sk->sk_receive_queue) spin_unlock(&sk->sk_receive_queue.lock) consume_skb(skb) [frees the SKB] `tail != last`: false `tail`: true `tail->len != last_len` ***UAF*** ``` Fix the UAF by removing the read of tail->len; checking tail->len would only make sense if SKBs in the receive queue of a UNIX socket could grow, which can no longer happen. Kuniyuki explained: > When commit 869e7c62486e ("net: af_unix: implement stream sendpage > support") added sendpage() support, data could be appended to the last > skb in the receiver's queue. > > That's why we needed to check if the length of the last skb was changed > while waiting for new data in unix_stream_data_wait(). > > However, commit a0dbf5f818f9 ("af_unix: Support MSG_SPLICE_PAGES") and > commit 57d44a354a43 ("unix: Convert unix_stream_sendpage() to use > MSG_SPLICE_PAGES") refactored sendmsg(), and now data is always added > to a new skb. That means this fix is not suitable for kernels before 6.5. The Linux kernel CVE team has assigned CVE-2026-64109 to this issue. Affected and fixed versions =========================== Issue introduced in 4.2 with commit 2b514574f7e88c8498027ee366fd6e7aae5aa4b5 and fixed in 6.6.143 with commit 26342087fac93b3932e6af61dc91ec029cb8a623 Issue introduced in 4.2 with commit 2b514574f7e88c8498027ee366fd6e7aae5aa4b5 and fixed in 6.12.92 with commit 38bccb927d83d7d52e5b20015a172a0b6101d11e Issue introduced in 4.2 with commit 2b514574f7e88c8498027ee366fd6e7aae5aa4b5 and fixed in 6.18.34 with commit acdff9907478e82208475b1151700d0b71dcdc63 Issue introduced in 4.2 with commit 2b514574f7e88c8498027ee366fd6e7aae5aa4b5 and fixed in 7.0.11 with commit 5f162f95a95834f06a8ec6140889272ad12e842f Issue introduced in 4.2 with commit 2b514574f7e88c8498027ee366fd6e7aae5aa4b5 and fixed in 7.1 with commit be309f8eae8b474a4a617eaae01324da996fc719 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-64109 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/26342087fac93b3932e6af61dc91ec029cb8a623 https://git.kernel.org/stable/c/38bccb927d83d7d52e5b20015a172a0b6101d11e https://git.kernel.org/stable/c/acdff9907478e82208475b1151700d0b71dcdc63 https://git.kernel.org/stable/c/5f162f95a95834f06a8ec6140889272ad12e842f https://git.kernel.org/stable/c/be309f8eae8b474a4a617eaae01324da996fc719