Search CVEs and advisories

Search CVEs and Linux security advisories by vendor, product, package, or severity, and see which vulnerabilities each advisory addresses.

CVE

CVE-2026-31477

published high CVSS 3.1 · 7.5

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

Published
22 Apr 2026, 13:54:05 UTC
Updated
05 Aug 2026, 12:22:56 UTC
Language
en

Package status and fixes

Distro / vendorReleasePackage / productPublisher statusFixed buildSource
Linux — Linuxe2f34481b24db2fd634b5edb0a5bd0e4d38cc6e9 to < cdac6f7e7e428dc70e3b5898ac6999a72ed13993 · e2f34481b24db2fd634b5edb0a5bd0e4d38cc6e9 to < c9b95ef6f5039f19e46c3a521a4fe1752d91dfe9 · e2f34481b24db2fd634b5edb0a5bd0e4d38cc6e9 to < 91aeaa7256006d79a37298f5a1df23325db91599 · e2f34481b24db2fd634b5edb0a5bd0e4d38cc6e9 to < 3cdacd11b41569ce75b3162142240f2355e04900 · e2f34481b24db2fd634b5edb0a5bd0e4d38cc6e9 to < aab42f0795620cf0d3955a520f571f697d0f9a2a · e2f34481b24db2fd634b5edb0a5bd0e4d38cc6e9 to < 309b44ed684496ed3f9c5715d10b899338623512 · Other versions: unaffected Affected Not stated Linux
Linux — Linux5.15 (affected) · 0 to < 5.15 (unaffected · semver) · 6.1.168 through 6.1.* (unaffected · semver) · 6.6.131 through 6.6.* (unaffected · semver) · 6.12.80 through 6.12.* (unaffected · semver) · 6.18.21 through 6.18.* (unaffected · semver) · 6.19.11 through 6.19.* (unaffected · semver) · 7.0 and later (unaffected · original_commit_for_fix) · Other versions: affected Version-specific Not stated Linux
Amazon Linux AL2 Release evaluation Not Affected Not required Amazon Linux assessment
Amazon Linux AL2023 Release evaluation Not Affected Not required Amazon Linux assessment
Debian bookworm linux Advisory build 6.1.170-1 DSA-6243-1
Ubuntu jammy linux-aws-6.8 Advisory build 6.8.0-1061.64~22.04.1 USN-8595-3
Debian bullseye linux-6.1 Advisory build 6.1.170-1~deb11u1 DLA-4561-1
Debian trixie linux Advisory build 6.12.85-1 DSA-6238-1
Show 96 more entries
Distro / vendorReleasePackage / productPublisher statusFixed buildSource
Ubuntu jammy linux-aws-6.8-cloud-tools-6.8.0-1061 Advisory build 6.8.0-1061.64~22.04.1 USN-8595-3
Ubuntu jammy linux-aws-6.8-headers-6.8.0-1061 Advisory build 6.8.0-1061.64~22.04.1 USN-8595-3
Ubuntu jammy linux-aws-6.8-tools-6.8.0-1061 Advisory build 6.8.0-1061.64~22.04.1 USN-8595-3
Ubuntu jammy linux-azure-6.8 Advisory build 6.8.0-1063.71~22.04.1 USN-8606-1
Ubuntu jammy linux-azure-6.8-cloud-tools-6.8.0-1063 Advisory build 6.8.0-1063.71~22.04.1 USN-8606-1
Ubuntu jammy linux-azure-6.8-headers-6.8.0-1063 Advisory build 6.8.0-1063.71~22.04.1 USN-8606-1
Ubuntu jammy linux-azure-6.8-tools-6.8.0-1063 Advisory build 6.8.0-1063.71~22.04.1 USN-8606-1
Ubuntu jammy linux-azure-fde-6.8 Advisory build 6.8.0-1062.69~22.04.1 USN-8609-1
Ubuntu jammy linux-azure-fde-6.8-cloud-tools-6.8.0-1062 Advisory build 6.8.0-1062.69~22.04.1 USN-8609-1
Ubuntu jammy linux-azure-fde-6.8-headers-6.8.0-1062 Advisory build 6.8.0-1062.69~22.04.1 USN-8609-1
Ubuntu jammy linux-azure-fde-6.8-tools-6.8.0-1062 Advisory build 6.8.0-1062.69~22.04.1 USN-8609-1
Ubuntu jammy linux-buildinfo-6.8.0-1058-oracle Advisory build 6.8.0-1058.61~22.04.1 USN-8595-1
Ubuntu jammy linux-buildinfo-6.8.0-1058-oracle-64k Advisory build 6.8.0-1058.61~22.04.1 USN-8595-1
Ubuntu jammy linux-buildinfo-6.8.0-1059-nvidia Advisory build 6.8.0-1059.62~22.04.1 USN-8596-1
Ubuntu jammy linux-buildinfo-6.8.0-1059-nvidia-64k Advisory build 6.8.0-1059.62~22.04.1 USN-8596-1
Ubuntu jammy linux-buildinfo-6.8.0-1061-aws Advisory build 6.8.0-1061.64~22.04.1 USN-8595-3
Ubuntu jammy linux-buildinfo-6.8.0-1061-aws-64k Advisory build 6.8.0-1061.64~22.04.1 USN-8595-3
Ubuntu jammy linux-buildinfo-6.8.0-1061-ibm Advisory build 6.8.0-1061.62~22.04.1 USN-8574-3
Ubuntu jammy linux-buildinfo-6.8.0-1062-azure-fde Advisory build 6.8.0-1062.69~22.04.1 USN-8609-1
Ubuntu jammy linux-buildinfo-6.8.0-1063-azure Advisory build 6.8.0-1063.71~22.04.1 USN-8606-1
Ubuntu jammy linux-buildinfo-6.8.0-1064-gcp Advisory build 6.8.0-1064.72~22.04.1 USN-8567-1
Ubuntu jammy linux-buildinfo-6.8.0-1064-gcp-64k Advisory build 6.8.0-1064.72~22.04.1 USN-8567-1
Ubuntu jammy linux-buildinfo-6.8.0-136-generic Advisory build 6.8.0-136.136~22.04.1 USN-8619-1
Ubuntu jammy linux-buildinfo-6.8.0-136-generic-64k Advisory build 6.8.0-136.136~22.04.1 USN-8619-1
Ubuntu jammy linux-buildinfo-6.8.0-136-lowlatency Advisory build 6.8.0-136.136.2~22.04.1 USN-8574-2
Ubuntu jammy linux-buildinfo-6.8.0-136-lowlatency-64k Advisory build 6.8.0-136.136.2~22.04.1 USN-8574-2
Ubuntu jammy linux-buildinfo-6.8.1-1056-realtime Advisory build 6.8.1-1056.57~22.04.2 USN-8567-1
Ubuntu jammy linux-cloud-tools-6.8.0-1061-aws Advisory build 6.8.0-1061.64~22.04.1 USN-8595-3
Ubuntu jammy linux-cloud-tools-6.8.0-1061-aws-64k Advisory build 6.8.0-1061.64~22.04.1 USN-8595-3
Ubuntu jammy linux-cloud-tools-6.8.0-1062-azure-fde Advisory build 6.8.0-1062.69~22.04.1 USN-8609-1
Ubuntu jammy linux-cloud-tools-6.8.0-1063-azure Advisory build 6.8.0-1063.71~22.04.1 USN-8606-1
Ubuntu jammy linux-cloud-tools-6.8.0-136-generic Advisory build 6.8.0-136.136~22.04.1 USN-8619-1
Ubuntu jammy linux-cloud-tools-6.8.0-136-lowlatency Advisory build 6.8.0-136.136.2~22.04.1 USN-8574-2
Ubuntu jammy linux-cloud-tools-6.8.1-1056-realtime Advisory build 6.8.1-1056.57~22.04.2 USN-8567-1
Ubuntu jammy linux-gcp-6.8 Advisory build 6.8.0-1064.72~22.04.1 USN-8567-1
Ubuntu jammy linux-gcp-6.8-headers-6.8.0-1064 Advisory build 6.8.0-1064.72~22.04.1 USN-8567-1
Ubuntu jammy linux-gcp-6.8-tools-6.8.0-1064 Advisory build 6.8.0-1064.72~22.04.1 USN-8567-1
Ubuntu jammy linux-headers-6.8.0-1058-oracle Advisory build 6.8.0-1058.61~22.04.1 USN-8595-1
Ubuntu jammy linux-headers-6.8.0-1058-oracle-64k Advisory build 6.8.0-1058.61~22.04.1 USN-8595-1
Ubuntu jammy linux-headers-6.8.0-1059-nvidia Advisory build 6.8.0-1059.62~22.04.1 USN-8596-1
Ubuntu jammy linux-headers-6.8.0-1059-nvidia-64k Advisory build 6.8.0-1059.62~22.04.1 USN-8596-1
Ubuntu jammy linux-headers-6.8.0-1061-aws Advisory build 6.8.0-1061.64~22.04.1 USN-8595-3
Ubuntu jammy linux-headers-6.8.0-1061-aws-64k Advisory build 6.8.0-1061.64~22.04.1 USN-8595-3
Ubuntu jammy linux-headers-6.8.0-1061-ibm Advisory build 6.8.0-1061.62~22.04.1 USN-8574-3
Ubuntu jammy linux-headers-6.8.0-1062-azure-fde Advisory build 6.8.0-1062.69~22.04.1 USN-8609-1
Ubuntu jammy linux-headers-6.8.0-1063-azure Advisory build 6.8.0-1063.71~22.04.1 USN-8606-1
Ubuntu jammy linux-headers-6.8.0-1064-gcp Advisory build 6.8.0-1064.72~22.04.1 USN-8567-1
Ubuntu jammy linux-headers-6.8.0-1064-gcp-64k Advisory build 6.8.0-1064.72~22.04.1 USN-8567-1
Ubuntu jammy linux-headers-6.8.0-136-generic Advisory build 6.8.0-136.136~22.04.1 USN-8619-1
Ubuntu jammy linux-headers-6.8.0-136-generic-64k Advisory build 6.8.0-136.136~22.04.1 USN-8619-1
Ubuntu jammy linux-headers-6.8.0-136-lowlatency Advisory build 6.8.0-136.136.2~22.04.1 USN-8574-2
Ubuntu jammy linux-headers-6.8.0-136-lowlatency-64k Advisory build 6.8.0-136.136.2~22.04.1 USN-8574-2
Ubuntu jammy linux-headers-6.8.1-1056-realtime Advisory build 6.8.1-1056.57~22.04.2 USN-8567-1
Ubuntu jammy linux-hwe-6.8 Advisory build 6.8.0-136.136~22.04.1 USN-8619-1
Ubuntu jammy linux-hwe-6.8-cloud-tools-6.8.0-136 Advisory build 6.8.0-136.136~22.04.1 USN-8619-1
Ubuntu jammy linux-hwe-6.8-headers-6.8.0-136 Advisory build 6.8.0-136.136~22.04.1 USN-8619-1
Ubuntu jammy linux-hwe-6.8-tools-6.8.0-136 Advisory build 6.8.0-136.136~22.04.1 USN-8619-1
Ubuntu jammy linux-ibm-6.8 Advisory build 6.8.0-1061.62~22.04.1 USN-8574-3
Ubuntu jammy linux-ibm-6.8-headers-6.8.0-1061 Advisory build 6.8.0-1061.62~22.04.1 USN-8574-3
Ubuntu jammy linux-ibm-6.8-tools-6.8.0-1061 Advisory build 6.8.0-1061.62~22.04.1 USN-8574-3
Ubuntu jammy linux-image-6.8.0-136-generic Advisory build 6.8.0-136.136~22.04.1 USN-8619-1
Ubuntu jammy linux-image-unsigned-6.8.0-1058-oracle Advisory build 6.8.0-1058.61~22.04.1 USN-8595-1
Ubuntu jammy linux-image-unsigned-6.8.0-1058-oracle-64k Advisory build 6.8.0-1058.61~22.04.1 USN-8595-1
Ubuntu jammy linux-image-unsigned-6.8.0-1059-nvidia Advisory build 6.8.0-1059.62~22.04.1 USN-8596-1
Ubuntu jammy linux-image-unsigned-6.8.0-1059-nvidia-64k Advisory build 6.8.0-1059.62~22.04.1 USN-8596-1
Ubuntu jammy linux-image-unsigned-6.8.0-1061-aws Advisory build 6.8.0-1061.64~22.04.1 USN-8595-3
Ubuntu jammy linux-image-unsigned-6.8.0-1061-aws-64k Advisory build 6.8.0-1061.64~22.04.1 USN-8595-3
Ubuntu jammy linux-image-unsigned-6.8.0-1061-ibm Advisory build 6.8.0-1061.62~22.04.1 USN-8574-3
Ubuntu jammy linux-image-unsigned-6.8.0-1062-azure-fde Advisory build 6.8.0-1062.69~22.04.1 USN-8609-1
Ubuntu jammy linux-image-unsigned-6.8.0-1063-azure Advisory build 6.8.0-1063.71~22.04.1 USN-8606-1
Ubuntu jammy linux-image-unsigned-6.8.0-1064-gcp Advisory build 6.8.0-1064.72~22.04.1 USN-8567-1
Ubuntu jammy linux-image-unsigned-6.8.0-1064-gcp-64k Advisory build 6.8.0-1064.72~22.04.1 USN-8567-1
Ubuntu jammy linux-image-unsigned-6.8.0-136-generic Advisory build 6.8.0-136.136~22.04.1 USN-8619-1
Ubuntu jammy linux-image-unsigned-6.8.0-136-generic-64k Advisory build 6.8.0-136.136~22.04.1 USN-8619-1
Ubuntu jammy linux-image-unsigned-6.8.0-136-lowlatency Advisory build 6.8.0-136.136.2~22.04.1 USN-8574-2
Ubuntu jammy linux-image-unsigned-6.8.0-136-lowlatency-64k Advisory build 6.8.0-136.136.2~22.04.1 USN-8574-2
Ubuntu jammy linux-image-unsigned-6.8.1-1056-realtime Advisory build 6.8.1-1056.57~22.04.2 USN-8567-1
Ubuntu jammy linux-lowlatency-hwe-6.8 Advisory build 6.8.0-136.136.2~22.04.1 USN-8574-2
Ubuntu jammy linux-lowlatency-hwe-6.8-cloud-tools-6.8.0-136 Advisory build 6.8.0-136.136.2~22.04.1 USN-8574-2
Ubuntu jammy linux-lowlatency-hwe-6.8-headers-6.8.0-136 Advisory build 6.8.0-136.136.2~22.04.1 USN-8574-2
Ubuntu jammy linux-lowlatency-hwe-6.8-lib-rust-6.8.0-136-lowlatency Advisory build 6.8.0-136.136.2~22.04.1 USN-8574-2
Ubuntu jammy linux-lowlatency-hwe-6.8-tools-6.8.0-136 Advisory build 6.8.0-136.136.2~22.04.1 USN-8574-2
Ubuntu jammy linux-modules-6.8.0-1058-oracle Advisory build 6.8.0-1058.61~22.04.1 USN-8595-1
Ubuntu jammy linux-modules-6.8.0-1058-oracle-64k Advisory build 6.8.0-1058.61~22.04.1 USN-8595-1
Ubuntu jammy linux-modules-6.8.0-1059-nvidia Advisory build 6.8.0-1059.62~22.04.1 USN-8596-1
Ubuntu jammy linux-modules-6.8.0-1059-nvidia-64k Advisory build 6.8.0-1059.62~22.04.1 USN-8596-1
Ubuntu jammy linux-modules-6.8.0-1061-aws Advisory build 6.8.0-1061.64~22.04.1 USN-8595-3
Ubuntu jammy linux-modules-6.8.0-1061-aws-64k Advisory build 6.8.0-1061.64~22.04.1 USN-8595-3
Ubuntu jammy linux-modules-6.8.0-1061-ibm Advisory build 6.8.0-1061.62~22.04.1 USN-8574-3
Ubuntu jammy linux-modules-6.8.0-1062-azure-fde Advisory build 6.8.0-1062.69~22.04.1 USN-8609-1
Ubuntu jammy linux-modules-6.8.0-1063-azure Advisory build 6.8.0-1063.71~22.04.1 USN-8606-1
Ubuntu jammy linux-modules-6.8.0-1064-gcp Advisory build 6.8.0-1064.72~22.04.1 USN-8567-1
Ubuntu jammy linux-modules-6.8.0-1064-gcp-64k Advisory build 6.8.0-1064.72~22.04.1 USN-8567-1
Ubuntu jammy linux-modules-6.8.0-136-generic Advisory build 6.8.0-136.136~22.04.1 USN-8619-1
Ubuntu jammy linux-modules-6.8.0-136-generic-64k Advisory build 6.8.0-136.136~22.04.1 USN-8619-1
Ubuntu jammy linux-modules-6.8.0-136-lowlatency Advisory build 6.8.0-136.136.2~22.04.1 USN-8574-2

