CVE-2025-68295: smb: client: fix memory leak in cifs_construct_tcon()
In the Linux kernel, the following vulnerability has been resolved:
smb: client: fix memory leak in cifsconstructtcon()
When having a multiuser mount with domain= specified and using cifscreds, cifssetcifscreds() will end up setting @ctx->domainname, so it needs to be freed before leaving cifsconstructtcon().
This fixes the following memory leak reported by kmemleak:
mount.cifs //srv/share /mnt -o domain=ZELDA,multiuser,... su - testuser cifscreds add -d ZELDA -u testuser ... ls /mnt/1 ... umount /mnt echo scan > /sys/kernel/debug/kmemleak cat /sys/kernel/debug/kmemleak unreferenced object 0xffff8881203c3f08 (size 8): comm "ls", pid 5060, jiffies 4307222943 hex dump (first 8 bytes): 5a 45 4c 44 41 00 cc cc ZELDA... backtrace (crc d109a8cf): kmallocnodetrackcallernoprof+0x572/0x710 kstrdup+0x3a/0x70 cifssbtlink+0x1209/0x1770 [cifs] cifsgetfattr+0xe1/0xf50 [cifs] cifsgetinodeinfo+0xb5/0x240 [cifs] cifsrevalidatedentryattr+0x2d1/0x470 [cifs] cifsgetattr+0x28e/0x450 [cifs] vfsgetattrnosec+0x126/0x180 vfsstatx+0xf6/0x220 dostatx+0xab/0x110 x64sysstatx+0xd5/0x130 dosyscall64+0xbb/0x380 entrySYSCALL64afterhwframe+0x77/0x7f
Affected Software
Event History
Frequently Asked Questions
What is the severity of CVE-2025-68295?
CVE-2025-68295 is classified as a moderate severity vulnerability due to the potential memory leak issue.
How do I fix CVE-2025-68295?
To fix CVE-2025-68295, ensure that your Linux kernel is updated to the patched version that addresses the memory leak in cifs_construct_tcon().
Which Linux kernel versions are affected by CVE-2025-68295?
CVE-2025-68295 affects specific versions of the Linux kernel that implement the CIFS (Common Internet File System) protocol.
What impact does CVE-2025-68295 have on system performance?
The memory leak associated with CVE-2025-68295 can lead to increased memory consumption, potentially degrading system performance over time.
Is it safe to use multiuser mounts in Linux with CVE-2025-68295?
Using multiuser mounts in Linux may expose systems to risks associated with CVE-2025-68295 until the vulnerability is patched.