Skip to content
FlawDB
Sign in
Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

CVE-2026-31477

HIGH 7.5EPSS 49%

ksmbd: fix memory leaks and NULL deref in smb2_lock()

Mitigation

  • Upgrade Linux to 309b44ed684496ed3f9c5715d10b899338623512 or later.

Who should check

  • Anyone running Linux >= e2f34481b24db2fd634b5edb0a5bd0e4d38cc6e9, < cdac6f7e7e428dc70e3b5898ac6999a72ed13993; >= e2f34481b24db2fd634b5edb0a5bd0e4d38cc6e9, < c9b95ef6f5039f19e46c3a521a4fe1752d91dfe9; >= e2f34481b24db2fd634b5edb0a5bd0e4d38cc6e9, < 91aeaa7256006d79a37298f5a1df23325db91599; >= e2f34481b24db2fd634b5edb0a5bd0e4d38cc6e9, < 3cdacd11b41569ce75b3162142240f2355e04900; >= e2f34481b24db2fd634b5edb0a5bd0e4d38cc6e9, < aab42f0795620cf0d3955a520f571f697d0f9a2a; >= e2f34481b24db2fd634b5edb0a5bd0e4d38cc6e9, < 309b44ed684496ed3f9c5715d10b899338623512
  • Anyone running Linux 5.15

Vulnerability facts

Affected
Linux >= e2f34481b24db2fd634b5edb0a5bd0e4d38cc6e9, < cdac6f7e7e428dc70e3b5898ac6999a72ed13993; >= e2f34481b24db2fd634b5edb0a5bd0e4d38cc6e9, < c9b95ef6f5039f19e46c3a521a4fe1752d91dfe9; >= e2f34481b24db2fd634b5edb0a5bd0e4d38cc6e9, < 91aeaa7256006d79a37298f5a1df23325db91599; >= e2f34481b24db2fd634b5edb0a5bd0e4d38cc6e9, < 3cdacd11b41569ce75b3162142240f2355e04900; >= e2f34481b24db2fd634b5edb0a5bd0e4d38cc6e9, < aab42f0795620cf0d3955a520f571f697d0f9a2a; >= e2f34481b24db2fd634b5edb0a5bd0e4d38cc6e9, < 309b44ed684496ed3f9c5715d10b899338623512; Linux 5.15
Fixed in
Linux 91aeaa7256006d79a37298f5a1df23325db91599, Linux 3cdacd11b41569ce75b3162142240f2355e04900, Linux 309b44ed684496ed3f9c5715d10b899338623512
Exploited in the wild
Not in CISA KEV
Public exploit / PoC
None known
Remote exploitation
Remote, no login needed
CVSS
7.5 (v3.1, CNA)CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:HOpen in CVSS calculator
Show all 8 CVSS metrics
  • Attack vector: Network
  • Attack complexity: Low
  • Privileges required: None
  • User interaction: None
  • Scope: Unchanged
  • Confidentiality impact: None
  • Integrity impact: None
  • Availability impact: High
EPSS
0.71% chance of exploitation in 30 days (percentile 49, 2026-11-26)
CWE
CWE-476
Published
Modified

Description

In the Linux kernel, the following vulnerability has been resolved: ksmbd: fix memory leaks and NULL deref in smb2_lock() smb2_lock() has three error handling issues after list_del() detaches smb_lock from lock_list at no_check_cl: 1) If vfs_lock_file() returns an unexpected error in the non-UNLOCK path, goto out leaks smb_lock and its flock because the out: handler only iterates lock_list and rollback_list, neither of which contains the detached smb_lock. 2) If vfs_lock_file() returns -ENOENT in the UNLOCK path, goto out leaks smb_lock and flock for the same reason. The error code returned to the dispatcher is also stale. 3) In the rollback path, smb_flock_init() can return NULL on allocation failure. The result is dereferenced unconditionally, causing a kernel NULL pointer dereference. Add a NULL check to prevent the crash and clean up the bookkeeping; the VFS lock itself cannot be rolled back without the allocation and will be released at file or connection teardown. Fix cases 1 and 2 by hoisting the locks_free_lock()/kfree() to before the if(!rc) check in the UNLOCK branch so all exit paths share one free site, and by freeing smb_lock and flock before goto out in the non-UNLOCK branch. Propagate the correct error code in both cases. Fix case 3 by wrapping the VFS unlock in an if(rlock) guard and adding a NULL check for locks_free_lock(rlock) in the shared cleanup. Found via call-graph analysis using sqry.

