{"id":"CVE-2024-53186","aliases":["CVE-2024-53186"],"related":[],"kind":"vulnerability","state":"published","title":"ksmbd: fix use-after-free in SMB request handling","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"es","text":"En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: ksmbd: se corrige el problema de use-after-free en la gestión de solicitudes SMB Existe una condición de ejecución entre la gestión de solicitudes SMB en `ksmbd_conn_handler_loop()` y la liberación de `ksmbd_conn` en el controlador de cola de trabajo `handle_ksmbd_work()`. Esto conduce a una UAF. - KASAN: slab-use-after-free Leer en handle_ksmbd_work - KASAN: slab-use-after-free en rtlock_slowlock_locked Esta condición de ejecución surge de la siguiente manera: - `ksmbd_conn_handler_loop()` espera a que `conn-&gt;r_count` llegue a cero: `wait_event(conn-&gt;r_count_q, atomic_read(&amp;conn-&gt;r_count) == 0);` - Mientras tanto, `handle_ksmbd_work()` decrementa `conn-&gt;r_count` usando `atomic_dec_return(&amp;conn-&gt;r_count)`, y si llega a cero, llama a `ksmbd_conn_free()`, que libera a `conn`. - Sin embargo, después de que `handle_ksmbd_work()` disminuya `conn-&gt;r_count`, aún puede acceder a `conn-&gt;r_count_q` en la siguiente línea: `waitqueue_active(&amp;conn-&gt;r_count_q)` o `wake_up(&amp;conn-&gt;r_count_q)` Esto da como resultado un UAF, ya que `conn` ya se ha liberado. Se puede hacer referencia al descubrimiento de este UAF en la siguiente PR para el soporte de syzkaller para solicitudes SMB.","source":"nvd"}],"published":"2024-12-27T13:49:29.215Z","modified":"2026-08-05T11:44:29.475Z","severity":{"scorer":"Linux","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"},"severities":[{"scorer":"Linux","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"},{"scorer":"CISA-ADP","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","score":7.8,"rating":"HIGH"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H","score":7,"rating":"HIGH"}],"cwes":["CWE-362","CWE-416"],"affected":[{"ranges":[{"type":"git","introduced":"18f06bacc197d4ac9b518ad1c69999bc3d83e7aa","fixed":"a96f9eb7add30ba0fafcfe7b7aca090978196800","status":"affected"},{"type":"git","introduced":"e9dac92f4482a382e8c0fe1bc243da5fc3526b0c","fixed":"f20b77f7897e6aab9ce5527e6016ad2be5d70a33","status":"affected"},{"type":"git","introduced":"ee426bfb9d09b29987369b897fe9b6485ac2be27","fixed":"96261adb998a3b513468b6ce17dbec76be5507d4","status":"affected"},{"type":"git","introduced":"ee426bfb9d09b29987369b897fe9b6485ac2be27","fixed":"9a8c5d89d327ff58e9b2517f8a6afb4181d32c6e","status":"affected"},{"type":"git","version":"9fd3cde4628bcd3549ab95061f2bab74d2ed4f3b","status":"affected"},{"type":"semver","introduced":"6.6.55","fixed":"6.6.64","status":"affected"},{"type":"semver","introduced":"6.11.3","fixed":"6.11.11","status":"affected"},{"type":"semver","introduced":"6.10.14","fixed":"6.11","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"6.12","status":"affected"},{"type":"semver","introduced":"0","fixed":"6.12","status":"unaffected"},{"type":"semver","introduced":"6.6.64","lastAffected":"6.6.*","status":"unaffected"},{"type":"semver","introduced":"6.11.11","lastAffected":"6.11.*","status":"unaffected"},{"type":"semver","introduced":"6.12.2","lastAffected":"6.12.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"6.13","lastAffected":"*","status":"unaffected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"status":"affected","introduced":"6.6.55","fixed":"6.6.64"},{"status":"affected","introduced":"6.10.14","fixed":"6.11"},{"status":"affected","introduced":"6.11.3","fixed":"6.11.11"},{"status":"affected","introduced":"6.12","fixed":"6.12.2"}],"vendor":"linux","product":"linux_kernel","cpe":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://git.kernel.org/stable/c/a96f9eb7add30ba0fafcfe7b7aca090978196800","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/f20b77f7897e6aab9ce5527e6016ad2be5d70a33","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/96261adb998a3b513468b6ce17dbec76be5507d4","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/9a8c5d89d327ff58e9b2517f8a6afb4181d32c6e","tags":["patch"],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"total","date":"2025-02-10T17:13:00.740Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2024-53186","url":"https://www.cve.org/CVERecord?id=CVE-2024-53186","licence":"CVE Terms of Use","modified":"2026-08-05T11:44:29.475Z"},{"source":"nvd","name":"NVD","id":"CVE-2024-53186","url":"https://nvd.nist.gov/vuln/detail/CVE-2024-53186","licence":"Public domain","modified":"2026-08-04T11:22:03.150Z"}],"updatedAt":"2026-11-25T22:58:50.405Z","epss":{"score":0.00456,"percentile":0.41264,"date":"2026-12-01T12:00:22.000Z"}}