LinuxカーネルのAF_UNIXソケットのガベージコレクタの競合状態により不完全な接続処理が発生し、インフライトカウントが不適切になる脆弱性
タイトル LinuxカーネルのAF_UNIXソケットのガベージコレクタの競合状態により不完全な接続処理が発生し、インフライトカウントが不適切になる脆弱性
概要

Linuxカーネルには、AF_UNIXソケットのガベージコレクタに関する競合状態の脆弱性が存在していました。この問題は、ガベージコレクション処理中にまだ完全に接続されていないソケット(エンブリオ)がキューに追加される状況が考慮されていなかったことに起因します。その結果、SCM_RIGHTSを持つピアに接続している場合、不適切なインフライトカウントの増加やダングリングポインタが発生するおそれがありました。修正では、リスニングソケットをロックおよびアンロックすることで、connect()操作が完了するまでガベージコレクションが待機するようになり、これらの問題が解決されています。

想定される影響 当該ソフトウェアが扱う情報について、外部への漏えいは発生しません。 また、当該ソフトウェアが扱う情報について、書き換えは発生しません。 さらに、当該ソフトウェアが完全に停止する可能性があります。 そして、この脆弱性を悪用した攻撃の影響は、他のソフトウェアには及びません。 
対策

正式な対策が公開されています。ベンダ情報を参照して適切な対策を実施してください。

公表日 2024年4月25日0:00
登録日 2025年12月25日17:01
最終更新日 2025年12月25日17:01
CVSS3.0 : 警告
スコア 4.7
ベクター CVSS:3.0/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:H
影響を受けるシステム
Debian
Debian GNU/Linux 10.0
Linux
Linux Kernel 2.6.23 から 4.19.314 未満
Linux Kernel 4.20 から 5.4.275 未満
Linux Kernel 5.11 から 5.15.156 未満
Linux Kernel 5.16 から 6.1.87 未満
Linux Kernel 5.5 から 5.10.216 未満
Linux Kernel 6.2 から 6.6.28 未満
Linux Kernel 6.7 から 6.8.7 未満
Linux Kernel 6.9
CVE (情報セキュリティ 共通脆弱性識別子)
CWE (共通脆弱性タイプ一覧)
ベンダー情報
その他
変更履歴
No 変更内容 変更日
1 [2025年12月25日]
  掲載
2025年12月25日17:01

NVD脆弱性情報
CVE-2024-26923
概要

In the Linux kernel, the following vulnerability has been resolved:

af_unix: Fix garbage collector racing against connect()

Garbage collector does not take into account the risk of embryo getting
enqueued during the garbage collection. If such embryo has a peer that
carries SCM_RIGHTS, two consecutive passes of scan_children() may see a
different set of children. Leading to an incorrectly elevated inflight
count, and then a dangling pointer within the gc_inflight_list.

sockets are AF_UNIX/SOCK_STREAM
S is an unconnected socket
L is a listening in-flight socket bound to addr, not in fdtable
V's fd will be passed via sendmsg(), gets inflight count bumped

connect(S, addr) sendmsg(S, [V]); close(V) __unix_gc()
---------------- ------------------------- -----------

NS = unix_create1()
skb1 = sock_wmalloc(NS)
L = unix_find_other(addr)
unix_state_lock(L)
unix_peer(S) = NS
// V count=1 inflight=0

NS = unix_peer(S)
skb2 = sock_alloc()
skb_queue_tail(NS, skb2[V])

// V became in-flight
// V count=2 inflight=1

close(V)

// V count=1 inflight=1
// GC candidate condition met

for u in gc_inflight_list:
if (total_refs == inflight_refs)
add u to gc_candidates

// gc_candidates={L, V}

for u in gc_candidates:
scan_children(u, dec_inflight)

// embryo (skb1) was not
// reachable from L yet, so V's
// inflight remains unchanged
__skb_queue_tail(L, skb1)
unix_state_unlock(L)
for u in gc_candidates:
if (u.inflight)
scan_children(u, inc_inflight_move_tail)

// V count=1 inflight=2 (!)

If there is a GC-candidate listening socket, lock/unlock its state. This
makes GC wait until the end of any ongoing connect() to that socket. After
flipping the lock, a possibly SCM-laden embryo is already enqueued. And if
there is another embryo coming, it can not possibly carry SCM_RIGHTS. At
this point, unix_inflight() can not happen because unix_gc_lock is already
taken. Inflight graph remains unaffected.

公表日 2024年4月25日15:15
登録日 2024年4月25日20:00
最終更新日 2024年11月21日18:03
関連情報、対策とツール
共通脆弱性一覧