LinuxのLinux Kernelにおける有効期限後のメモリの解放の欠如に関する脆弱性
タイトル LinuxのLinux Kernelにおける有効期限後のメモリの解放の欠如に関する脆弱性
概要

Linuxカーネルにおいて、kcm: 部分的なsendmsgエラー時にfrag_list内のゼロフラグメントskbを修正する脆弱性が修正されました。Syzkallerはfrag_list内にゼロフラグメントskbを含むメッセージを処理する際、kcm_write_msgs()で警告を報告していました。kcm_sendmsg()は現在のskbにMAX_SKB_FRAGSフラグメントを埋めると、新しいskb(tskb)を割り当ててデータコピー前にfrag_listに接続します。コピーが失敗した場合(例:ユーザーメモリからの-EFAULT)には、tskbはゼロフラグメントのままfrag_list内に残ります。SOCK_SEQPACKETでは部分データが既にコピーされている場合、エラー経路はこのメッセージをpartial_messageとして後に保存します。SOCK_SEQPACKETはsock_write_iter()が自動的にMSG_EORを設定するため、続くゼロ長書き込み(fd, NULL, 0)でメッセージを完了させ、sk_write_queueにキューイングします。kcm_write_msgs()はfrag_listを辿る際にWARN_ON(!skb_shinfo(skb)-nr_frags)を発生させました。TCPでは類似のクリーンアップが存在しますが、KCMにはこれが欠如していました。修正では、新規frag_listエントリ割当時に先行skb(frag_prev)を追跡し、エラー発生時に末尾skbがゼロフラグメントであればfrag_prevを使ってfrag_listから高速に解除・解放します。この処理は安定しており、条件が繰り返される場合のログ流出を防ぐためにWARN_ONはWARN_ON_ONCEに変更されました。この修正により問題は解決しました。

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

リリース情報、またはパッチ情報が公開されています。参考情報を参照して適切な対策を実施してください。

公表日 2026年5月6日0:00
登録日 2026年5月12日10:20
最終更新日 2026年5月12日10:20
CVSS3.0 : 警告
スコア 5.5
ベクター CVSS:3.0/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H
影響を受けるシステム
Linux
Linux Kernel 4.6 以上 6.12.75 未満
Linux Kernel 6.13 以上 6.18.16 未満
Linux Kernel 6.19 以上 6.19.6 未満
Linux Kernel 7.0
CVE (情報セキュリティ 共通脆弱性識別子)
CWE (共通脆弱性タイプ一覧)
その他
変更履歴
No 変更内容 変更日
1 [2026年05月12日]
  掲載
2026年5月12日10:20

NVD脆弱性情報
CVE-2026-43244
概要

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

kcm: fix zero-frag skb in frag_list on partial sendmsg error

Syzkaller reported a warning in kcm_write_msgs() when processing a
message with a zero-fragment skb in the frag_list.

When kcm_sendmsg() fills MAX_SKB_FRAGS fragments in the current skb,
it allocates a new skb (tskb) and links it into the frag_list before
copying data. If the copy subsequently fails (e.g. -EFAULT from
user memory), tskb remains in the frag_list with zero fragments:

head skb (msg being assembled, NOT yet in sk_write_queue)
+-----------+
| frags[17] | (MAX_SKB_FRAGS, all filled with data)
| frag_list-+--> tskb
+-----------+ +----------+
| frags[0] | (empty! copy failed before filling)
+----------+

For SOCK_SEQPACKET with partial data already copied, the error path
saves this message via partial_message for later completion. For
SOCK_SEQPACKET, sock_write_iter() automatically sets MSG_EOR, so a
subsequent zero-length write(fd, NULL, 0) completes the message and
queues it to sk_write_queue. kcm_write_msgs() then walks the
frag_list and hits:

WARN_ON(!skb_shinfo(skb)->nr_frags)

TCP has a similar pattern where skbs are enqueued before data copy
and cleaned up on failure via tcp_remove_empty_skb(). KCM was
missing the equivalent cleanup.

Fix this by tracking the predecessor skb (frag_prev) when allocating
a new frag_list entry. On error, if the tail skb has zero frags,
use frag_prev to unlink and free it in O(1) without walking the
singly-linked frag_list. frag_prev is safe to dereference because
the entire message chain is only held locally (or in kcm->seq_skb)
and is not added to sk_write_queue until MSG_EOR, so the send path
cannot free it underneath us.

Also change the WARN_ON to WARN_ON_ONCE to avoid flooding the log
if the condition is somehow hit repeatedly.

There are currently no KCM selftests in the kernel tree; a simple
reproducer is available at [1].

[1] https://gist.github.com/mrpre/a94d431c757e8d6f168f4dd1a3749daa

公表日 2026年5月6日21:16
登録日 2026年5月7日4:09
最終更新日 2026年5月11日23:12
影響を受けるソフトウェアの構成
構成1 以上 以下 より上 未満
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* 4.6 6.12.75
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* 6.13 6.18.16
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* 6.19 6.19.6
cpe:2.3:o:linux:linux_kernel:7.0:rc1:*:*:*:*:*:*
関連情報、対策とツール
共通脆弱性一覧