CVE-2022-50215

CVE-2022-50215

High · published June 18, 2025

CVSS v3.1
7.8
EPSS
0%
Percentile
15.9
In the wild
Unconfirmed
What it is

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.

The record
Technical detail
CVSS v3.1
7.8 · HIGH
Vector
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
CVSS v4.0
Not supplied
EPSS
0.00253 · 15.9th percentile
Published
2025-06-18T15:15Z
Affected products (8)
ProductVersionsFixed in
linux/linux_kernel< 4.9.3264.9.326
linux/linux_kernel≥ 4.10, < 4.14.2914.14.291
linux/linux_kernel≥ 4.15, < 4.19.2564.19.256
linux/linux_kernel≥ 4.20, < 5.4.2115.4.211
linux/linux_kernel≥ 5.5, < 5.10.1375.10.137
linux/linux_kernel≥ 5.11, < 5.15.615.15.61
linux/linux_kernel≥ 5.16, < 5.18.185.18.18
linux/linux_kernel≥ 5.19, < 5.19.25.19.2
References (9)
EPSS history
Timeline
  • 18 JUN 11:03Z
    scsi: sg: Allow waiting for commands to complete on removed device
    cvelistv5