# CVE-2025-22040: ksmbd: fix session use-after-free in multichannel connection

- Priority: **Routine**
- Reason: Not severe (CVSS 8.8, network access); no exploitation reported by the 5 checked sources
- Next step: Fix in the normal cadence
- Status: published
- Published: 2025-04-16 · Modified: 2026-08-05
- Aliases: UBUNTU-CVE-2025-22040, DEBIAN-CVE-2025-22040
- Record: https://cvemate.com/vulnerability/CVE-2025-22040 · JSON: https://cvemate.com/vulnerability/CVE-2025-22040/json

## Description

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

ksmbd: fix session use-after-free in multichannel connection

There is a race condition between session setup and
ksmbd_sessions_deregister. The session can be freed before the connection
is added to channel list of session.
This patch check reference count of session before freeing it.
```

## Signals

- CVSS: 8.8 high (v3.1, CVE.org) CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
- EPSS: 0.717%, percentile 55.169%, as of 2026-12-04
- Known exploited (KEV): CISA not listed, ENISA not listed, CIRCL not listed
- Ransomware use: none recorded
- Public exploits: 0

## Affected (first 20 of 131)

- debian linux (Debian): \< 6.1.135-1 \| \< 6.12.25-1
- ubuntu linux (Ubuntu): All versions (No fix recorded) \| \< 6.8.0-86.87
- ubuntu linux-allwinner-5.19 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws (Ubuntu): All versions (No fix recorded) \| \< 6.8.0-1041.43
- ubuntu linux-aws-5.0 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.11 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.13 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.15 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.19 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.3 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.8 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-6.2 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-6.5 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-6.8 (Ubuntu): \< 6.8.0-1041.43~22.04.1
- ubuntu linux-aws-fips (Ubuntu): All versions (No fix recorded) \| \< 6.8.0-1041.43+fips1
- ubuntu linux-azure (Ubuntu): All versions (No fix recorded) \| \< 6.8.0-1041.47
- ubuntu linux-azure-5.11 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-azure-5.13 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-azure-5.15 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-azure-5.19 (Ubuntu): All versions (No fix recorded)

## References (first 20 of 28)

- <https://git.kernel.org/stable/c/596407adb9af1ee75fe7c7529607783d31b66e7f>
- <https://git.kernel.org/stable/c/3980770cb1470054e6400fd97668665975726737>
- <https://git.kernel.org/stable/c/9069939d762138e232a6f79e3e1462682ed6a17d>
- <https://git.kernel.org/stable/c/94c281721d4ed2d972232414b91d98a6f5bdb16b>
- <https://git.kernel.org/stable/c/7dfbd4c43eed91dd2548a95236908025707a8dfd>
- <https://git.kernel.org/stable/c/fa4cdb8cbca7d6cb6aa13e4d8d83d1103f6345db>
- <https://lists.debian.org/debian-lts-announce/2025/05/msg00045.html>
- <https://ubuntu.com/security/CVE-2025-22040>
- <https://www.cve.org/CVERecord?id=CVE-2025-22040>
- <https://git.kernel.org/linus/fa4cdb8cbca7d6cb6aa13e4d8d83d1103f6345db>
- <https://ubuntu.com/security/notices/USN-7594-1>
- <https://ubuntu.com/security/notices/USN-7594-2>
- <https://ubuntu.com/security/notices/USN-7605-1>
- <https://ubuntu.com/security/notices/USN-7606-1>
- <https://ubuntu.com/security/notices/USN-7605-2>
- <https://ubuntu.com/security/notices/USN-7594-3>
- <https://ubuntu.com/security/notices/USN-7628-1>
- <https://ubuntu.com/security/notices/USN-7835-1>
- <https://ubuntu.com/security/notices/USN-7835-2>
- <https://ubuntu.com/security/notices/USN-7835-3>

---

Data as of 2026-12-05T04:23:05.152Z. The priority label is CveMate's own model from public evidence, not an official rating, and it knows nothing about your assets. How labels are decided: https://cvemate.com/faq#priority
