CVE-2026-45990: slub: fix data loss and overflow in krealloc()

Published May 27, 2026
·
Updated

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 'allocnew' happens before 'ks' and 'origsize' are initialized. As a result, the memcpy() in the 'allocnew' block would copy 0 bytes into the new allocation.

2. Buffer overflow during shrinking: When shrinking an object while forcing a new alignment, 'newsize' is smaller than the old size. However, the memcpy() used the old size ('origsize ?: 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 KREALLOCSHRINKOVERFLOW while (1) { void p = kmalloc(128, GFPKERNEL); p = kreallocnodealign(p, 64, 256, GFPKERNEL, NUMANONODE); kfree(p); }

demonstrates the issue:

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

Out-of-bounds write at 0xffff8883ad757038 (120B right of kfence-#47): memcpyorig+0x68/0x130 kreallocnodealignnoprof+0x1c8/0x340 lkdtmKREALLOCSHRINKOVERFLOW+0x8c/0xc0 [lkdtm] lkdtmdoaction+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): kreallocnodealignnoprof+0x19c/0x340 lkdtmKREALLOCSHRINKOVERFLOW+0x8c/0xc0 [lkdtm] lkdtmdoaction+0x3a/0x60 [lkdtm] ... ==================================================================

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

Affected Software

3 affected components
Linux Linux kernel
Linux Linux kernel>=6.18<6.18.27
Linux Linux kernel>=6.19<7.0.4

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Compensating control

    Until the fix is applied, avoid forcing reallocation to change alignment or NUMA node on shrinking allocations (i.e., avoid calls that force a new alignment/NUMA such as krealloc_node_align/krealloc_node_align_noprof with a smaller new_size) to mitigate data-loss and overflow risks.

  2. Operational

    Apply a source-level fix to the kernel slub allocator: move the old-size calculation to the top of __do_krealloc() and bound all copy lengths by the new allocation size to prevent data loss and out-of-bounds writes in krealloc() and kvrealloc().

  3. Operational

    Use the provided reproducer (e.g., the lkdtm KREALLOC_SHRINK_OVERFLOW loop shown in the advisory) to verify the issue is resolved after applying the fix.

Event History

May 27, 2026
CVE Published
via MITRE·12:55 PM
Data Sourced
via MITRE·12:55 PM
Description
Data Sourced
via NVD·02:17 PM
RemedyDescriptionSeverityWeaknessAffected Software

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203