# CVE-2024-38585: tools/nolibc/stdlib: fix memory error in realloc()

- Severity: High 7.1 (CVSS:3.1, scored by NVD) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.23%, higher than 15% of CVEs (2026-12-01)
- Published: 2024-06-19T13:37:41.170Z
- Modified: 2026-06-17T07:40:38.710Z
- Weaknesses: CWE-125
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial
- Assigned by: Linux

## Description

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

tools/nolibc/stdlib: fix memory error in realloc()

Pass user_p_len to memcpy() instead of heap->len to prevent realloc()
from copying an extra sizeof(heap) bytes from beyond the allocated
region.

(As written by CVE List.)

## Affected

- Linux Linux: from 0e0ff638400be8f497a35b51a4751fd823f6bd6a before 5996b2b2dac739f2a27da13de8eee5b85b2550b3; from 0e0ff638400be8f497a35b51a4751fd823f6bd6a before f678c3c336559cf3255a32153e9a17c1be4e7c15; from 0e0ff638400be8f497a35b51a4751fd823f6bd6a before 8019d3dd921f39a237a9fab6d2ce716bfac0f983; from 0e0ff638400be8f497a35b51a4751fd823f6bd6a before 4e6f225aefeb712cdb870176b6621f02cf235b8c; from 0e0ff638400be8f497a35b51a4751fd823f6bd6a before 791f4641142e2aced85de082e5783b4fb0b977c2; 5.19 (not affected: before 5.19; from 6.1.93 up to 6.1.*; from 6.6.33 up to 6.6.*; from 6.8.12 up to 6.8.*; from 6.9.3 up to 6.9.*; from 6.10 up to *)
- linux linux_kernel: from 5.19 before 6.1.93; from 6.2 before 6.6.33; from 6.7 before 6.8.12; from 6.9 before 6.9.3

## References

- <https://git.kernel.org/stable/c/5996b2b2dac739f2a27da13de8eee5b85b2550b3> (patch)
- <https://git.kernel.org/stable/c/f678c3c336559cf3255a32153e9a17c1be4e7c15> (patch)
- <https://git.kernel.org/stable/c/8019d3dd921f39a237a9fab6d2ce716bfac0f983> (patch)
- <https://git.kernel.org/stable/c/4e6f225aefeb712cdb870176b6621f02cf235b8c> (patch)
- <https://git.kernel.org/stable/c/791f4641142e2aced85de082e5783b4fb0b977c2> (patch)

## Sources

- CVE List: [CVE-2024-38585](https://www.cve.org/CVERecord?id=CVE-2024-38585), CVE Terms of Use, modified 2026-05-11
- NVD: [CVE-2024-38585](https://nvd.nist.gov/vuln/detail/CVE-2024-38585), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2024-38585 · Whole record: https://cve.day/CVE-2024-38585.json · Rebuilt by cve.day 2026-11-25T22:58:42.028Z
