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

Linuxカーネルにおいて、以下の脆弱性が修正されました。ext4ファイルシステムで、truncate操作によりファイルサイズがインラインデータの容量を超えた場合に、インラインデータからextentベースのストレージへ変換する処理をext4_setattr()に追加しました。これにより、インラインデータフラグが設定されたままファイルサイズがインラインで格納可能な容量を超える不整合な状態になることを防ぎます。修正前は、以下の手順でカーネルがBUG_ON()を発生させてクラッシュしていました。1. インラインフラグがセットされていて小さいサイズのinodeを持つファイルシステムをマウントする。2. truncate(file, 50MB)でサイズを拡張するがインラインフラグは解除されなかった。3. sendfile()がデータ書き込みを試みる。4. ext4_write_inline_data()はwrite_sizeがinline_capacityを超えたためBUG_ON()を引き起こしていました。クラッシュは、ext4_write_inline_data()がインラインストレージ内への書き込みを前提としている一方で、実際のインライン容量(i_blockで約60バイト、xattrsで約96バイト)よりもファイルサイズと書き込み要求が大幅に大きいために発生していました。修正では、setattrによる新しいファイルサイズがinodeの実際のインライン容量(EXT4_I(inode)-i_inline_size)を超えた場合に、サイズ変更前にファイルをextentベースのストレージに変換し不整合を防止します。これにより、truncate操作中にインラインデータフラグとファイルサイズの整合性が維持され、根本的な問題が解決されました。

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

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

公表日 2026年4月22日0:00
登録日 2026年5月8日12:07
最終更新日 2026年5月8日12:07
CVSS3.0 : 重要
スコア 7.8
ベクター CVSS:3.0/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
影響を受けるシステム
Linux
Linux Kernel 3.8 以上 5.10.253 未満
Linux Kernel 5.11 以上 5.15.203 未満
Linux Kernel 5.16 以上 6.1.168 未満
Linux Kernel 6.13 以上 6.18.21 未満
Linux Kernel 6.19 以上 6.19.11 未満
Linux Kernel 6.2 以上 6.6.131 未満
Linux Kernel 6.7 以上 6.12.80 未満
Linux Kernel 7.0
CVE (情報セキュリティ 共通脆弱性識別子)
CWE (共通脆弱性タイプ一覧)
その他
変更履歴
No 変更内容 変更日
1 [2026年05月08日]
  掲載
2026年5月8日12:07

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

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

ext4: convert inline data to extents when truncate exceeds inline size

Add a check in ext4_setattr() to convert files from inline data storage
to extent-based storage when truncate() grows the file size beyond the
inline capacity. This prevents the filesystem from entering an
inconsistent state where the inline data flag is set but the file size
exceeds what can be stored inline.

Without this fix, the following sequence causes a kernel BUG_ON():

1. Mount filesystem with inode that has inline flag set and small size
2. truncate(file, 50MB) - grows size but inline flag remains set
3. sendfile() attempts to write data
4. ext4_write_inline_data() hits BUG_ON(write_size > inline_capacity)

The crash occurs because ext4_write_inline_data() expects inline storage
to accommodate the write, but the actual inline capacity (~60 bytes for
i_block + ~96 bytes for xattrs) is far smaller than the file size and
write request.

The fix checks if the new size from setattr exceeds the inode's actual
inline capacity (EXT4_I(inode)->i_inline_size) and converts the file to
extent-based storage before proceeding with the size change.

This addresses the root cause by ensuring the inline data flag and file
size remain consistent during truncate operations.

公表日 2026年4月22日23:16
登録日 2026年4月25日4:05
最終更新日 2026年4月24日1:17
関連情報、対策とツール
共通脆弱性一覧