Bug 2373545 (CVE-2022-50215) - CVE-2022-50215 kernel: scsi: sg: Allow waiting for commands to complete on removed device
Summary: CVE-2022-50215 kernel: scsi: sg: Allow waiting for commands to complete on re...
Keywords:
Status: NEW
Alias: CVE-2022-50215
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Product Security DevOps Team
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2025-06-18 12:07 UTC by OSIDB Bzimport
Modified: 2025-06-21 13:14 UTC (History)
4 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed:
Embargoed:


Attachments (Terms of Use)

Description OSIDB Bzimport 2025-06-18 12:07:42 UTC
In the Linux kernel, the following vulnerability has been resolved:

scsi: sg: Allow waiting for commands to complete on removed device

When a SCSI device is removed while in active use, currently sg will
immediately return -ENODEV on any attempt to wait for active commands that
were sent before the removal.  This is problematic for commands that use
SG_FLAG_DIRECT_IO since the data buffer may still be in use by the kernel
when userspace frees or reuses it after getting ENODEV, leading to
corrupted userspace memory (in the case of READ-type commands) or corrupted
data being sent to the device (in the case of WRITE-type commands).  This
has been seen in practice when logging out of a iscsi_tcp session, where
the iSCSI driver may still be processing commands after the device has been
marked for removal.

Change the policy to allow userspace to wait for active sg commands even
when the device is being removed.  Return -ENODEV only when there are no
more responses to read.

Comment 1 Avinash Hanwate 2025-06-21 13:03:10 UTC
Upstream advisory:
https://lore.kernel.org/linux-cve-announce/2025061845-CVE-2022-50215-d5fc@gregkh/T


Note You need to log in before you can comment on or make changes to this bug.