{"id":"CVE-2024-56712","state":"PUBLISHED","title":"udmabuf: fix memory leak on last export_udmabuf() error path","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nudmabuf: fix memory leak on last export_udmabuf() error path\n\nIn export_udmabuf(), if dma_buf_fd() fails because the FD table is full, a\ndma_buf owning the udmabuf has already been created; but the error handling\nin udmabuf_create() will tear down the udmabuf without doing anything about\nthe containing dma_buf.\n\nThis leaves a dma_buf in memory that contains a dangling pointer; though\nthat doesn't seem to lead to anything bad except a memory leak.\n\nFix it by moving the dma_buf_fd() call out of export_udmabuf() so that we\ncan give it different error handling.\n\nNote that the shape of this code changed a lot in commit 5e72b2b41a21\n(\"udmabuf: convert udmabuf driver to use folios\"); but the memory leak\nseems to have existed since the introduction of udmabuf.","publishedAt":"2024-12-29T08:48:46.167Z","updatedAt":"2026-10-30T12:20:26.741Z","severity":{"score":3.3,"label":"Low","version":"3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:L","source":"CISA-ADP"},"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"fbb0de795078190a9834b3409e4b009cfb18a6d4","status":"affected","lessThan":"00ebdef47994206f60546929a0f6f63285497272","versionType":"git"},{"version":"fbb0de795078190a9834b3409e4b009cfb18a6d4","status":"affected","lessThan":"e469922fbdf6ad729e5dc8d49289b5036a0ecdf8","versionType":"git"},{"version":"fbb0de795078190a9834b3409e4b009cfb18a6d4","status":"affected","lessThan":"c9fc8428d4255c2128da9c4d5cd92e554d0150cf","versionType":"git"},{"version":"fbb0de795078190a9834b3409e4b009cfb18a6d4","status":"affected","lessThan":"f49856f525acd5bef52ae28b7da2e001bbe7439e","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/dma-buf/udmabuf.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"4.20","status":"affected"},{"version":"0","status":"unaffected","lessThan":"4.20","versionType":"semver"},{"version":"6.1.191","status":"unaffected","lessThanOrEqual":"6.1.*","versionType":"semver"},{"version":"6.6.160","status":"unaffected","lessThanOrEqual":"6.6.*","versionType":"semver"},{"version":"6.12.7","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.13","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/dma-buf/udmabuf.c"]}],"references":["https://git.kernel.org/stable/c/00ebdef47994206f60546929a0f6f63285497272","https://git.kernel.org/stable/c/e469922fbdf6ad729e5dc8d49289b5036a0ecdf8","https://git.kernel.org/stable/c/c9fc8428d4255c2128da9c4d5cd92e554d0150cf","https://git.kernel.org/stable/c/f49856f525acd5bef52ae28b7da2e001bbe7439e"],"weaknesses":["CWE-401"],"ingestedAt":"2026-10-30T12:36:04.432Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2024/56xxx/CVE-2024-56712.json","commit":"db8103c5921aac81d5d90efcf3745980dafabf49","baselineCommit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2024-56712","state":"PUBLISHED","datePublished":"2024-12-29T08:48:46.167Z","dateUpdated":"2026-10-30T12:20:26.741Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2024-12-27T15:00:39.857Z"},"containers":{"cna":{"title":"udmabuf: fix memory leak on last export_udmabuf() error path","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nudmabuf: fix memory leak on last export_udmabuf() error path\n\nIn export_udmabuf(), if dma_buf_fd() fails because the FD table is full, a\ndma_buf owning the udmabuf has already been created; but the error handling\nin udmabuf_create() will tear down the udmabuf without doing anything about\nthe containing dma_buf.\n\nThis leaves a dma_buf in memory that contains a dangling pointer; though\nthat doesn't seem to lead to anything bad except a memory leak.\n\nFix it by moving the dma_buf_fd() call out of export_udmabuf() so that we\ncan give it different error handling.\n\nNote that the shape of this code changed a lot in commit 5e72b2b41a21\n(\"udmabuf: convert udmabuf driver to use folios\"); but the memory leak\nseems to have existed since the introduction of udmabuf."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"fbb0de795078190a9834b3409e4b009cfb18a6d4","status":"affected","lessThan":"00ebdef47994206f60546929a0f6f63285497272","versionType":"git"},{"version":"fbb0de795078190a9834b3409e4b009cfb18a6d4","status":"affected","lessThan":"e469922fbdf6ad729e5dc8d49289b5036a0ecdf8","versionType":"git"},{"version":"fbb0de795078190a9834b3409e4b009cfb18a6d4","status":"affected","lessThan":"c9fc8428d4255c2128da9c4d5cd92e554d0150cf","versionType":"git"},{"version":"fbb0de795078190a9834b3409e4b009cfb18a6d4","status":"affected","lessThan":"f49856f525acd5bef52ae28b7da2e001bbe7439e","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/dma-buf/udmabuf.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"4.20","status":"affected"},{"version":"0","status":"unaffected","lessThan":"4.20","versionType":"semver"},{"version":"6.1.191","status":"unaffected","lessThanOrEqual":"6.1.*","versionType":"semver"},{"version":"6.6.160","status":"unaffected","lessThanOrEqual":"6.6.*","versionType":"semver"},{"version":"6.12.7","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.13","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/dma-buf/udmabuf.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/00ebdef47994206f60546929a0f6f63285497272"},{"url":"https://git.kernel.org/stable/c/e469922fbdf6ad729e5dc8d49289b5036a0ecdf8"},{"url":"https://git.kernel.org/stable/c/c9fc8428d4255c2128da9c4d5cd92e554d0150cf"},{"url":"https://git.kernel.org/stable/c/f49856f525acd5bef52ae28b7da2e001bbe7439e"}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-10-30T12:20:26.741Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.20","versionEndExcluding":"6.1.191"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.20","versionEndExcluding":"6.6.160"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.20","versionEndExcluding":"6.12.7"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.20","versionEndExcluding":"6.13"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}},"adp":[{"title":"CISA ADP Vulnrichment","metrics":[{"cvssV3_1":{"scope":"UNCHANGED","version":"3.1","baseScore":3.3,"attackVector":"LOCAL","baseSeverity":"LOW","vectorString":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:L","integrityImpact":"NONE","userInteraction":"NONE","attackComplexity":"LOW","availabilityImpact":"LOW","privilegesRequired":"LOW","confidentialityImpact":"NONE"}},{"other":{"type":"ssvc","content":{"id":"CVE-2024-56712","role":"CISA Coordinator","options":[{"Exploitation":"none"},{"Automatable":"no"},{"Technical Impact":"partial"}],"version":"2.0.3","timestamp":"2025-04-17T20:10:27.510565Z"}}}],"problemTypes":[{"descriptions":[{"cweId":"CWE-401","lang":"en","type":"CWE","description":"CWE-401 Missing Release of Memory after Effective Lifetime"}]}],"providerMetadata":{"shortName":"CISA-ADP","orgId":"134c704f-9b21-4f2e-91b3-4a467353bcc0","dateUpdated":"2025-04-17T20:15:52.408Z"}}]}}}