ksmbd: fix race condition between session lookup and expire
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
ksmbd: fix race condition between session lookup and expire
Thread A + Thread B ksmbd_session_lookup | smb2_sess_setup sess = xa_load | | | xa_erase(&conn->sessions, sess->id); | | ksmbd_session_destroy(sess) --> kfree(sess) | // UAF! | sess->last_active = jiffies | +
This patch add rwsem to fix race condition between ksmbd_session_lookup and ksmbd_expire_session.
From the CVE record · Linux
A race between ksmbd session lookup and session expiration can cause a use-after-free in the Linux kernel. It occurs when one thread destroys a session while another is accessing it. The input does not specify attacker access requirements or whether user interaction is needed.
Engineers running Linux kernels with ksmbd should check their versions; affected versions are not specified.