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

- Severity: High 8.8 (CVSS:3.1, scored by Linux) `CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.72%, higher than 55% of CVEs (2026-12-01)
- Published: 2025-04-16T14:11:57.601Z
- Modified: 2026-08-05T11:56:13.212Z
- Weaknesses: CWE-416
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact total
- Assigned by: Linux

## Description

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.

(As written by CVE List.)

## Affected

- Linux Linux: from 0626e6641f6b467447c81dd7678a69c66f7746cf before 596407adb9af1ee75fe7c7529607783d31b66e7f; from 0626e6641f6b467447c81dd7678a69c66f7746cf before 3980770cb1470054e6400fd97668665975726737; from 0626e6641f6b467447c81dd7678a69c66f7746cf before 9069939d762138e232a6f79e3e1462682ed6a17d; from 0626e6641f6b467447c81dd7678a69c66f7746cf before 94c281721d4ed2d972232414b91d98a6f5bdb16b; from 0626e6641f6b467447c81dd7678a69c66f7746cf before 7dfbd4c43eed91dd2548a95236908025707a8dfd; from 0626e6641f6b467447c81dd7678a69c66f7746cf before fa4cdb8cbca7d6cb6aa13e4d8d83d1103f6345db; 5.15 (not affected: before 5.15; from 6.1.134 up to 6.1.*; from 6.6.87 up to 6.6.*; from 6.12.23 up to 6.12.*; from 6.13.11 up to 6.13.*; from 6.14.2 up to 6.14.*; from 6.15 up to *)
- linux linux_kernel: from 5.15 before 6.1.134; from 6.2 before 6.6.87; from 6.7 before 6.12.23; from 6.13 before 6.13.11; from 6.14 before 6.14.2
- debian debian_linux: 11.0

## Every score

- Linux: CVSS:3.1 8.8 High `CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- CISA-ADP: CVSS:3.1 7.8 High `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`

## References

- <https://git.kernel.org/stable/c/596407adb9af1ee75fe7c7529607783d31b66e7f> (patch)
- <https://git.kernel.org/stable/c/3980770cb1470054e6400fd97668665975726737> (patch)
- <https://git.kernel.org/stable/c/9069939d762138e232a6f79e3e1462682ed6a17d> (patch)
- <https://git.kernel.org/stable/c/94c281721d4ed2d972232414b91d98a6f5bdb16b> (patch)
- <https://git.kernel.org/stable/c/7dfbd4c43eed91dd2548a95236908025707a8dfd> (patch)
- <https://git.kernel.org/stable/c/fa4cdb8cbca7d6cb6aa13e4d8d83d1103f6345db> (patch)
- <https://lists.debian.org/debian-lts-announce/2025/05/msg00045.html> (mailing-list, third-party-advisory)

## Sources

- CVE List: [CVE-2025-22040](https://www.cve.org/CVERecord?id=CVE-2025-22040), CVE Terms of Use, modified 2026-08-05
- NVD: [CVE-2025-22040](https://nvd.nist.gov/vuln/detail/CVE-2025-22040), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2025-22040 · Whole record: https://cve.day/CVE-2025-22040.json · Rebuilt by cve.day 2026-11-25T22:58:56.578Z
