Vulnerability · Published May 1, 2026 · Assigned by Linux
CVE-2026-31718ksmbd: fix use-after-free in __ksmbd_close_fd() via durable scavenger
Critical 9.8
In plain English
A critical-severity security flaw in Linux from Linux. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 0.4% (higher than 30% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.
Official description
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().
Affected packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian:13 | linux | 6.12.85-1 | DEBIAN-CVE-2026-31718 |
| Debian:14 | linux | 7.0.3-1 | DEBIAN-CVE-2026-31718 |
| Ubuntu:25.10 | linux | 6.17.0-40.40 | UBUNTU-CVE-2026-31718 |
| Ubuntu:25.10 | linux | 6.17.0-40.40 | USN-8490-1 |
| Ubuntu:26.04:LTS | linux | 7.0.0-27.27 | UBUNTU-CVE-2026-31718 |
| Ubuntu:22.04:LTS | linux-allwinner-5.19 | no fix listed | UBUNTU-CVE-2026-31718 |
| Ubuntu:25.10 | linux-aws | 6.17.0-1019.19 | UBUNTU-CVE-2026-31718 |
| Ubuntu:25.10 | linux-aws | 6.17.0-1019.19 | USN-8490-1 |
| Ubuntu:26.04:LTS | linux-aws | 7.0.0-1008.8 | UBUNTU-CVE-2026-31718 |
| Ubuntu:22.04:LTS | linux-aws-5.19 | no fix listed | UBUNTU-CVE-2026-31718 |
| Ubuntu:24.04:LTS | linux-aws-6.14 | no fix listed | UBUNTU-CVE-2026-31718 |
| Ubuntu:24.04:LTS | linux-aws-6.17 | 6.17.0-1019.19~24.04.1 | UBUNTU-CVE-2026-31718 |
| Ubuntu:24.04:LTS | linux-aws-6.17 | 6.17.0-1019.19~24.04.1 | USN-8490-1 |
| Ubuntu:22.04:LTS | linux-aws-6.2 | no fix listed | UBUNTU-CVE-2026-31718 |
| Ubuntu:22.04:LTS | linux-aws-6.5 | no fix listed | UBUNTU-CVE-2026-31718 |
| Ubuntu:25.10 | linux-azure | no fix listed | UBUNTU-CVE-2026-31718 |
| Ubuntu:26.04:LTS | linux-azure | 7.0.0-1010.10 | UBUNTU-CVE-2026-31718 |
| Ubuntu:22.04:LTS | linux-azure-5.19 | no fix listed | UBUNTU-CVE-2026-31718 |
| Ubuntu:24.04:LTS | linux-azure-6.11 | no fix listed | UBUNTU-CVE-2026-31718 |
| Ubuntu:24.04:LTS | linux-azure-6.14 | no fix listed | UBUNTU-CVE-2026-31718 |
| Ubuntu:24.04:LTS | linux-azure-6.17 | 6.17.0-1021.21~24.04.1 | UBUNTU-CVE-2026-31718 |
| Ubuntu:22.04:LTS | linux-azure-6.2 | no fix listed | UBUNTU-CVE-2026-31718 |
| Ubuntu:22.04:LTS | linux-azure-6.5 | no fix listed | UBUNTU-CVE-2026-31718 |
| Ubuntu:25.10 | linux-azure-fde | no fix listed | UBUNTU-CVE-2026-31718 |
| Ubuntu:26.04:LTS | linux-azure-fde | 7.0.0-1009.9 | UBUNTU-CVE-2026-31718 |
| Ubuntu:22.04:LTS | linux-azure-fde-5.19 | no fix listed | UBUNTU-CVE-2026-31718 |
| Ubuntu:24.04:LTS | linux-azure-fde-6.14 | no fix listed | UBUNTU-CVE-2026-31718 |
| Ubuntu:22.04:LTS | linux-azure-fde-6.2 | no fix listed | UBUNTU-CVE-2026-31718 |
| Ubuntu:24.04:LTS | linux-azure-nvidia-6.14 | no fix listed | UBUNTU-CVE-2026-31718 |
| Ubuntu:25.10 | linux-gcp | 6.17.0-1020.22 | USN-8490-1 |
| Ubuntu:25.10 | linux-gcp | 6.17.0-1020.22 | UBUNTU-CVE-2026-31718 |
| Ubuntu:26.04:LTS | linux-gcp | 7.0.0-1007.7 | UBUNTU-CVE-2026-31718 |
| Ubuntu:22.04:LTS | linux-gcp-5.19 | no fix listed | UBUNTU-CVE-2026-31718 |
| Ubuntu:24.04:LTS | linux-gcp-6.11 | no fix listed | UBUNTU-CVE-2026-31718 |
| Ubuntu:24.04:LTS | linux-gcp-6.14 | no fix listed | UBUNTU-CVE-2026-31718 |
| Ubuntu:24.04:LTS | linux-gcp-6.17 | 6.17.0-1020.22~24.04.1 | USN-8490-1 |
| Ubuntu:24.04:LTS | linux-gcp-6.17 | 6.17.0-1020.22~24.04.1 | UBUNTU-CVE-2026-31718 |
| Ubuntu:22.04:LTS | linux-gcp-6.2 | no fix listed | UBUNTU-CVE-2026-31718 |
| Ubuntu:22.04:LTS | linux-gcp-6.5 | no fix listed | UBUNTU-CVE-2026-31718 |
| Ubuntu:22.04:LTS | linux-hwe-5.19 | no fix listed | UBUNTU-CVE-2026-31718 |
| Ubuntu:24.04:LTS | linux-hwe-6.11 | no fix listed | UBUNTU-CVE-2026-31718 |
| Ubuntu:24.04:LTS | linux-hwe-6.14 | no fix listed | UBUNTU-CVE-2026-31718 |
| Ubuntu:24.04:LTS | linux-hwe-6.17 | 6.17.0-40.40~24.04.1 | USN-8545-1 |
| Ubuntu:24.04:LTS | linux-hwe-6.17 | 6.17.0-40.40~24.04.1 | UBUNTU-CVE-2026-31718 |
| Ubuntu:22.04:LTS | linux-hwe-6.2 | no fix listed | UBUNTU-CVE-2026-31718 |
| Ubuntu:22.04:LTS | linux-hwe-6.5 | no fix listed | UBUNTU-CVE-2026-31718 |
| Ubuntu:24.04:LTS | linux-hwe-7.0 | 7.0.0-28.28~24.04.1 | UBUNTU-CVE-2026-31718 |
| Ubuntu:26.04:LTS | linux-ibm | 7.0.0-1009.9 | UBUNTU-CVE-2026-31718 |
| Ubuntu:22.04:LTS | linux-intel-iot-realtime | no fix listed | UBUNTU-CVE-2026-31718 |
| Ubuntu:22.04:LTS | linux-lowlatency-hwe-5.19 | no fix listed | UBUNTU-CVE-2026-31718 |
| Ubuntu:24.04:LTS | linux-lowlatency-hwe-6.11 | no fix listed | UBUNTU-CVE-2026-31718 |
| Ubuntu:22.04:LTS | linux-lowlatency-hwe-6.2 | no fix listed | UBUNTU-CVE-2026-31718 |
| Ubuntu:22.04:LTS | linux-lowlatency-hwe-6.5 | no fix listed | UBUNTU-CVE-2026-31718 |
| Ubuntu:26.04:LTS | linux-nvidia | 7.0.0-1013.13 | UBUNTU-CVE-2026-31718 |
| Ubuntu:24.04:LTS | linux-nvidia-6.11 | no fix listed | UBUNTU-CVE-2026-31718 |
| Ubuntu:24.04:LTS | linux-nvidia-6.17 | 6.17.0-1026.26 | USN-8508-1 |
| Ubuntu:24.04:LTS | linux-nvidia-6.17 | 6.17.0-1026.26 | UBUNTU-CVE-2026-31718 |
| Ubuntu:22.04:LTS | linux-nvidia-6.2 | no fix listed | UBUNTU-CVE-2026-31718 |
| Ubuntu:22.04:LTS | linux-nvidia-6.5 | no fix listed | UBUNTU-CVE-2026-31718 |
| Ubuntu:22.04:LTS | linux-oem-5.17 | no fix listed | UBUNTU-CVE-2026-31718 |
| Ubuntu:22.04:LTS | linux-oem-6.0 | no fix listed | UBUNTU-CVE-2026-31718 |
| Ubuntu:22.04:LTS | linux-oem-6.1 | no fix listed | UBUNTU-CVE-2026-31718 |
| Ubuntu:24.04:LTS | linux-oem-6.11 | no fix listed | UBUNTU-CVE-2026-31718 |
| Ubuntu:24.04:LTS | linux-oem-6.14 | no fix listed | UBUNTU-CVE-2026-31718 |
| Ubuntu:24.04:LTS | linux-oem-6.17 | 6.17.0-1028.28 | UBUNTU-CVE-2026-31718 |
| Ubuntu:24.04:LTS | linux-oem-6.17 | 6.17.0-1028.28 | USN-8491-1 |
| Ubuntu:22.04:LTS | linux-oem-6.5 | no fix listed | UBUNTU-CVE-2026-31718 |
| Ubuntu:24.04:LTS | linux-oem-6.8 | no fix listed | UBUNTU-CVE-2026-31718 |
| Ubuntu:25.10 | linux-oracle | 6.17.0-1018.18 | UBUNTU-CVE-2026-31718 |
| Ubuntu:25.10 | linux-oracle | 6.17.0-1018.18 | USN-8490-1 |
| Ubuntu:26.04:LTS | linux-oracle | 7.0.0-1007.7 | UBUNTU-CVE-2026-31718 |
| Ubuntu:24.04:LTS | linux-oracle-6.14 | no fix listed | UBUNTU-CVE-2026-31718 |
| Ubuntu:24.04:LTS | linux-oracle-6.17 | 6.17.0-1018.18~24.04.1 | UBUNTU-CVE-2026-31718 |
| Ubuntu:24.04:LTS | linux-oracle-6.17 | 6.17.0-1018.18~24.04.1 | USN-8490-1 |
| Ubuntu:22.04:LTS | linux-oracle-6.5 | no fix listed | UBUNTU-CVE-2026-31718 |
| Ubuntu:25.10 | linux-raspi | 6.17.0-1021.21 | UBUNTU-CVE-2026-31718 |
| Ubuntu:25.10 | linux-raspi | 6.17.0-1021.21 | USN-8546-1 |
| Ubuntu:26.04:LTS | linux-raspi | 7.0.0-1014.14 | UBUNTU-CVE-2026-31718 |
| Ubuntu:24.04:LTS | linux-raspi-realtime | no fix listed | UBUNTU-CVE-2026-31718 |
| Ubuntu:22.04:LTS | linux-realtime | no fix listed | UBUNTU-CVE-2026-31718 |
| Ubuntu:24.04:LTS | linux-realtime | no fix listed | UBUNTU-CVE-2026-31718 |
| Ubuntu:25.10 | linux-realtime | 6.17.0-1017.19 | UBUNTU-CVE-2026-31718 |
| Ubuntu:25.10 | linux-realtime | 6.17.0-1017.19 | USN-8490-2 |
| Ubuntu:26.04:LTS | linux-realtime | 7.0.0-27.27.1 | UBUNTU-CVE-2026-31718 |
| Ubuntu:22.04:LTS | linux-riscv | no fix listed | UBUNTU-CVE-2026-31718 |
| Ubuntu:24.04:LTS | linux-riscv | no fix listed | UBUNTU-CVE-2026-31718 |
| Ubuntu:25.10 | linux-riscv | 6.17.0-40.40.1 | UBUNTU-CVE-2026-31718 |
| Ubuntu:26.04:LTS | linux-riscv | 7.0.0-27.27.1 | UBUNTU-CVE-2026-31718 |
| Ubuntu:22.04:LTS | linux-riscv-5.19 | no fix listed | UBUNTU-CVE-2026-31718 |
| Ubuntu:24.04:LTS | linux-riscv-6.14 | no fix listed | UBUNTU-CVE-2026-31718 |
| Ubuntu:24.04:LTS | linux-riscv-6.17 | no fix listed | UBUNTU-CVE-2026-31718 |
| Ubuntu:22.04:LTS | linux-riscv-6.5 | no fix listed | UBUNTU-CVE-2026-31718 |
| Ubuntu:22.04:LTS | linux-starfive-5.19 | no fix listed | UBUNTU-CVE-2026-31718 |
| Ubuntu:22.04:LTS | linux-starfive-6.2 | no fix listed | UBUNTU-CVE-2026-31718 |
| Ubuntu:22.04:LTS | linux-starfive-6.5 | no fix listed | UBUNTU-CVE-2026-31718 |
Affected products (as reported)
| Vendor | Product | Versions |
|---|---|---|
| Linux | Linux | 8df4bcdb0a4232192b2445256c39b787d58ef14d – before 0000a7780e0e446a28a273572f6ea8f7f582f694c8efcc786146a951091588e5fa7e3c754850cb3c – before e33c65f011980b4ad4abfd93585ec2079856368fc8efcc786146a951091588e5fa7e3c754850cb3c – before 3d6682726c2d3a46d31dae88b8166786b09b03adc8efcc786146a951091588e5fa7e3c754850cb3c – before b34fc42cfe922e551f7a27d3ac3bb016e41d7dd9c8efcc786146a951091588e5fa7e3c754850cb3c – before 235e32320a470fcd3998fb3774f2290a0eb302a16.6.32 – before 6.6.140 |
| Linux | Linux | 6.9 |
References
- https://git.kernel.org/stable/c/0000a7780e0e446a28a273572f6ea8f7f582f694
- https://git.kernel.org/stable/c/e33c65f011980b4ad4abfd93585ec2079856368f
- https://git.kernel.org/stable/c/3d6682726c2d3a46d31dae88b8166786b09b03ad
- https://git.kernel.org/stable/c/b34fc42cfe922e551f7a27d3ac3bb016e41d7dd9
- https://git.kernel.org/stable/c/235e32320a470fcd3998fb3774f2290a0eb302a1