CVE-2026-31477

High

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.

Package Linux Kernel
Published 2026-04-22
Last modified 2026-04-27
CVSS version 3.1
Patch available
Yes

CVSS 3.1 score

7.5

out of 10
High
Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
Low
Integrity
None
Availability
High
Vector string
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

Weakness type

CWE-476

CVE-2026-31477 is a NULL Pointer Dereference vulnerability

What is NULL Pointer Dereference?

The product dereferences a pointer that it expects to be valid but is NULL, typically causing a crash. Learn more on MITRE CWE

Affected versions

Linux kernel versions 5.15 and later are affected. Fixed in 6.1.168, 6.6.131, 6.12.80, 6.18.21, 6.19.11, 7.0 and their respective stable series.

Affected from
≥ 5.15
Fixed in
✓ 6.1.168 6.1.x ✓ 6.6.131 6.6.x ✓ 6.12.80 6.12.x ✓ 6.18.21 6.18.x ✓ 6.19.11 6.19.x ✓ 7.0

References

The following references provide additional information about CVE-2026-31477 including vendor advisories, patch commits, exploit details, and third-party analysis. Links are sourced from the NIST NVD database.

Frequently asked questions

  • What is CVE-2026-31477?

    CVE-2026-31477 is a High severity Linux kernel vulnerability with a CVSS score of 7.5 out of 10 , classified as a NULL Pointer Dereference flaw (CWE-476) . It affects Linux kernel versions from 5.15 onward and has been patched in 6.1.168, 6.6.131, 6.12.80 and others. CVE-2026-31477 has not been confirmed as actively exploited and is not listed in the CISA KEV catalog.

  • What is the CVSS score for CVE-2026-31477?

    CVE-2026-31477 has a CVSS score of 7.5 out of 10, rated High severity (CVSS 3.1). The vector string is CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H .

  • Is there a patch available for CVE-2026-31477?

    Yes — CVE-2026-31477 has been patched. Fixed versions include 6.1.168, 6.6.131, 6.12.80 and others. If you are running Linux kernel 5.15 or later up to the fix versions, apply the relevant patch for your kernel branch.

  • Is CVE-2026-31477 actively exploited?

    No — CVE-2026-31477 has not been confirmed as actively exploited. It is not listed in the CISA Known Exploited Vulnerabilities (KEV) catalog.

  • What is NULL Pointer Dereference (CWE-476)?

    The product dereferences a pointer that it expects to be valid but is NULL, typically causing a crash. View CWE-476 on MITRE CWE →