{"id":"CVE-2025-68219","state":"PUBLISHED","title":"cifs: fix memory leak in smb3_fs_context_parse_param error path","description":"In the Linux kernel, the following vulnerability has been resolved:\n\ncifs: fix memory leak in smb3_fs_context_parse_param error path\n\nAdd proper cleanup of ctx->source and fc->source to the\ncifs_parse_mount_err error handler. This ensures that memory allocated\nfor the source strings is correctly freed on all error paths, matching\nthe cleanup already performed in the success path by\nsmb3_cleanup_fs_context_contents().\nPointers are also set to NULL after freeing to prevent potential\ndouble-free issues.\n\nThis change fixes a memory leak originally detected by syzbot. The\nleak occurred when processing Opt_source mount options if an error\nhappened after ctx->source and fc->source were successfully\nallocated but before the function completed.\n\nThe specific leak sequence was:\n1. ctx->source = smb3_fs_context_fullpath(ctx, '/') allocates memory\n2. fc->source = kstrdup(ctx->source, GFP_KERNEL) allocates more memory\n3. A subsequent error jumps to cifs_parse_mount_err\n4. The old error handler freed passwords but not the source strings,\ncausing the memory to leak.\n\nThis issue was not addressed by commit e8c73eb7db0a (\"cifs: client:\nfix memory leak in smb3_fs_context_parse_param\"), which only fixed\nleaks from repeated fsconfig() calls but not this error path.\n\nPatch updated with minor change suggested by kernel test robot","publishedAt":"2025-12-16T13:57:13.461Z","updatedAt":"2026-10-30T12:23:09.486Z","severity":null,"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"24e0a1eff9e2b9835a6e7c17039dfb6ecfd81f1f","status":"affected","lessThan":"a8071fd69df335362be5ecf5df5a167fd1eb5853","versionType":"git"},{"version":"24e0a1eff9e2b9835a6e7c17039dfb6ecfd81f1f","status":"affected","lessThan":"7627864dc3121f39e220f5253a227edf472de59e","versionType":"git"},{"version":"24e0a1eff9e2b9835a6e7c17039dfb6ecfd81f1f","status":"affected","lessThan":"48d69290270891f988e72edddd9688c20515421d","versionType":"git"},{"version":"24e0a1eff9e2b9835a6e7c17039dfb6ecfd81f1f","status":"affected","lessThan":"37010021d7e0341bb241ca00bcbae31f2c50b23f","versionType":"git"},{"version":"24e0a1eff9e2b9835a6e7c17039dfb6ecfd81f1f","status":"affected","lessThan":"7e4d9120cfa413dd34f4f434befc5dbe6c38b2e5","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/smb/client/fs_context.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"5.11","status":"affected"},{"version":"0","status":"unaffected","lessThan":"5.11","versionType":"semver"},{"version":"6.1.191","status":"unaffected","lessThanOrEqual":"6.1.*","versionType":"semver"},{"version":"6.6.118","status":"unaffected","lessThanOrEqual":"6.6.*","versionType":"semver"},{"version":"6.12.60","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.17.10","status":"unaffected","lessThanOrEqual":"6.17.*","versionType":"semver"},{"version":"6.18","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/smb/client/fs_context.c"]}],"references":["https://git.kernel.org/stable/c/a8071fd69df335362be5ecf5df5a167fd1eb5853","https://git.kernel.org/stable/c/7627864dc3121f39e220f5253a227edf472de59e","https://git.kernel.org/stable/c/48d69290270891f988e72edddd9688c20515421d","https://git.kernel.org/stable/c/37010021d7e0341bb241ca00bcbae31f2c50b23f","https://git.kernel.org/stable/c/7e4d9120cfa413dd34f4f434befc5dbe6c38b2e5"],"weaknesses":[],"ingestedAt":"2026-10-30T12:40:04.423Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2025/68xxx/CVE-2025-68219.json","commit":"db8103c5921aac81d5d90efcf3745980dafabf49","baselineCommit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2025-68219","state":"PUBLISHED","datePublished":"2025-12-16T13:57:13.461Z","dateUpdated":"2026-10-30T12:23:09.486Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2025-12-16T13:41:40.256Z"},"containers":{"cna":{"title":"cifs: fix memory leak in smb3_fs_context_parse_param error path","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\ncifs: fix memory leak in smb3_fs_context_parse_param error path\n\nAdd proper cleanup of ctx->source and fc->source to the\ncifs_parse_mount_err error handler. This ensures that memory allocated\nfor the source strings is correctly freed on all error paths, matching\nthe cleanup already performed in the success path by\nsmb3_cleanup_fs_context_contents().\nPointers are also set to NULL after freeing to prevent potential\ndouble-free issues.\n\nThis change fixes a memory leak originally detected by syzbot. The\nleak occurred when processing Opt_source mount options if an error\nhappened after ctx->source and fc->source were successfully\nallocated but before the function completed.\n\nThe specific leak sequence was:\n1. ctx->source = smb3_fs_context_fullpath(ctx, '/') allocates memory\n2. fc->source = kstrdup(ctx->source, GFP_KERNEL) allocates more memory\n3. A subsequent error jumps to cifs_parse_mount_err\n4. The old error handler freed passwords but not the source strings,\ncausing the memory to leak.\n\nThis issue was not addressed by commit e8c73eb7db0a (\"cifs: client:\nfix memory leak in smb3_fs_context_parse_param\"), which only fixed\nleaks from repeated fsconfig() calls but not this error path.\n\nPatch updated with minor change suggested by kernel test robot"}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"24e0a1eff9e2b9835a6e7c17039dfb6ecfd81f1f","status":"affected","lessThan":"a8071fd69df335362be5ecf5df5a167fd1eb5853","versionType":"git"},{"version":"24e0a1eff9e2b9835a6e7c17039dfb6ecfd81f1f","status":"affected","lessThan":"7627864dc3121f39e220f5253a227edf472de59e","versionType":"git"},{"version":"24e0a1eff9e2b9835a6e7c17039dfb6ecfd81f1f","status":"affected","lessThan":"48d69290270891f988e72edddd9688c20515421d","versionType":"git"},{"version":"24e0a1eff9e2b9835a6e7c17039dfb6ecfd81f1f","status":"affected","lessThan":"37010021d7e0341bb241ca00bcbae31f2c50b23f","versionType":"git"},{"version":"24e0a1eff9e2b9835a6e7c17039dfb6ecfd81f1f","status":"affected","lessThan":"7e4d9120cfa413dd34f4f434befc5dbe6c38b2e5","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/smb/client/fs_context.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"5.11","status":"affected"},{"version":"0","status":"unaffected","lessThan":"5.11","versionType":"semver"},{"version":"6.1.191","status":"unaffected","lessThanOrEqual":"6.1.*","versionType":"semver"},{"version":"6.6.118","status":"unaffected","lessThanOrEqual":"6.6.*","versionType":"semver"},{"version":"6.12.60","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.17.10","status":"unaffected","lessThanOrEqual":"6.17.*","versionType":"semver"},{"version":"6.18","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/smb/client/fs_context.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/a8071fd69df335362be5ecf5df5a167fd1eb5853"},{"url":"https://git.kernel.org/stable/c/7627864dc3121f39e220f5253a227edf472de59e"},{"url":"https://git.kernel.org/stable/c/48d69290270891f988e72edddd9688c20515421d"},{"url":"https://git.kernel.org/stable/c/37010021d7e0341bb241ca00bcbae31f2c50b23f"},{"url":"https://git.kernel.org/stable/c/7e4d9120cfa413dd34f4f434befc5dbe6c38b2e5"}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-10-30T12:23:09.486Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.11","versionEndExcluding":"6.1.191"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.11","versionEndExcluding":"6.6.118"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.11","versionEndExcluding":"6.12.60"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.11","versionEndExcluding":"6.17.10"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.11","versionEndExcluding":"6.18"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}}}}}