smb: client: avoid leaking refcount when cifs_sb_tlink() fails
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ e8f5f849ffce24490eb9449e98312b66c0dba76f · < 1d1b0f1d812a4011a57bc6c70492c34a2e46c6dd| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
smb: client: avoid leaking refcount when cifs_sb_tlink() fails
cifs_oplock_break() takes over the reference that cifs_queue_oplock_break() acquired when it queued the work, and drops it with _cifsFileInfo_put() once the break has been processed.
Only in setups with "-o multiuser", cifs_sb_tlink() may fail, at which point cifs_oplock_break() returns without putting the file reference, mirroring the reference leak we already fixed in the companion patch to cifs_queue_oplock_break().
This would trigger a crash due to busy inodes on the next unmount:
BUG: Dentry ... still in use (1) [unmount of cifs cifs] VFS: Busy inodes after unmount of cifs (cifs)
Drop the reference on that path as well. Doing so before the out label mirrors the normal path, which also puts the reference before cifs_done_oplock_break().
Found by Sashiko code review. The failure path was not exercised at runtime.
From the CVE record · Linux
The Linux kernel SMB client can leak a file reference when an oplock break encounters a cifs_sb_tlink() failure on a CIFS mount using -o multiuser. This can cause a crash on the next unmount. The input does not establish an attacker path, authentication requirement, or user-interaction requirement; the failure path was not exercised at runtime.
Operators of Linux kernels using CIFS mounts with -o multiuser should check their exposure; affected versions are not specified.