LinuxのLinux Kernelにおける解放済みメモリの使用に関する脆弱性
タイトル LinuxのLinux Kernelにおける解放済みメモリの使用に関する脆弱性
概要

LinuxカーネルのF2FSファイルシステムに脆弱性が存在し、f2fs_compress_write_end_io()内でuse-after-freeの問題が発生しました。この関数ではdec_page_count()の呼び出しによりカウントがゼロになると、アンマウント処理が進行して関連メモリが解放される可能性があります。しかし、bioの完了コールバックがまだ実行中のため、破棄されたメモリを使用して処理が行われ、use-after-freeの脆弱性が生じます。この問題はアンマウント時の競合状態に起因しており、修正ではdec_page_count()の呼び出し位置を変更し、メモリ解放前に全てのアクセスを完了させるようにしました。

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

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

公表日 2026年5月1日0:00
登録日 2026年5月8日12:06
最終更新日 2026年5月8日12:06
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 5.6 以上 6.6.136 未満
Linux Kernel 6.13 以上 6.18.25 未満
Linux Kernel 6.19 以上 7.0.2 未満
Linux Kernel 6.7 以上 6.12.84 未満
Linux Kernel 7.1
CVE (情報セキュリティ 共通脆弱性識別子)
CWE (共通脆弱性タイプ一覧)
その他
変更履歴
No 変更内容 変更日
1 [2026年05月08日]
  掲載
2026年5月8日12:06

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

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

f2fs: fix use-after-free of sbi in f2fs_compress_write_end_io()

In f2fs_compress_write_end_io(), dec_page_count(sbi, type) can bring
the F2FS_WB_CP_DATA counter to zero, unblocking
f2fs_wait_on_all_pages() in f2fs_put_super() on a concurrent unmount
CPU. The unmount path then proceeds to call
f2fs_destroy_page_array_cache(sbi), which destroys
sbi->page_array_slab via kmem_cache_destroy(), and eventually
kfree(sbi). Meanwhile, the bio completion callback is still executing:
when it reaches page_array_free(sbi, ...), it dereferences
sbi->page_array_slab — a destroyed slab cache — to call
kmem_cache_free(), causing a use-after-free.

This is the same class of bug as CVE-2026-23234 (which fixed the
equivalent race in f2fs_write_end_io() in data.c), but in the
compressed writeback completion path that was not covered by that fix.

Fix this by moving dec_page_count() to after page_array_free(), so
that all sbi accesses complete before the counter decrement that can
unblock unmount. For non-last folios (where atomic_dec_return on
cic->pending_pages is nonzero), dec_page_count is called immediately
before returning — page_array_free is not reached on this path, so
there is no post-decrement sbi access. For the last folio,
page_array_free runs while the F2FS_WB_CP_DATA counter is still
nonzero (this folio has not yet decremented it), keeping sbi alive,
and dec_page_count runs as the final operation.

公表日 2026年5月1日23:16
登録日 2026年5月2日4:06
最終更新日 2026年5月7日3:44
影響を受けるソフトウェアの構成
構成1 以上 以下 より上 未満
cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* 5.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
cpe:2.3:o:linux:linux_kernel:7.1:rc1:*:*:*:*:*:*
cpe:2.3:o:linux:linux_kernel:7.1:rc2:*:*:*:*:*:*
関連情報、対策とツール
共通脆弱性一覧