Linux
vmalloc: fix buffer overflow in vrealloc_node_align()
In the Linux kernel, the following vulnerability has been resolved: vmalloc: fix buffer overflow in vrealloc_node_align() Commit 4c5d3365882d ("mm/vmalloc: allow to set node and align in vrealloc") added the ability to force a new allocation if the current pointer is on the wrong NUMA node, or if an alignment constraint is not met, even if the user is shrinking the allocation. On this path (need_realloc), the code allocates a new object of 'size' bytes and then memcpy()s 'old_size' bytes into it. If the request is to shrink the object (size < old_size), this results in an out-of-bounds write on the new buffer. Fix this by bounding the copy length by the new allocation size.
Affected versions and mitigation
From the CVE record and the vendor's references.Affected
- >= 4c5d3365882dbbc0784688784904f440d7a4c0f1, < e9b057a44deff4c59c13f44672a5cc74dcd57522
- >= 4c5d3365882dbbc0784688784904f440d7a4c0f1, < b281adf71f786c325eb6d6d1582d4d05313438a8
- >= 4c5d3365882dbbc0784688784904f440d7a4c0f1, < 82d1f01292d3f09bf063f829f8ab8de12b4280a1
Fixed in e9b057a44deff4c59c13f44672a5cc74dcd57522, b281adf71f786c325eb6d6d1582d4d05313438a8, 82d1f01292d3f09bf063f829f8ab8de12b4280a1
- 6.18
Fixed in 0, 6.18.27, 7.0.4, 7.1
Mitigation
Upgrade Linux to e9b057a44deff4c59c13f44672a5cc74dcd57522 or b281adf71f786c325eb6d6d1582d4d05313438a8 or 82d1f01292d3f09bf063f829f8ab8de12b4280a1 or later.
Upgrade Linux to 0 or 6.18.27 or 7.0.4 or 7.1 or later.
Timeline
Days relative to CVE publicationNo public PoC found yet; not in CISA KEV.
PoC repositories
Found on GitHub.No PoC repositories found yet.