LinuxのLinux Kernelにおける整数オーバーフローの脆弱性
タイトル LinuxのLinux Kernelにおける整数オーバーフローの脆弱性
概要

Linuxカーネルにおいて、次の脆弱性が修正されました。slubのkrealloc()におけるデータ損失およびオーバーフローの問題です。コミット2cd8231796b5("mm/slub: allow to set node and align in k[v]realloc")により、オブジェクトが縮小される場合でも、新しいアライメントやNUMAノードの条件を満たさない場合に再割り当てを強制できる機能が追加されました。しかし、これにより再割り当てのフォールバックパスで2つのバグが発生しました。1つ目はNUMA移行時のデータ損失で、alloc_newへのジャンプがksおよびorig_sizeの初期化前に行われるため、alloc_newブロック内のmemcpy()が新しい割り当てに0バイトをコピーしてしまいます。2つ目は縮小時のバッファオーバーフローで、強制的に新しいアライメントを設定してオブジェクトを縮小する際、新しいサイズ(new_size)は旧サイズより小さいにもかかわらず、memcpy()が旧サイズ(orig_size ?: ks)を使用するため境界外書き込みが発生します。同様のオーバーフローバグはkvrealloc()のフォールバックパスにも存在し、新しいサイズで制限されずに旧バケットサイズksize(p)が新しいバッファにコピーされてしまいます。問題の簡単な再現例はlkdtmにKREALLOC_SHRINK_OVERFLOWとして追加されており、以下のように示されています。while (1) {void *p = kmalloc(128, GFP_KERNEL); p = krealloc_node_align(p, 64, 256, GFP_KERNEL, NUMA_NO_NODE); kfree(p);}これにより、memcpy_origで120バイトの境界外書き込みが発生し、KFENCEがこれを検出します。修正は__do_krealloc()の冒頭で旧サイズの計算を移動し、すべてのコピー長を新しい割り当てサイズで制限することにより実施されました。

想定される影響 ・当該ソフトウェアが扱う情報について、外部への漏えいは発生しません。 ・当該ソフトウェアが扱う情報について、書き換えは発生しません。 ・当該ソフトウェアが完全に停止する可能性があります。 
対策

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

公表日 2026年5月27日0:00
登録日 2026年6月17日15:43
最終更新日 2026年6月17日15:43
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 6.18 以上 6.18.27 未満
Linux Kernel 6.19 以上 7.0.4 未満
CVE (情報セキュリティ 共通脆弱性識別子)
CWE (共通脆弱性タイプ一覧)
その他
変更履歴
No 変更内容 変更日
1 [2026年06月17日]
  掲載
2026年6月17日15:43

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

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

slub: fix data loss and overflow in krealloc()

Commit 2cd8231796b5 ("mm/slub: allow to set node and align in
k[v]realloc") introduced the ability to force a reallocation if the
original object does not satisfy new alignment or NUMA node, even when
the object is being shrunk.

This introduced two bugs in the reallocation fallback path:

1. Data loss during NUMA migration: The jump to 'alloc_new' happens
before 'ks' and 'orig_size' are initialized. As a result, the
memcpy() in the 'alloc_new' block would copy 0 bytes into the new
allocation.

2. Buffer overflow during shrinking: When shrinking an object while
forcing a new alignment, 'new_size' is smaller than the old size.
However, the memcpy() used the old size ('orig_size ?: ks'), leading
to an out-of-bounds write.

The same overflow bug exists in the kvrealloc() fallback path, where the
old bucket size ksize(p) is copied into the new buffer without being
bounded by the new size.

A simple reproducer:

// e.g. add to lkdtm as KREALLOC_SHRINK_OVERFLOW
while (1) {
void *p = kmalloc(128, GFP_KERNEL);
p = krealloc_node_align(p, 64, 256, GFP_KERNEL, NUMA_NO_NODE);
kfree(p);
}

demonstrates the issue:

==================================================================
BUG: KFENCE: out-of-bounds write in memcpy_orig+0x68/0x130

Out-of-bounds write at 0xffff8883ad757038 (120B right of kfence-#47):
memcpy_orig+0x68/0x130
krealloc_node_align_noprof+0x1c8/0x340
lkdtm_KREALLOC_SHRINK_OVERFLOW+0x8c/0xc0 [lkdtm]
lkdtm_do_action+0x3a/0x60 [lkdtm]
...

kfence-#47: 0xffff8883ad756fc0-0xffff8883ad756fff, size=64, cache=kmalloc-64

allocated by task 316 on cpu 7 at 97.680481s (0.021813s ago):
krealloc_node_align_noprof+0x19c/0x340
lkdtm_KREALLOC_SHRINK_OVERFLOW+0x8c/0xc0 [lkdtm]
lkdtm_do_action+0x3a/0x60 [lkdtm]
...
==================================================================

Fix it by moving the old size calculation to the top of __do_krealloc()
and bounding all copy lengths by the new allocation size.

公表日 2026年5月27日23:17
登録日 2026年5月28日4:12
最終更新日 2026年5月27日23:48
関連情報、対策とツール
共通脆弱性一覧