CVE-2024-26923
Severity CVSS v4.0:
Pending analysis
Type:
CWE-362
Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition')
Publication date:
25/04/2024
Last modified:
23/12/2025
Description
In the Linux kernel, the following vulnerability has been resolved:<br />
<br />
af_unix: Fix garbage collector racing against connect()<br />
<br />
Garbage collector does not take into account the risk of embryo getting<br />
enqueued during the garbage collection. If such embryo has a peer that<br />
carries SCM_RIGHTS, two consecutive passes of scan_children() may see a<br />
different set of children. Leading to an incorrectly elevated inflight<br />
count, and then a dangling pointer within the gc_inflight_list.<br />
<br />
sockets are AF_UNIX/SOCK_STREAM<br />
S is an unconnected socket<br />
L is a listening in-flight socket bound to addr, not in fdtable<br />
V&#39;s fd will be passed via sendmsg(), gets inflight count bumped<br />
<br />
connect(S, addr) sendmsg(S, [V]); close(V) __unix_gc()<br />
---------------- ------------------------- -----------<br />
<br />
NS = unix_create1()<br />
skb1 = sock_wmalloc(NS)<br />
L = unix_find_other(addr)<br />
unix_state_lock(L)<br />
unix_peer(S) = NS<br />
// V count=1 inflight=0<br />
<br />
NS = unix_peer(S)<br />
skb2 = sock_alloc()<br />
skb_queue_tail(NS, skb2[V])<br />
<br />
// V became in-flight<br />
// V count=2 inflight=1<br />
<br />
close(V)<br />
<br />
// V count=1 inflight=1<br />
// GC candidate condition met<br />
<br />
for u in gc_inflight_list:<br />
if (total_refs == inflight_refs)<br />
add u to gc_candidates<br />
<br />
// gc_candidates={L, V}<br />
<br />
for u in gc_candidates:<br />
scan_children(u, dec_inflight)<br />
<br />
// embryo (skb1) was not<br />
// reachable from L yet, so V&#39;s<br />
// inflight remains unchanged<br />
__skb_queue_tail(L, skb1)<br />
unix_state_unlock(L)<br />
for u in gc_candidates:<br />
if (u.inflight)<br />
scan_children(u, inc_inflight_move_tail)<br />
<br />
// V count=1 inflight=2 (!)<br />
<br />
If there is a GC-candidate listening socket, lock/unlock its state. This<br />
makes GC wait until the end of any ongoing connect() to that socket. After<br />
flipping the lock, a possibly SCM-laden embryo is already enqueued. And if<br />
there is another embryo coming, it can not possibly carry SCM_RIGHTS. At<br />
this point, unix_inflight() can not happen because unix_gc_lock is already<br />
taken. Inflight graph remains unaffected.
Impact
Base Score 3.x
4.70
Severity 3.x
MEDIUM
Vulnerable products and versions
| CPE | From | Up to |
|---|---|---|
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 2.6.23 (including) | 4.19.314 (excluding) |
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 4.20 (including) | 5.4.275 (excluding) |
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 5.5 (including) | 5.10.216 (excluding) |
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 5.11 (including) | 5.15.156 (excluding) |
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 5.16 (including) | 6.1.87 (excluding) |
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 6.2 (including) | 6.6.28 (excluding) |
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 6.7 (including) | 6.8.7 (excluding) |
| cpe:2.3:o:linux:linux_kernel:6.9:rc1:*:*:*:*:*:* | ||
| cpe:2.3:o:linux:linux_kernel:6.9:rc2:*:*:*:*:*:* | ||
| cpe:2.3:o:linux:linux_kernel:6.9:rc3:*:*:*:*:*:* | ||
| cpe:2.3:o:debian:debian_linux:10.0:*:*:*:*:*:*:* |
To consult the complete list of CPE names with products and versions, see this page
References to Advisories, Solutions, and Tools
- https://git.kernel.org/stable/c/2e2a03787f4f0abc0072350654ab0ef3324d9db3
- https://git.kernel.org/stable/c/343c5372d5e17b306db5f8f3c895539b06e3177f
- https://git.kernel.org/stable/c/47d8ac011fe1c9251070e1bd64cb10b48193ec51
- https://git.kernel.org/stable/c/507cc232ffe53a352847893f8177d276c3b532a9
- https://git.kernel.org/stable/c/a36ae0ec2353015f0f6762e59f4c2dbc0c906423
- https://git.kernel.org/stable/c/b75722be422c276b699200de90527d01c602ea7c
- https://git.kernel.org/stable/c/dbdf7bec5c920200077d693193f989cb1513f009
- https://git.kernel.org/stable/c/e76c2678228f6aec74b305ae30c9374cc2f28a51
- https://git.kernel.org/stable/c/2e2a03787f4f0abc0072350654ab0ef3324d9db3
- https://git.kernel.org/stable/c/343c5372d5e17b306db5f8f3c895539b06e3177f
- https://git.kernel.org/stable/c/47d8ac011fe1c9251070e1bd64cb10b48193ec51
- https://git.kernel.org/stable/c/507cc232ffe53a352847893f8177d276c3b532a9
- https://git.kernel.org/stable/c/a36ae0ec2353015f0f6762e59f4c2dbc0c906423
- https://git.kernel.org/stable/c/b75722be422c276b699200de90527d01c602ea7c
- https://git.kernel.org/stable/c/dbdf7bec5c920200077d693193f989cb1513f009
- https://git.kernel.org/stable/c/e76c2678228f6aec74b305ae30c9374cc2f28a51
- https://lists.debian.org/debian-lts-announce/2024/06/msg00017.html
- https://lists.debian.org/debian-lts-announce/2024/06/msg00020.html



