cbcvebase.
CVE-2024-26676
published 2024-04-02

CVE-2024-26676: In the Linux kernel, the following vulnerability has been resolved: af_unix: Call kfree_skb() for dead unix_(sk)->oob_skb in GC. syzbot reported a warning [0]…

PriorityP421medium5.5CVSS 3.1
AVLACLPRLUINSUCNINAH
EPSS
0.23%
13.7th percentile
In the Linux kernel, the following vulnerability has been resolved: af_unix: Call kfree_skb() for dead unix_(sk)->oob_skb in GC. syzbot reported a warning [0] in __unix_gc() with a repro, which creates a socketpair and sends one socket's fd to itself using the peer. socketpair(AF_UNIX, SOCK_STREAM, 0, [3, 4]) = 0 sendmsg(4, {msg_name=NULL, msg_namelen=0, msg_iov=[{iov_base="\360", iov_len=1}], msg_iovlen=1, msg_control=[{cmsg_len=20, cmsg_level=SOL_SOCKET, cmsg_type=SCM_RIGHTS, cmsg_data=[3]}], msg_controllen=24, msg_flags=0}, MSG_OOB|MSG_PROBE|MSG_DONTWAIT|MSG_ZEROCOPY) = 1 This forms a self-cyclic reference that GC should finally untangle but does not due to lack of MSG_OOB handling, resulting in memory leak. Recently, commit 11498715f266 ("af_unix: Remove io_uring code for GC.") removed io_uring's dead code in GC and revealed the problem. The code was executed at the final stage of GC and unconditionally moved all GC candidates from gc_candidates to gc_inflight_list. That papered over the reported problem by always making the following WARN_ON_ONCE(!list_empty(&gc_candidates)) false. The problem has been there since commit 2aab4b969002 ("af_unix: fix struct pid leaks in OOB support") added full scm support for MSG_OOB while fixing another bug. To fix this problem, we must call kfree_skb() for unix_sk(sk)->oob_skb if the socket still exists in gc_candidates after purging collected skb. Then, we need to set NULL to oob_skb before calling kfree_skb() because it calls last fput() and triggers unix_release_sock(), where we call duplicate kfree_skb(u->oob_skb) if not NULL. Note that the leaked socket remained being linked to a global list, so kmemleak also could not detect it. We need to check /proc/net/protocol to notice the unfreed socket. [0]: WARNING: CPU: 0 PID: 2863 at net/unix/garbage.c:345 __unix_gc+0xc74/0xe80 net/unix/garbage.c:345 Modules linked in: CPU: 0 PID: 2863 Comm: kworker/u4:11 Not tainted 6.8.0-rc1-syzkaller-00583-g1701940b1a02 #0 Hardwar

Affected

20 ranges
VendorProductVersion rangeFixed in
debianlinux< linux 6.1.82-1 (bookworm)linux 6.1.82-1 (bookworm)
linuxlinux
linuxlinux
linuxlinux>= 2aab4b96900272885bc157f8b236abf1cdc02e08 < b74aa9ce13d02b7fd37c5325b99854f91b9b4276b74aa9ce13d02b7fd37c5325b99854f91b9b4276
linuxlinux>= 2aab4b96900272885bc157f8b236abf1cdc02e08 < 82ae47c5c3a6b27fdc0f9e83c1499cb439c5614082ae47c5c3a6b27fdc0f9e83c1499cb439c56140
linuxlinux>= 2aab4b96900272885bc157f8b236abf1cdc02e08 < 1279f9d9dec2d7462823a18c29ad61359e0a007d1279f9d9dec2d7462823a18c29ad61359e0a007d
linuxlinux>= 5.15.103 < 5.15.1495.15.149
linuxlinux>= 6.1.20 < 6.1.786.1.78
linuxlinux>= 6.2.7 < 6.36.3
linuxlinux>= ac1968ac399205fda9ee3b18f7de7416cb3a5d0d < e0e09186d8821ad59806115d347ea32efa43ca4be0e09186d8821ad59806115d347ea32efa43ca4b
linuxlinux>= f3969427fb06a2c3cd6efd7faab63505cfa76e76 < 4fe505c63aa3273135a57597fda761e9aecc76684fe505c63aa3273135a57597fda761e9aecc7668
linuxlinux_kernel
linuxlinux_kernel>= 0 < 6.1.82-16.1.82-1
linuxlinux_kernel>= 0 < 6.7.7-16.7.7-1
linuxlinux_kernel>= 0 < 6.7.7-16.7.7-1
linuxlinux_kernel>= 0 < 5.15.0-106.1165.15.0-106.116
linuxlinux_kernel>= 5.15.103 < 5.15.1495.15.149
linuxlinux_kernel>= 6.1.20 < 6.1.786.1.78
linuxlinux_kernel>= 6.3 < 6.6.176.6.17
linuxlinux_kernel>= 6.7 < 6.7.56.7.5

CVSS provenance

nvdv3.15.5MEDIUMCVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H
osv7.0HIGH
vendor_ubuntu7.0HIGH
vendor_debian5.5MEDIUM
vendor_redhat5.5MEDIUM
Stop checking back — get the weekly exploitation signal.

Every Monday: what got weaponized or added to CISA KEV in the last seven days — each CVE cross-linked to its PoC, Nuclei template, and detection rule. Free, one email a week, unsubscribe in one click.