# CVE-2024-42138: mlxsw: core_linecards: Fix double memory deallocation in case of invalid INI file

- Severity: High 7.8 (CVSS:3.1, scored by NVD) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/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-07-30T07:46:32.611Z
- Modified: 2026-06-17T07:48:54.737Z
- Weaknesses: CWE-415
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial
- Assigned by: Linux

## Description

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

mlxsw: core_linecards: Fix double memory deallocation in case of invalid INI file

In case of invalid INI file mlxsw_linecard_types_init() deallocates memory
but doesn't reset pointer to NULL and returns 0. In case of any error
occurred after mlxsw_linecard_types_init() call, mlxsw_linecards_init()
calls mlxsw_linecard_types_fini() which performs memory deallocation again.

Add pointer reset to NULL.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

(As written by CVE List.)

## Affected

- Linux Linux: from b217127e5e4ee0ecfce7c5f84cfe082238123bda before ab557f5cd993a3201b09593633d04b891263d5c0; from b217127e5e4ee0ecfce7c5f84cfe082238123bda before f8b55a465b0e8a500179808166fe9420f5c091a1; from b217127e5e4ee0ecfce7c5f84cfe082238123bda before 9af7437669b72f804fc4269f487528dbbed142a2; from b217127e5e4ee0ecfce7c5f84cfe082238123bda before 8ce34dccbe8fa7d2ef86f2d8e7db2a9b67cabfc3; 5.19 (not affected: before 5.19; from 6.1.98 up to 6.1.*; from 6.6.39 up to 6.6.*; from 6.9.9 up to 6.9.*; from 6.10 up to *)
- linux linux_kernel: from 5.19 before 6.1.98; from 6.2 before 6.6.39; from 6.7 before 6.9.9; 6.10

## References

- <https://git.kernel.org/stable/c/ab557f5cd993a3201b09593633d04b891263d5c0> (patch)
- <https://git.kernel.org/stable/c/f8b55a465b0e8a500179808166fe9420f5c091a1> (patch)
- <https://git.kernel.org/stable/c/9af7437669b72f804fc4269f487528dbbed142a2> (patch)
- <https://git.kernel.org/stable/c/8ce34dccbe8fa7d2ef86f2d8e7db2a9b67cabfc3> (patch)
- <https://lists.debian.org/debian-lts-announce/2025/01/msg00001.html>

## Sources

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

---

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