CVE-2022-50350: scsi: target: iscsi: Fix a race condition between login_work and the login thread
In the Linux kernel, the following vulnerability has been resolved:
scsi: target: iscsi: Fix a race condition between loginwork and the login thread
In case a malicious initiator sends some random data immediately after a login PDU; the iscsitargetskdataready() callback will schedule the loginwork and, at the same time, the negotiation may end without clearing the LOGINFLAGSINITIALPDU flag (because no additional PDU exchanges are required to complete the login).
The login has been completed but the loginwork function will find the LOGINFLAGSINITIALPDU flag set and will never stop from rescheduling itself; at this point, if the initiator drops the connection, the iscsitconn structure will be freed, loginwork will dereference a released socket structure and the kernel crashes.
BUG: kernel NULL pointer dereference, address: 0000000000000230 PF: supervisor write access in kernel mode PF: errorcode(0x0002) - not-present page Workqueue: events iscsitargetdologinrx [iscsitargetmod] RIP: 0010:rawreadlockbh+0x15/0x30 Call trace: iscsitargetdologinrx+0x75/0x3f0 [iscsitargetmod] processonework+0x1e8/0x3c0
Fix this bug by forcing loginwork to stop after the login has been completed and the socket callbacks have been restored.
Add a comment to clearify the return values of iscsitargetdologin()
Affected Software
Event History
Frequently Asked Questions
What is the severity of CVE-2022-50350?
The severity of CVE-2022-50350 is classified as medium due to the potential for a race condition in the SCSI target implementation.
How do I fix CVE-2022-50350?
To fix CVE-2022-50350, users should update their Linux kernel to the latest version where the vulnerability has been addressed.
Which versions of the Linux Kernel are affected by CVE-2022-50350?
CVE-2022-50350 affects multiple versions of the Linux kernel prior to the patch release that resolved this race condition.
What type of vulnerability is CVE-2022-50350?
CVE-2022-50350 is a race condition vulnerability that affects the iSCSI target implementation in the Linux kernel.
What impact does CVE-2022-50350 have on system security?
The impact of CVE-2022-50350 on system security includes the potential for an attacker to exploit the race condition, potentially leading to denial of service or arbitrary code execution.