scsi: target: iscsi: Fix use-after-free in iscsit_dec_session_usage_count()
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ e48354ce078c079996f89d715dfa44814b4eba01 · < 4530f4e4d0e6a207110b0ffed0c911bca43531a4| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
scsi: target: iscsi: Fix use-after-free in iscsit_dec_session_usage_count()
In iscsit_dec_session_usage_count(), the function calls complete() while holding the sess->session_usage_lock. Similar to the connection usage count logic, the waiter signaled by complete() (e.g., in the session release path) may wake up and free the iscsit_session structure immediately.
This creates a race condition where the current thread may attempt to execute spin_unlock_bh() on a session structure that has already been deallocated, resulting in a KASAN slab-use-after-free.
To resolve this, release the session_usage_lock before calling complete() to ensure all dereferences of the sess pointer are finished before the waiter is allowed to proceed with deallocation.
From the CVE record · Linux
The Linux kernel iSCSI target has a race in session usage counting: a waiting thread can free a session before the current thread releases its lock, causing a use-after-free. The input does not specify how an attacker could trigger the race or whether authentication or user interaction is required.
Engineers running the Linux kernel with the iSCSI target should check their kernel; affected versions are not specified.