Affected and fixed versions

Package / productAffectedFixedSource
Linux>= e2f34481b24db2fd634b5edb0a5bd0e4d38cc6e9, < cdac6f7e7e428dc70e3b5898ac6999a72ed13993; >= e2f34481b24db2fd634b5edb0a5bd0e4d38cc6e9, < c9b95ef6f5039f19e46c3a521a4fe1752d91dfe9; >= e2f34481b24db2fd634b5edb0a5bd0e4d38cc6e9, < 91aeaa7256006d79a37298f5a1df23325db91599; >= e2f34481b24db2fd634b5edb0a5bd0e4d38cc6e9, < 3cdacd11b41569ce75b3162142240f2355e04900; >= e2f34481b24db2fd634b5edb0a5bd0e4d38cc6e9, < aab42f0795620cf0d3955a520f571f697d0f9a2a; >= e2f34481b24db2fd634b5edb0a5bd0e4d38cc6e9, < 309b44ed684496ed3f9c5715d10b899338623512—cvelist
Linux5.15—cvelist

Check your systems with an agent

Paste this into Claude Code, Cursor or another coding agent. It only reads; it changes nothing.

Check whether anything I run is affected by CVE-2026-31477. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2026-31477.md
Affected: Linux >= e2f34481b24db2fd634b5edb0a5bd0e4d38cc6e9, < cdac6f7e7e428dc70e3b5898ac6999a72ed13993; >= e2f34481b24db2fd634b5edb0a5bd0e4d38cc6e9, < c9b95ef6f5039f19e46c3a521a4fe1752d91dfe9; >= e2f34481b24db2fd634b5edb0a5bd0e4d38cc6e9, < 91aeaa7256006d79a37298f5a1df23325db91599; >= e2f34481b24db2fd634b5ed…
Fixed in: Linux 91aeaa7256006d79a37298f5a1df23325db91599, Linux 3cdacd11b41569ce75b3162142240f2355e04900, Linux 309b44ed684496ed3f9c5715d10b899338623512

Steps:
1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.

References

FAQ

Is CVE-2026-31477 being exploited?

There is no confirmed exploitation: CVE-2026-31477 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.71% chance of exploitation in the next 30 days (as of 2026-11-26).

How serious is CVE-2026-31477?

High: CVSS 7.5 (v3.1, scored by CNA). Remote, no login needed.

Which versions are affected by CVE-2026-31477?

Linux >= e2f34481b24db2fd634b5edb0a5bd0e4d38cc6e9, < cdac6f7e7e428dc70e3b5898ac6999a72ed13993; >= e2f34481b24db2fd634b5edb0a5bd0e4d38cc6e9, < c9b95ef6f5039f19e46c3a521a4fe1752d91dfe9; >= e2f34481b24db2fd634b5edb0a5bd0e4d38cc6e9, < 91aeaa7256006d79a37298f5a1df23325db91599; >= e2f34481b24db2fd634b5edb0a5bd0e4d38cc6e9, < 3cdacd11b41569ce75b3162142240f2355e04900; >= e2f34481b24db2fd634b5edb0a5bd0e4d38cc6e9, < aab42f0795620cf0d3955a520f571f697d0f9a2a; >= e2f34481b24db2fd634b5edb0a5bd0e4d38cc6e9, < 309b44ed684496ed3f9c5715d10b899338623512; Linux 5.15.

Is there a fix for CVE-2026-31477?

Yes. Fixed in Linux 91aeaa7256006d79a37298f5a1df23325db91599, Linux 3cdacd11b41569ce75b3162142240f2355e04900, Linux 309b44ed684496ed3f9c5715d10b899338623512. Upgrade Linux to 309b44ed684496ed3f9c5715d10b899338623512 or later.

How do I check if I'm affected by CVE-2026-31477?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

Sponsors