Package entries are limited to the first 100 builds and 100 linked advisories.

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.

en · Linux · cna

Vendor advisories explicitly linked to this CVE.

23

Assessment

CVSS risk assessment and additional context for this vulnerability.

CVSS version
3.1
Base score
7.5 / 10
Severity
high
Provider
Linux · cna
Vector string
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Scenarios
en: AV:N - ksmbd is the in-kernel SMB server reachable over the network, normally via SMB over TCP port 445. The vulnerable `SMB2_LOCK` handler processes attacker-supplied SMB2 requests from a remote client. AC:L - The attacker controls the SMB2 LOCK request sequence and can repeatedly issue crafted lock/unlock operations after reaching a share and file handle. No race or condition outside attacker influence is required for the leak paths, and the crash path is reachable through normal rollback error handling under allocation pressure. PR:N - Although `SMB2_LOCK` is post-session and requires a tree connection and file handle, ksmbd supports guest/anonymous sessions. In a reasonable guest-accessible SMB share deployment, a remote attacker needs no prior credentials to negotiate, connect, open a file, and issue LOCK requests. UI:N - No victim user action is required. The server processes the network requests directly. S:U - The vulnerability affects the kernel SMB server and impacts the same kernel/server security authority. It does not cross a virtualization, sandbox, or separate authorization boundary. C:N - The fixed issues are internal memory leaks and a NULL pointer dereference. They do not provide an information disclosure or arbitrary/kernel memory read primitive. I:N - The bug does not provide attacker-controlled writes, memory corruption, or control-flow hijacking. Any stale lock bookkeeping affects availability rather than integrity of data or security state. A:H - The rollback path can dereference a NULL `file_lock` allocation result, causing a kernel oops/panic. The leak paths can also be triggered repeatedly to exhaust kernel memory/resources.

