CVE-2026-64437: ksmbd: fix use-after-free of a deferred file_lock on SMB2_CLOSE then SMB2_CANCEL

Published Jul 25, 2026
·
Updated

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

ksmbd: fix use-after-free of a deferred filelock on SMB2CLOSE then SMB2CANCEL

Commit f580d27e8928 ("ksmbd: fix use-after-free of a deferred filelock on double SMB2CANCEL") made smb2cancel() skip a work whose state is KSMBDWORKCANCELLED, so its cancelfn cannot be fired a second time. But KSMBDWORK has three states (ACTIVE, CANCELLED, CLOSED), and the same freeing producer path is reached for CLOSED too:

SMB2CLOSE on the locking handle -> setclosestateblockedworks() sets the deferred work's state to KSMBDWORKCLOSED and wakes the smb2lock() worker. The worker takes the non-ACTIVE early-exit, locksfreelock()s the filelock and, because the state is not KSMBDWORKCANCELLED, takes the STATUSRANGENOTLOCKED branch with "goto out2" -- which, like the cancelled branch, skips releaseasyncwork(). The work stays on conn->asyncrequests with a live cancelfn = smb2removeblockedlock pointing at the freed filelock.

A subsequent SMB2CANCEL for the same AsyncId then passes the KSMBDWORKCANCELLED-only guard (its state is KSMBDWORKCLOSED), so smb2cancel() fires cancelfn again over the freed filelock -- the same use-after-free fixed, via SMB2CLOSE instead of a first SMB2CANCEL:

BUG: KASAN: slab-use-after-free in locksdeleteblock locksdeleteblock locksdeleteblock ksmbdvfsposixlockunblock smb2removeblockedlock smb2cancel <- 2nd SMB2CANCEL fires cancelfn handleksmbdwork Allocated by ...: locksalloclock <- smb2lock Freed by ...: locksfreelock <- smb2lock (non-ACTIVE early-exit) ... cache filelockcache of size 192

Reproduced on mainline 7.1-rc7 (which already contains f580d27e8928) with KASAN by an authenticated SMB client; the double-SMB2CANCEL control is silent on that kernel, so the splat is attributable to the CLOSE trigger.

Only an ACTIVE deferred work may have its cancelfn fired: both terminal states (CANCELLED and CLOSED) reach the smb2lock() early-exit that frees the filelock and skips releaseasyncwork(). Guard on KSMBDWORKACTIVE so any non-active work is skipped.

Affected Software

9 affected components
Linux Kernel
Linux Linux kernel>=6.1.176<6.1.178
Linux Linux kernel>=6.6.143<6.6.145
Linux Linux kernel>=6.12.94<6.12.96
Linux Linux kernel>=6.18.36<6.18.39
Linux Linux kernel>=7.0.13<7.1
Linux Linux kernel>=7.1.1<7.1.4
Linux Linux kernel=7.1
Linux Linux kernel=7.1-rc7

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade ksmbd (Linux kernel) to a version that resolves this vulnerability.

    Patch f580d27e8928
  2. Compensating control

    Guard the deferred work cancel_fn execution so it is only fired when the work state is ACTIVE (not CANCELLED or CLOSED), matching the described KSMBD_WORK states (ACTIVE, CANCELLED, CLOSED) and the 'KSMBD_WORK_ACTIVE' / 'KSMBD_WORK_CANCELLED-only guard' behavior from the fix to prevent a second cancel_fn firing.

Event History

Jul 25, 2026
CVE Published
via MITRE·08:51 AM
Data Sourced
via MITRE·08:51 AM
DescriptionSeverity
Data Sourced
via NVD·10:17 AM
RemedyDescriptionSeverityWeaknessAffected Software

Frequently Asked Questions

1

What is the severity of CVE-2026-64437?

The severity of CVE-2026-64437 is classified as high with a CVSS score of 8.8.

2

What type of vulnerability is CVE-2026-64437?

CVE-2026-64437 is classified as a 'Use After Free' vulnerability.

3

How do I fix CVE-2026-64437?

To fix CVE-2026-64437, update to the latest patched version of the Linux kernel that includes the resolution for this vulnerability.

4

What impact does CVE-2026-64437 have on systems?

CVE-2026-64437 can lead to potential remote code execution or crashes in affected systems.

5

Which software is affected by CVE-2026-64437?

CVE-2026-64437 affects the Linux Kernel, specifically impacting ksmbd components.

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