Skip to content
Fencer Vulns
critical 9.8

CVE-2026-31718 in the critical feed json

ksmbd: fix use-after-free in __ksmbd_close_fd() via durable scavenger

published 2026-05-01 6 mo ago modified 2026-08-05 3 mo ago also EUVD-2026-26527

cvss
9.8
version 3.1, CNA
cisa kev
Not listed
not in CISA's catalog
epss
0.4%
EPSS 0.4% chance of exploitation in 30 days, percentile 29%
public exploits
0
none known

Summary

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

ksmbd: fix use-after-free in __ksmbd_close_fd() via durable scavenger

When a durable file handle survives session disconnect (TCP close without SMB2_LOGOFF), session_fd_check() sets fp->conn = NULL to preserve the handle for later reconnection. However, it did not clean up the byte-range locks on fp->lock_list.

Later, when the durable scavenger thread times out and calls __ksmbd_close_fd(NULL, fp), the lock cleanup loop did:

spin_lock(&fp->conn->llist_lock);

This caused a slab use-after-free because fp->conn was NULL and the original connection object had already been freed by ksmbd_tcp_disconnect().

The root cause is asymmetric cleanup: lock entries (smb_lock->clist) were left dangling on the freed conn->lock_list while fp->conn was nulled out.

To fix this issue properly, we need to handle the lifetime of smb_lock->clist across three paths: - Safely skip clist deletion when list is empty and fp->conn is NULL. - Remove the lock from the old connection's lock_list in session_fd_check() - Re-add the lock to the new connection's lock_list in ksmbd_reopen_durable_fd().

Patch / fix

  • Linux Linux 6.6.140, 6.12.84, 6.18.25, 7.0.2, 7.1
  • linux Debian 13 6.12.85-1
  • linux Debian 14 7.0.3-1

debian advisories DEBIAN-CVE-2026-31718

  • linux Ubuntu 25.10 6.17.0-40.40
  • linux Ubuntu 26.04 LTS 7.0.0-27.27
  • linux-aws Ubuntu 25.10 6.17.0-1019.19
  • linux-aws Ubuntu 26.04 LTS 7.0.0-1008.8
  • linux-gcp Ubuntu 25.10 6.17.0-1020.22
  • linux-gcp Ubuntu 26.04 LTS 7.0.0-1007.7
  • linux-ibm Ubuntu 26.04 LTS 7.0.0-1009.9
  • linux-azure Ubuntu 26.04 LTS 7.0.0-1010.10

ubuntu advisories UBUNTU-CVE-2026-31718

Ubuntu security data © Canonical Ltd., from https://github.com/canonical/ubuntu-security-notices via OSV; changed: normalised to fixed package versions per release. CC BY-SA 4.0

  • kernel-source openSUSE Tumbleweed 7.0.7-1.1

opensuse advisories openSUSE-SU-2026:10793-1

Vendor advisories

What the vendors themselves say about their products: affected, fixed or not affected, and what to do.

red hat product security vex CVE-2026-31718 updated

kernel: ksmbd: fix use-after-free in __ksmbd_close_fd() via durable scavenger

  • Red Hat Enterprise Linux 6 perf, kernel, python-perf, kernel-kdump, kernel-firmware, kernel-bootwrapper, +1 more Red Hat Enterprise Linux 7 perf, kernel, bpftool, kernel-rt, python-perf, kernel-kdump, +8 more Red Hat Enterprise Linux 8 perf, kernel, bpftool, kernel-rt, kernel-core, kernel-tools, +29 more Red Hat Enterprise Linux 9 rv, perf, rtla, kernel, bpftool, libperf, +83 more Red Hat Enterprise Linux 10 kernel
    not affected: vulnerable code not present

Red Hat CSAF VEX © Red Hat, Inc., from https://security.access.redhat.com/data/csaf/v2/vex/; changed: reduced to product statuses and remediations. CC BY 4.0 · csaf

Exploit prediction

0.36% chance of exploitation in the next 30 days, higher than 29% of all scored CVEs (FIRST EPSS, 2026-11-08).

CVSS scores

assigned by version score vector
CNA 3.1 9.8 CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Affected products

  • Linux Linux

Classification

Weakness
Technology feeds

References

Sources

Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.