CVE-2025-68219
Description
In the Linux kernel, the following vulnerability has been resolved:
cifs: fix memory leak in smb3_fs_context_parse_param error path
Add proper cleanup of ctx->source and fc->source to the cifs_parse_mount_err error handler. This ensures that memory allocated for the source strings is correctly freed on all error paths, matching the cleanup already performed in the success path by smb3_cleanup_fs_context_contents(). Pointers are also set to NULL after freeing to prevent potential double-free issues.
This change fixes a memory leak originally detected by syzbot. The leak occurred when processing Opt_source mount options if an error happened after ctx->source and fc->source were successfully allocated but before the function completed.
The specific leak sequence was: 1. ctx->source = smb3_fs_context_fullpath(ctx, '/') allocates memory 2. fc->source = kstrdup(ctx->source, GFP_KERNEL) allocates more memory 3. A subsequent error jumps to cifs_parse_mount_err 4. The old error handler freed passwords but not the source strings, causing the memory to leak.
This issue was not addressed by commit e8c73eb7db0a ("cifs: client: fix memory leak in smb3_fs_context_parse_param"), which only fixed leaks from repeated fsconfig() calls but not this error path.
Patch updated with minor change suggested by kernel test robot
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
A memory leak in the Linux kernel's cifs mount option parser (smb3_fs_context_parse_param) is fixed by properly freeing ctx->source and fc->source on error paths.
Vulnerability
CVE-2025-68219 is a memory leak vulnerability in the Linux kernel's cifs filesystem implementation. The issue occurs in the smb3_fs_context_parse_param function during mount option parsing. When processing Opt_source mount options, memory is allocated for ctx->source and fc->source, but on some error paths these allocated strings are not freed, leading to a memory leak [1][2].
Exploitation
An unprivileged user with the ability to mount a CIFS share can trigger this vulnerability. By repeatedly causing an error during mount option processing (e.g., by providing a malformed or invalid source path), the kernel will leak memory. No special privileges beyond mount capabilities are required.
Impact
Successful exploitation results in a gradual memory leak, potentially leading to denial of service as system memory is exhausted. The leak is cumulative with repeated mount attempts, but does not allow code execution or privilege escalation.
Mitigation
The fix has been merged into the Linux kernel mainline and backported to stable trees [1][2]. Users should apply the latest kernel updates to remediate this vulnerability. No workarounds are available aside from restricting mount access or using a patched kernel.
AI Insight generated on May 19, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.
Affected products
1Patches
0No patches discovered yet.
Vulnerability mechanics
AI mechanics synthesis has not run for this CVE yet.
References
4News mentions
0No linked articles in our index yet.