Where
-Infinity
0
Severity
8.8
Use After Free
AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

In the Linux kernel, the following vulnerability has been resolved:

ksmbd: defer publishing granted locks to prevent UAF/double-free race

In smb2lock(), mid-batch granted locks are published to connection-wide (conn->locklist) and file-wide (fp->locklist) lists immediately upon vfslockfile() success, while also remaining tracked on the stack-local rollbacklist.

If a subsequent element in the same SMB2LOCK request array fails validation or execution, the thread jumps to out: and walks rollbacklist to undo previously granted locks. However, because the granted lock was already published to conn->locklist, a concurrent UNLOCK request on the same connection can find the lock object and kfree() it before the rollback loop executes.

When the granting thread subsequently walks rollbacklist, it dereferences and frees the already-freed ksmbdlock structure, resulting in a Use-After-Free and Double-Free (on both ksmbdlock and struct filelock).

Fix this by deferring the publication of granted locks to conn->locklist and fp->locklist until after the entire array of lock elements has been processed without error. Mid-batch grants remain tracked exclusively on the request-local rollbacklist until the whole batch succeeds, eliminating the race window.

1 / 2
Source: MITRE
First published (updated )

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203