smb: client: fix cifsFileInfo reference leak in deferred close
No exploitation in the wild has been reported. EPSS puts the chance of exploitation in the next 30 days at 0%. Fixed in Kernel ea93759d6c2789924f4e557aed5be532207715ea, Kernel 46d98be6c34a52182ea3c2f849a3ea0e9419eaf2, Kernel 525c225e23d61694091f2806de553a69362a78ff and 10 more.
In the Linux kernel, the following vulnerability has been resolved: smb: client: fix cifsFileInfo reference leak in deferred close When cifs_close() defers a close, it hands the cifsFileInfo reference of the closing struct file to the queued work. Each execution of smb2_deferred_work_close() drops one such reference. deferred_close_scheduled can be false while the work is pending: the workqueue clears PENDING when the callback starts to run, before the callback clears the flag under deferred_lock. A close in that interval requeues the running work, and the callback then clears the flag, leaving the requeued work pending with the flag down. A later cifs_open() can reuse the handle and its cifs_close() reaches the same branch: queue_delayed_work() fails because the work is still pending, but cifs_close() returns without dropping the closing file's reference. The cifsFileInfo count stays pinned and its tlink, dentry and server handle are leaked. Check the return value and hand off the reference only when work was actually queued. Otherwise, use the shared _cifsFileInfo_put(), like the mod_delayed_work() branch above: the pending execution already owns its reference. This issue was found by an in-house static analysis tool.
Affected
Vendors, products and packages with version ranges
| Vendor | Product | Versions | Fixed |
|---|---|---|---|
| Linux | Kernel | >=c3f207ab29f793b8c942ce8067ed123f18d5b81b <ea93759d6c2789924f4e557aed5be532207715ea, >=c3f207ab29f793b8c942ce8067ed123f18d5b81b <46d98be6c34a52182ea3c2f849a3ea0e9419eaf2, >=c3f207ab29f793b8c942ce8067ed123f18d5b81b <525c225e23d61694091f2806de553a69362a78ff, >=c3f207ab29f793b8c942ce8067ed123f18d5b81b <5520e89a5a4f834bced64cf2ac927001cc513a40, >=c3f207ab29f793b8c942ce8067ed123f18d5b81b <645a7359c1f740152464edf84f1030e0cad42c9d, >=c3f207ab29f793b8c942ce8067ed123f18d5b81b <a6767712902beb0f53238be485971c9a83ea1079, >=c3f207ab29f793b8c942ce8067ed123f18d5b81b <bbeb7a42c9ea656e17ddcbdc2d7917aa853383a6, =5.13 | ea93759d6c2789924f4e557aed5be532207715ea, 46d98be6c34a52182ea3c2f849a3ea0e9419eaf2, 525c225e23d61694091f2806de553a69362a78ff, 5520e89a5a4f834bced64cf2ac927001cc513a40, 645a7359c1f740152464edf84f1030e0cad42c9d, a6767712902beb0f53238be485971c9a83ea1079, bbeb7a42c9ea656e17ddcbdc2d7917aa853383a6 |
| linux-kernel: Kernel | >=5.16.0 <6.1.191, >=6.13.0 <6.18.54, >=6.19.0 <7.2.7, >=6.2.0 <6.6.160, >=6.7.0 <6.12.113, >=5.13.0 <5.15.224 | 6.1.191, 6.18.54, 7.2.7, 6.6.160, 6.12.113, 5.15.224 |
Timeline
Every event on this vulnerability
Related
Other vulnerabilities in Kernel, strongest first
Embed
A live severity badge for an advisory, README or ticket