LinuxのLinux Kernelにおける境界外書き込みに関する脆弱性
タイトル LinuxのLinux Kernelにおける境界外書き込みに関する脆弱性
概要

Linuxカーネルにおいて、以下の脆弱性が修正されました。ksmbdのsmb2_get_ea()関数のEAアライメントにおける境界外書き込みの問題を修正しました。smb2_get_ea()は各EAエントリを書き込んだ後にmemset()を用いて4バイト境界のパディングを適用します。buf_free_lenの境界チェックはmemcpyの前に行われますが、その後のアライメントmemsetは残りのスペースを確認せずに無条件で実行されます。EA値がちょうど残りのバッファを満たす場合(buf_free_lenが値の減算後に0になる場合)、アライメントmemsetはbuf_free_lenの境界を1〜3バイト超えてNULLバイトを書き込みます。複数コマンドで応答バッファが共有される複合リクエストでは、最初のコマンド(例:READ)がバッファの大部分を消費し、QUERY_INFOのEA応答に非常にわずかな空きしか残さないことがあります。この時、アライメントmemsetは物理的なkvmalloc割り当てを超えて隣接するカーネルヒープメモリを上書きします。そこで、アライメントmemsetの前に境界チェックを追加し、buf_free_lenがパディングバイトを格納できることを保証しました。このバグパターンはcommit beef2634f81f("ksmbd: fix potencial OOB in get_file_all_info() for compound requests")およびcommit fda9522ed6af("ksmbd: fix OOB write in QUERY_INFO for compound requests")で修正されたものと同様であり、両者ともQUERY_INFO応答ハンドラに無条件書き込み前の境界チェックを追加しています。

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

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

公表日 2026年5月1日0:00
登録日 2026年5月8日12:06
最終更新日 2026年5月8日12:06
CVSS3.0 : 緊急
スコア 9.8
ベクター CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
影響を受けるシステム
Linux
Linux Kernel 5.15.145 以上 5.16 未満
Linux Kernel 6.1.71 以上 6.2 未満
Linux Kernel 6.13 以上 6.18.25 未満
Linux Kernel 6.19 以上 7.0.2 未満
Linux Kernel 6.6 以上 6.6.136 未満
Linux Kernel 6.7 以上 6.12.84 未満
CVE (情報セキュリティ 共通脆弱性識別子)
CWE (共通脆弱性タイプ一覧)
その他
変更履歴
No 変更内容 変更日
1 [2026年05月08日]
  掲載
2026年5月8日12:06

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

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

ksmbd: fix out-of-bounds write in smb2_get_ea() EA alignment

smb2_get_ea() applies 4-byte alignment padding via memset() after
writing each EA entry. The bounds check on buf_free_len is performed
before the value memcpy, but the alignment memset fires unconditionally
afterward with no check on remaining space.

When the EA value exactly fills the remaining buffer (buf_free_len == 0
after value subtraction), the alignment memset writes 1-3 NUL bytes
past the buf_free_len boundary. In compound requests where the response
buffer is shared across commands, the first command (e.g., READ) can
consume most of the buffer, leaving a tight remainder for the QUERY_INFO
EA response. The alignment memset then overwrites past the physical
kvmalloc allocation into adjacent kernel heap memory.

Add a bounds check before the alignment memset to ensure buf_free_len
can accommodate the padding bytes.

This is the same bug pattern fixed by commit beef2634f81f ("ksmbd: fix
potencial OOB in get_file_all_info() for compound requests") and
commit fda9522ed6af ("ksmbd: fix OOB write in QUERY_INFO for compound
requests"), both of which added bounds checks before unconditional
writes in QUERY_INFO response handlers.

公表日 2026年5月1日23:16
登録日 2026年5月2日4:06
最終更新日 2026年5月7日5:45
影響を受けるソフトウェアの構成
構成1 以上 以下 より上 未満
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* 5.15.145 5.16
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* 6.1.71 6.2
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* 6.6 6.6.136
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* 6.7 6.12.84
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* 6.13 6.18.25
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* 6.19 7.0.2
関連情報、対策とツール
共通脆弱性一覧