CVE-2026-139393: scsi: scsi_debug: Fix a locking bug in resp_write_same()
In the Linux kernel, the following vulnerability has been resolved:
scsi: scsidebug: Fix a locking bug in respwritesame()
If fetchtodevbuffer() fails in respwritesame(), the function jumps to 'out' without releasing the data write lock acquired earlier via sdebdatawritelock(). Jump to 'unlock' instead so that sdebdatawriteunlock() is called on the error path. This bug has been discovered by building the scsidebug driver with Clang and modified lock context annotations. The modified lock context annotations are available in patch "scsi: scsidebug: Improve lock context annotations".
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Compensating control
In resp_write_same(), make the fetch_to_dev_buffer() error path jump to the unlock label instead of out, so sdeb_data_write_unlock() releases the data write lock.
Event History
Frequently Asked Questions
What conditions trigger the bug?
The error path is reached when fetch_to_dev_buffer() fails during resp_write_same() after sdeb_data_write_lock() has been acquired. That path previously exited without calling sdeb_data_write_unlock().
Which systems are most relevant to assess?
The affected code is in the Linux kernel's scsi_debug driver. The provided information does not establish that other SCSI drivers or physical SCSI devices are affected.
What fix should be present?
The corrected error path jumps to the unlock label so that sdeb_data_write_unlock() runs before the function exits. The supplied references identify stable kernel commits containing the fix, but no affected or fixed version ranges are provided.