# CVE-2024-53186: ksmbd: fix use-after-free in SMB request handling

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** CRITICAL 9.8
- **CVSS:** 9.8 (v3.1, CNA) `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`
- **CVSS metrics:** Attack vector: Network; Attack complexity: Low; Privileges required: None; User interaction: None; Scope: Unchanged; Confidentiality impact: High; Integrity impact: High; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Remote, no login needed
- **EPSS:** 0.61% (percentile 43, 2026-11-26)
- **CWE:** CWE-362, CWE-416
- **Published:** 2024-12-27T13:49:29.215Z
- **Modified:** 2026-08-05T11:44:29.475Z

## Who should check

- Anyone running Linux \>= 18f06bacc197d4ac9b518ad1c69999bc3d83e7aa, \< a96f9eb7add30ba0fafcfe7b7aca090978196800; \>= e9dac92f4482a382e8c0fe1bc243da5fc3526b0c, \< f20b77f7897e6aab9ce5527e6016ad2be5d70a33; \>= ee426bfb9d09b29987369b897fe9b6485ac2be27, \< 96261adb998a3b513468b6ce17dbec76be5507d4; \>= ee426bfb9d09b29987369b897fe9b6485ac2be27, \< 9a8c5d89d327ff58e9b2517f8a6afb4181d32c6e; 9fd3cde4628bcd3549ab95061f2bab74d2ed4f3b; \>= 6.6.55, \< 6.6.64; \>= 6.11.3, \< 6.11.11; \>= 6.10.14, \< 6.11
- Anyone running Linux 6.12

## Description

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

ksmbd: fix use-after-free in SMB request handling

A race condition exists between SMB request handling in
\`ksmbd\_conn\_handler\_loop()\` and the freeing of \`ksmbd\_conn\` in the
workqueue handler \`handle\_ksmbd\_work()\`. This leads to a UAF.
- KASAN: slab-use-after-free Read in handle\_ksmbd\_work
- KASAN: slab-use-after-free in rtlock\_slowlock\_locked

This race condition arises as follows:
- \`ksmbd\_conn\_handler\_loop()\` waits for \`conn-\>r\_count\` to reach zero:
  \`wait\_event(conn-\>r\_count\_q, atomic\_read(&conn-\>r\_count) == 0);\`
- Meanwhile, \`handle\_ksmbd\_work()\` decrements \`conn-\>r\_count\` using
  \`atomic\_dec\_return(&conn-\>r\_count)\`, and if it reaches zero, calls
  \`ksmbd\_conn\_free()\`, which frees \`conn\`.
- However, after \`handle\_ksmbd\_work()\` decrements \`conn-\>r\_count\`,
  it may still access \`conn-\>r\_count\_q\` in the following line:
  \`waitqueue\_active(&conn-\>r\_count\_q)\` or \`wake\_up(&conn-\>r\_count\_q)\`
  This results in a UAF, as \`conn\` has already been freed.

The discovery of this UAF can be referenced in the following PR for
syzkaller's support for SMB requests.

## Affected and fixed versions

- Linux: \>= 18f06bacc197d4ac9b518ad1c69999bc3d83e7aa, \< a96f9eb7add30ba0fafcfe7b7aca090978196800; \>= e9dac92f4482a382e8c0fe1bc243da5fc3526b0c, \< f20b77f7897e6aab9ce5527e6016ad2be5d70a33; \>= ee426bfb9d09b29987369b897fe9b6485ac2be27, \< 96261adb998a3b513468b6ce17dbec76be5507d4; \>= ee426bfb9d09b29987369b897fe9b6485ac2be27, \< 9a8c5d89d327ff58e9b2517f8a6afb4181d32c6e; 9fd3cde4628bcd3549ab95061f2bab74d2ed4f3b; \>= 6.6.55, \< 6.6.64; \>= 6.11.3, \< 6.11.11; \>= 6.10.14, \< 6.11 (cvelist)
- Linux: 6.12 (cvelist)

## Mitigation

- Upgrade Linux to 6.11 or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2024-53186. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2024-53186.md
Affected: Linux >= 18f06bacc197d4ac9b518ad1c69999bc3d83e7aa, < a96f9eb7add30ba0fafcfe7b7aca090978196800; >= e9dac92f4482a382e8c0fe1bc243da5fc3526b0c, < f20b77f7897e6aab9ce5527e6016ad2be5d70a33; >= ee426bfb9d09b29987369b897fe9b6485ac2be27, < 96261adb998a3b513468b6ce17dbec76be5507d4; >= ee426bfb9d09b29987369b8…
Fixed in: Linux 96261adb998a3b513468b6ce17dbec76be5507d4, Linux 9a8c5d89d327ff58e9b2517f8a6afb4181d32c6e, Linux 6.6.64, Linux 6.11.11, Linux 6.11

Steps:
1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2024-53186 being exploited?

There is no confirmed exploitation: CVE-2024-53186 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.61% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2024-53186?

Critical: CVSS 9.8 (v3.1, scored by CNA). Remote, no login needed.

### Which versions are affected by CVE-2024-53186?

Linux \>= 18f06bacc197d4ac9b518ad1c69999bc3d83e7aa, \< a96f9eb7add30ba0fafcfe7b7aca090978196800; \>= e9dac92f4482a382e8c0fe1bc243da5fc3526b0c, \< f20b77f7897e6aab9ce5527e6016ad2be5d70a33; \>= ee426bfb9d09b29987369b897fe9b6485ac2be27, \< 96261adb998a3b513468b6ce17dbec76be5507d4; \>= ee426bfb9d09b29987369b897fe9b6485ac2be27, \< 9a8c5d89d327ff58e9b2517f8a6afb4181d32c6e; 9fd3cde4628bcd3549ab95061f2bab74d2ed4f3b; \>= 6.6.55, \< 6.6.64; \>= 6.11.3, \< 6.11.11; \>= 6.10.14, \< 6.11; Linux 6.12.

### Is there a fix for CVE-2024-53186?

Yes. Fixed in Linux 96261adb998a3b513468b6ce17dbec76be5507d4, Linux 9a8c5d89d327ff58e9b2517f8a6afb4181d32c6e, Linux 6.6.64, Linux 6.11.11, Linux 6.11. Upgrade Linux to 6.11 or later.

### How do I check if I'm affected by CVE-2024-53186?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- patch: <https://git.kernel.org/stable/c/a96f9eb7add30ba0fafcfe7b7aca090978196800>
- patch: <https://git.kernel.org/stable/c/f20b77f7897e6aab9ce5527e6016ad2be5d70a33>
- patch: <https://git.kernel.org/stable/c/96261adb998a3b513468b6ce17dbec76be5507d4>
- patch: <https://git.kernel.org/stable/c/9a8c5d89d327ff58e9b2517f8a6afb4181d32c6e>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2024-53186>

HTML: <https://flawdb.com/CVE-2024-53186> · JSON: <https://flawdb.com/api/v1/entries/CVE-2024-53186>
