{"id":"CVE-2024-42138","state":"PUBLISHED","title":"mlxsw: core_linecards: Fix double memory deallocation in case of invalid INI file","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nmlxsw: core_linecards: Fix double memory deallocation in case of invalid INI file\n\nIn case of invalid INI file mlxsw_linecard_types_init() deallocates memory\nbut doesn't reset pointer to NULL and returns 0. In case of any error\noccurred after mlxsw_linecard_types_init() call, mlxsw_linecards_init()\ncalls mlxsw_linecard_types_fini() which performs memory deallocation again.\n\nAdd pointer reset to NULL.\n\nFound by Linux Verification Center (linuxtesting.org) with SVACE.","publishedAt":"2024-07-30T07:46:32.611Z","updatedAt":"2026-05-11T20:27:42.899Z","severity":null,"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"b217127e5e4ee0ecfce7c5f84cfe082238123bda","status":"affected","lessThan":"ab557f5cd993a3201b09593633d04b891263d5c0","versionType":"git"},{"version":"b217127e5e4ee0ecfce7c5f84cfe082238123bda","status":"affected","lessThan":"f8b55a465b0e8a500179808166fe9420f5c091a1","versionType":"git"},{"version":"b217127e5e4ee0ecfce7c5f84cfe082238123bda","status":"affected","lessThan":"9af7437669b72f804fc4269f487528dbbed142a2","versionType":"git"},{"version":"b217127e5e4ee0ecfce7c5f84cfe082238123bda","status":"affected","lessThan":"8ce34dccbe8fa7d2ef86f2d8e7db2a9b67cabfc3","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/net/ethernet/mellanox/mlxsw/core_linecards.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"5.19","status":"affected"},{"version":"0","status":"unaffected","lessThan":"5.19","versionType":"semver"},{"version":"6.1.98","status":"unaffected","lessThanOrEqual":"6.1.*","versionType":"semver"},{"version":"6.6.39","status":"unaffected","lessThanOrEqual":"6.6.*","versionType":"semver"},{"version":"6.9.9","status":"unaffected","lessThanOrEqual":"6.9.*","versionType":"semver"},{"version":"6.10","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/net/ethernet/mellanox/mlxsw/core_linecards.c"]}],"references":["https://git.kernel.org/stable/c/ab557f5cd993a3201b09593633d04b891263d5c0","https://git.kernel.org/stable/c/f8b55a465b0e8a500179808166fe9420f5c091a1","https://git.kernel.org/stable/c/9af7437669b72f804fc4269f487528dbbed142a2","https://git.kernel.org/stable/c/8ce34dccbe8fa7d2ef86f2d8e7db2a9b67cabfc3","https://lists.debian.org/debian-lts-announce/2025/01/msg00001.html"],"weaknesses":[],"ingestedAt":"2026-10-29T20:07:47.831Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2024/42xxx/CVE-2024-42138.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2024-42138","state":"PUBLISHED","datePublished":"2024-07-30T07:46:32.611Z","dateUpdated":"2026-05-11T20:27:42.899Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2024-07-29T15:50:41.188Z"},"containers":{"cna":{"title":"mlxsw: core_linecards: Fix double memory deallocation in case of invalid INI file","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nmlxsw: core_linecards: Fix double memory deallocation in case of invalid INI file\n\nIn case of invalid INI file mlxsw_linecard_types_init() deallocates memory\nbut doesn't reset pointer to NULL and returns 0. In case of any error\noccurred after mlxsw_linecard_types_init() call, mlxsw_linecards_init()\ncalls mlxsw_linecard_types_fini() which performs memory deallocation again.\n\nAdd pointer reset to NULL.\n\nFound by Linux Verification Center (linuxtesting.org) with SVACE."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"b217127e5e4ee0ecfce7c5f84cfe082238123bda","status":"affected","lessThan":"ab557f5cd993a3201b09593633d04b891263d5c0","versionType":"git"},{"version":"b217127e5e4ee0ecfce7c5f84cfe082238123bda","status":"affected","lessThan":"f8b55a465b0e8a500179808166fe9420f5c091a1","versionType":"git"},{"version":"b217127e5e4ee0ecfce7c5f84cfe082238123bda","status":"affected","lessThan":"9af7437669b72f804fc4269f487528dbbed142a2","versionType":"git"},{"version":"b217127e5e4ee0ecfce7c5f84cfe082238123bda","status":"affected","lessThan":"8ce34dccbe8fa7d2ef86f2d8e7db2a9b67cabfc3","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/net/ethernet/mellanox/mlxsw/core_linecards.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"5.19","status":"affected"},{"version":"0","status":"unaffected","lessThan":"5.19","versionType":"semver"},{"version":"6.1.98","status":"unaffected","lessThanOrEqual":"6.1.*","versionType":"semver"},{"version":"6.6.39","status":"unaffected","lessThanOrEqual":"6.6.*","versionType":"semver"},{"version":"6.9.9","status":"unaffected","lessThanOrEqual":"6.9.*","versionType":"semver"},{"version":"6.10","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/net/ethernet/mellanox/mlxsw/core_linecards.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/ab557f5cd993a3201b09593633d04b891263d5c0"},{"url":"https://git.kernel.org/stable/c/f8b55a465b0e8a500179808166fe9420f5c091a1"},{"url":"https://git.kernel.org/stable/c/9af7437669b72f804fc4269f487528dbbed142a2"},{"url":"https://git.kernel.org/stable/c/8ce34dccbe8fa7d2ef86f2d8e7db2a9b67cabfc3"}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-05-11T20:27:42.899Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.19","versionEndExcluding":"6.1.98"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.19","versionEndExcluding":"6.6.39"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.19","versionEndExcluding":"6.9.9"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.19","versionEndExcluding":"6.10"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}},"adp":[{"title":"CVE Program Container","references":[{"url":"https://git.kernel.org/stable/c/ab557f5cd993a3201b09593633d04b891263d5c0","tags":["x_transferred"]},{"url":"https://git.kernel.org/stable/c/f8b55a465b0e8a500179808166fe9420f5c091a1","tags":["x_transferred"]},{"url":"https://git.kernel.org/stable/c/9af7437669b72f804fc4269f487528dbbed142a2","tags":["x_transferred"]},{"url":"https://git.kernel.org/stable/c/8ce34dccbe8fa7d2ef86f2d8e7db2a9b67cabfc3","tags":["x_transferred"]},{"url":"https://lists.debian.org/debian-lts-announce/2025/01/msg00001.html"}],"providerMetadata":{"shortName":"CVE","orgId":"af854a3a-2127-422b-91ae-364da2661108","dateUpdated":"2025-11-03T22:02:06.828Z"}},{"title":"CISA ADP Vulnrichment","metrics":[{"other":{"type":"ssvc","content":{"id":"CVE-2024-42138","role":"CISA Coordinator","options":[{"Exploitation":"none"},{"Automatable":"no"},{"Technical Impact":"partial"}],"version":"2.0.3","timestamp":"2024-09-10T16:16:03.260282Z"}}}],"providerMetadata":{"shortName":"CISA-ADP","orgId":"134c704f-9b21-4f2e-91b3-4a467353bcc0","dateUpdated":"2024-09-11T17:34:35.704Z"}}]}}}