# CVE-2024-35878: of: module: prevent NULL pointer dereference in vsnprintf()

- Severity: Medium 5.3 (CVSS:3.1, scored by CISA-ADP) `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L`
- 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.79%, higher than 57% of CVEs (2026-12-01)
- Published: 2024-05-19T08:34:35.622Z
- Modified: 2026-06-17T07:35:37.153Z
- Weaknesses: CWE-476
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial
- Assigned by: Linux

## Description

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

of: module: prevent NULL pointer dereference in vsnprintf()

In of_modalias(), we can get passed the str and len parameters which would
cause a kernel oops in vsnprintf() since it only allows passing a NULL ptr
when the length is also 0. Also, we need to filter out the negative values
of the len parameter as these will result in a really huge buffer since
snprintf() takes size_t parameter while ours is ssize_t...

Found by Linux Verification Center (linuxtesting.org) with the Svace static
analysis tool.

(As written by CVE List.)

## Affected

- Linux Linux: from bd7a7ed774afd1a4174df34227626c95573be517 before e4a449368a2ce6d57a775d0ead27fc07f5a86e5b; from bd7a7ed774afd1a4174df34227626c95573be517 before 544561dc56f7e69a053c25e11e6170f48bb97898; from bd7a7ed774afd1a4174df34227626c95573be517 before a1aa5390cc912934fee76ce80af5f940452fa987; 6.4 (not affected: before 6.4; from 6.6.26 up to 6.6.*; from 6.8.5 up to 6.8.*; from 6.9 up to *)
- linux linux_kernel: before 6.6.26; from 6.7 before 6.8.5; 6.9

## References

- <https://git.kernel.org/stable/c/e4a449368a2ce6d57a775d0ead27fc07f5a86e5b> (patch)
- <https://git.kernel.org/stable/c/544561dc56f7e69a053c25e11e6170f48bb97898> (patch)
- <https://git.kernel.org/stable/c/a1aa5390cc912934fee76ce80af5f940452fa987> (patch)

## Sources

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

---

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