{"id":"CVE-2024-53186","state":"PUBLISHED","title":"ksmbd: fix use-after-free in SMB request handling","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nksmbd: fix use-after-free in SMB request handling\n\nA race condition exists between SMB request handling in\n`ksmbd_conn_handler_loop()` and the freeing of `ksmbd_conn` in the\nworkqueue handler `handle_ksmbd_work()`. This leads to a UAF.\n- KASAN: slab-use-after-free Read in handle_ksmbd_work\n- KASAN: slab-use-after-free in rtlock_slowlock_locked\n\nThis race condition arises as follows:\n- `ksmbd_conn_handler_loop()` waits for `conn->r_count` to reach zero:\n  `wait_event(conn->r_count_q, atomic_read(&conn->r_count) == 0);`\n- Meanwhile, `handle_ksmbd_work()` decrements `conn->r_count` using\n  `atomic_dec_return(&conn->r_count)`, and if it reaches zero, calls\n  `ksmbd_conn_free()`, which frees `conn`.\n- However, after `handle_ksmbd_work()` decrements `conn->r_count`,\n  it may still access `conn->r_count_q` in the following line:\n  `waitqueue_active(&conn->r_count_q)` or `wake_up(&conn->r_count_q)`\n  This results in a UAF, as `conn` has already been freed.\n\nThe discovery of this UAF can be referenced in the following PR for\nsyzkaller's support for SMB requests.","publishedAt":"2024-12-27T13:49:29.215Z","updatedAt":"2026-08-05T11:44:29.475Z","severity":{"score":9.8,"label":"Critical","version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","source":"Linux"},"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"18f06bacc197d4ac9b518ad1c69999bc3d83e7aa","status":"affected","lessThan":"a96f9eb7add30ba0fafcfe7b7aca090978196800","versionType":"git"},{"version":"e9dac92f4482a382e8c0fe1bc243da5fc3526b0c","status":"affected","lessThan":"f20b77f7897e6aab9ce5527e6016ad2be5d70a33","versionType":"git"},{"version":"ee426bfb9d09b29987369b897fe9b6485ac2be27","status":"affected","lessThan":"96261adb998a3b513468b6ce17dbec76be5507d4","versionType":"git"},{"version":"ee426bfb9d09b29987369b897fe9b6485ac2be27","status":"affected","lessThan":"9a8c5d89d327ff58e9b2517f8a6afb4181d32c6e","versionType":"git"},{"version":"9fd3cde4628bcd3549ab95061f2bab74d2ed4f3b","status":"affected","versionType":"git"},{"version":"6.6.55","status":"affected","lessThan":"6.6.64","versionType":"semver"},{"version":"6.11.3","status":"affected","lessThan":"6.11.11","versionType":"semver"},{"version":"6.10.14","status":"affected","lessThan":"6.11","versionType":"semver"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/smb/server/server.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"6.12","status":"affected"},{"version":"0","status":"unaffected","lessThan":"6.12","versionType":"semver"},{"version":"6.6.64","status":"unaffected","lessThanOrEqual":"6.6.*","versionType":"semver"},{"version":"6.11.11","status":"unaffected","lessThanOrEqual":"6.11.*","versionType":"semver"},{"version":"6.12.2","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.13","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/smb/server/server.c"]}],"references":["https://git.kernel.org/stable/c/a96f9eb7add30ba0fafcfe7b7aca090978196800","https://git.kernel.org/stable/c/f20b77f7897e6aab9ce5527e6016ad2be5d70a33","https://git.kernel.org/stable/c/96261adb998a3b513468b6ce17dbec76be5507d4","https://git.kernel.org/stable/c/9a8c5d89d327ff58e9b2517f8a6afb4181d32c6e"],"weaknesses":["CWE-416"],"ingestedAt":"2026-10-29T20:08:04.920Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2024/53xxx/CVE-2024-53186.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2024-53186","state":"PUBLISHED","datePublished":"2024-12-27T13:49:29.215Z","dateUpdated":"2026-08-05T11:44:29.475Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2024-11-19T17:17:25.012Z"},"containers":{"cna":{"title":"ksmbd: fix use-after-free in SMB request handling","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nksmbd: fix use-after-free in SMB request handling\n\nA race condition exists between SMB request handling in\n`ksmbd_conn_handler_loop()` and the freeing of `ksmbd_conn` in the\nworkqueue handler `handle_ksmbd_work()`. This leads to a UAF.\n- KASAN: slab-use-after-free Read in handle_ksmbd_work\n- KASAN: slab-use-after-free in rtlock_slowlock_locked\n\nThis race condition arises as follows:\n- `ksmbd_conn_handler_loop()` waits for `conn->r_count` to reach zero:\n  `wait_event(conn->r_count_q, atomic_read(&conn->r_count) == 0);`\n- Meanwhile, `handle_ksmbd_work()` decrements `conn->r_count` using\n  `atomic_dec_return(&conn->r_count)`, and if it reaches zero, calls\n  `ksmbd_conn_free()`, which frees `conn`.\n- However, after `handle_ksmbd_work()` decrements `conn->r_count`,\n  it may still access `conn->r_count_q` in the following line:\n  `waitqueue_active(&conn->r_count_q)` or `wake_up(&conn->r_count_q)`\n  This results in a UAF, as `conn` has already been freed.\n\nThe discovery of this UAF can be referenced in the following PR for\nsyzkaller's support for SMB requests."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"18f06bacc197d4ac9b518ad1c69999bc3d83e7aa","status":"affected","lessThan":"a96f9eb7add30ba0fafcfe7b7aca090978196800","versionType":"git"},{"version":"e9dac92f4482a382e8c0fe1bc243da5fc3526b0c","status":"affected","lessThan":"f20b77f7897e6aab9ce5527e6016ad2be5d70a33","versionType":"git"},{"version":"ee426bfb9d09b29987369b897fe9b6485ac2be27","status":"affected","lessThan":"96261adb998a3b513468b6ce17dbec76be5507d4","versionType":"git"},{"version":"ee426bfb9d09b29987369b897fe9b6485ac2be27","status":"affected","lessThan":"9a8c5d89d327ff58e9b2517f8a6afb4181d32c6e","versionType":"git"},{"version":"9fd3cde4628bcd3549ab95061f2bab74d2ed4f3b","status":"affected","versionType":"git"},{"version":"6.6.55","status":"affected","lessThan":"6.6.64","versionType":"semver"},{"version":"6.11.3","status":"affected","lessThan":"6.11.11","versionType":"semver"},{"version":"6.10.14","status":"affected","lessThan":"6.11","versionType":"semver"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/smb/server/server.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"6.12","status":"affected"},{"version":"0","status":"unaffected","lessThan":"6.12","versionType":"semver"},{"version":"6.6.64","status":"unaffected","lessThanOrEqual":"6.6.*","versionType":"semver"},{"version":"6.11.11","status":"unaffected","lessThanOrEqual":"6.11.*","versionType":"semver"},{"version":"6.12.2","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.13","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/smb/server/server.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/a96f9eb7add30ba0fafcfe7b7aca090978196800"},{"url":"https://git.kernel.org/stable/c/f20b77f7897e6aab9ce5527e6016ad2be5d70a33"},{"url":"https://git.kernel.org/stable/c/96261adb998a3b513468b6ce17dbec76be5507d4"},{"url":"https://git.kernel.org/stable/c/9a8c5d89d327ff58e9b2517f8a6afb4181d32c6e"}],"metrics":[{"cvssV3_1":{"version":"3.1","vectorString":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","baseScore":9.8,"baseSeverity":"CRITICAL"},"scenarios":[{"lang":"en","value":"AV:N - ksmbd is the in-kernel SMB server listening on TCP/445; the vulnerable work-completion path is driven entirely by PDUs received from a remote peer and by remote connection teardown. No local access is needed.\nAC:L - The attacker controls both sides of the race — queuing SMB work items (raising conn->r_count) and abruptly closing the TCP connection to drive ksmbd_conn_handler_loop into wait_event/free — and can retry indefinitely across many parallel connections; syzkaller reproduced it without targeting.\nPR:N - queue_ksmbd_work()/handle_ksmbd_work() run for every received PDU including the very first SMB2 NEGOTIATE, before session setup or any credential validation, so an unauthenticated remote attacker reaches the bug.\nUI:N - Exploitation requires only that the attacker open connections and send/close them; no action by any local user or administrator is involved.\nS:U - The use-after-free corrupts kernel heap memory within the same kernel security authority; no VM, IOMMU, or sandbox boundary is crossed.\nC:H - The freed ksmbd_conn is a sprayable general-cache allocation, and the UAF read of conn->r_count_q plus the list walk in wake_up() over reclaimed memory can be leveraged into kernel memory disclosure and, via the resulting control primitive, arbitrary read.\nI:H - wake_up() on the freed waitqueue writes to freed memory (spinlock acquisition and list_del in the wake function) and performs an indirect call through curr->func taken from reclaimed, attacker-sprayable memory, giving a control-flow hijack / arbitrary write primitive.\nA:H - Even without successful exploitation, the use-after-free reliably produces slab corruption, KASAN splats, and kernel oops/panic in handle_ksmbd_work or the RT lock slowpath, and can be triggered repeatedly by an unauthenticated remote peer."}]}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-08-05T11:44:29.475Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.6.55","versionEndExcluding":"6.6.64"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.11.3","versionEndExcluding":"6.11.11"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.12","versionEndExcluding":"6.12.2"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.12","versionEndExcluding":"6.13"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.10.14"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}},"adp":[{"title":"CISA ADP Vulnrichment","metrics":[{"cvssV3_1":{"scope":"UNCHANGED","version":"3.1","baseScore":7.8,"attackVector":"LOCAL","baseSeverity":"HIGH","vectorString":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","integrityImpact":"HIGH","userInteraction":"NONE","attackComplexity":"LOW","availabilityImpact":"HIGH","privilegesRequired":"LOW","confidentialityImpact":"HIGH"}},{"other":{"type":"ssvc","content":{"id":"CVE-2024-53186","role":"CISA Coordinator","options":[{"Exploitation":"none"},{"Automatable":"no"},{"Technical Impact":"total"}],"version":"2.0.3","timestamp":"2025-02-10T17:13:00.740506Z"}}}],"problemTypes":[{"descriptions":[{"cweId":"CWE-416","lang":"en","type":"CWE","description":"CWE-416 Use After Free"}]}],"providerMetadata":{"shortName":"CISA-ADP","orgId":"134c704f-9b21-4f2e-91b3-4a467353bcc0","dateUpdated":"2025-02-10T17:21:09.067Z"}}]}}}