Publisher product statements

Version ranges and default statuses as reported by each provider.

Affected vendor and product assertions
VendorProductVersion statusSource
Linux Linux e2f34481b24db2fd634b5edb0a5bd0e4d38cc6e9 to < cdac6f7e7e428dc70e3b5898ac6999a72ed13993 (affected · git)e2f34481b24db2fd634b5edb0a5bd0e4d38cc6e9 to < c9b95ef6f5039f19e46c3a521a4fe1752d91dfe9 (affected · git)e2f34481b24db2fd634b5edb0a5bd0e4d38cc6e9 to < 91aeaa7256006d79a37298f5a1df23325db91599 (affected · git)e2f34481b24db2fd634b5edb0a5bd0e4d38cc6e9 to < 3cdacd11b41569ce75b3162142240f2355e04900 (affected · git)e2f34481b24db2fd634b5edb0a5bd0e4d38cc6e9 to < aab42f0795620cf0d3955a520f571f697d0f9a2a (affected · git)e2f34481b24db2fd634b5edb0a5bd0e4d38cc6e9 to < 309b44ed684496ed3f9c5715d10b899338623512 (affected · git)Default: unaffected Linux · cna
Linux Linux 5.15 (affected)0 to < 5.15 (unaffected · semver)6.1.168 through 6.1.* (unaffected · semver)6.6.131 through 6.6.* (unaffected · semver)6.12.80 through 6.12.* (unaffected · semver)6.18.21 through 6.18.* (unaffected · semver)6.19.11 through 6.19.* (unaffected · semver)7.0 and later (unaffected · original_commit_for_fix)Default: affected Linux · cna

Weaknesses

0

No weakness assertions.

References

6

Provider assertions

1

Linux · cna

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

Provenance

Schema
5.2
Searchable
yes
Content hash
7146d68fc6a4fe5533f021e8b08885710dac84d36e379b38141966cd797ce5a9
Ingested
23 Sep 2026, 09:09:24 UTC
Source record
Official CVE record

Search filters

Match options apply to free text. CVE words match tokens; use contains:"…" for literal substrings.

Text

Words and phrases
buffer overflow "remote code execution"
Word prefix
auth*
Literal substring (title or description)
contains:"use-after-free"
Exclude a term or filter
-test -vendor:example

Affected product

Vendor
vendor:Example
Product
product:"Demo Widget"

Severity and score

Severity · none, low, medium, high, critical, unknown
severity:critical
CWE identifier
cwe:CWE-863
CVSS score (0–10)
cvss:>=7.0

Dates and status

Published date · comparisons, relative days
published:>=2026-01-01
Updated date · comparisons, relative days
updated:<30d
Status · published (default), rejected, unknown
status:rejected