CVE-2022-50215

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

7.8 high EPSS 0.26%

Published 18 Jun 2025 Updated 15 Oct 2026 CNA: Linux

Check your servers for CVE-2022-50215

The Vulnpocalypse collector sends the package list of each Linux server and of its container images once a day. Vulnpocalypse shows every server where CVE-2022-50215 affects the running kernel, with the command that installs the fix. The free plan covers one server and one domain and does not need a credit card.

Check my servers

Description

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.

Severity (CVSS)

7.8 high CVSS 3.1 from Linux (CNA)
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
Attack vector
local: the attacker needs local access, or a user has to open a prepared file
Attack complexity
low: an attack works without special conditions
Privileges required
low: the attacker needs an ordinary user account
User interaction
none: nobody has to click or open anything
Scope
unchanged: the damage stays inside the vulnerable component
Impact
confidentiality high, integrity high, availability high: what an attacker can read (confidentiality), change (integrity) or stop (availability)

Exploitation

EPSS 0.26%: the probability of exploitation activity in the next 30 days, from the EPSS model of FIRST. The score is higher than 19.5% of all scored CVEs. Scores of 1 Dec 2026.

The assessment of CISA (SSVC, 15 Oct 2026):

Exploitation
none: CISA did not find evidence of exploitation or a public proof of concept
Automatable
no: each attack takes manual steps
Technical impact
total: full control of the component or of its data

Affected products

As the CNA lists them.

ProductVersions
Linux
affected from c6517b7942fad663cc1cf3235cbe4207cf769332, before bbc118acf7baf9e93c5e1314d14f481301af4d0f
affected from c6517b7942fad663cc1cf3235cbe4207cf769332, before f5e61d9b4a699dd16f32d5f39eb1cf98d84c92ed
affected from c6517b7942fad663cc1cf3235cbe4207cf769332, before ed9afd967cbfe7da2dc0d5e52c62a778dfe9f16b
affected from c6517b7942fad663cc1cf3235cbe4207cf769332, before f135c65085eed869d10e4e7923ce1015288618da
affected from c6517b7942fad663cc1cf3235cbe4207cf769332, before 408bfa1489a3cfe7150b81ab0b0df99b23dd5411
affected from c6517b7942fad663cc1cf3235cbe4207cf769332, before 8c004b7dbb340c1e5889f5fb9e5baa6f6e5303e8
affected from c6517b7942fad663cc1cf3235cbe4207cf769332, before 35e60ec39e862159cb92923eefd5230d4a873cb9
affected from c6517b7942fad663cc1cf3235cbe4207cf769332, before 03d8241112d5e3cccce1a01274a221099f07d2e1
affected from c6517b7942fad663cc1cf3235cbe4207cf769332, before 3455607fd7be10b449f5135c00dc306b85dc0d21
affected a0fe972f78eaaf352d593f9ed9079de590ceb286
affected b21c6d2897cd455fa396f4041a0c8165784e949f
affected from 2.6.28.10, before 2.6.29
affected from 2.6.29.2, before 2.6.30
Other versions: unaffected
Linux
affected 2.6.30
unaffected before 2.6.30
unaffected from 4.9.326 up to and including 4.9.*
unaffected from 4.14.291 up to and including 4.14.*
unaffected from 4.19.256 up to and including 4.19.*
unaffected from 5.4.211 up to and including 5.4.*
unaffected from 5.10.137 up to and including 5.10.*
unaffected from 5.15.61 up to and including 5.15.*
unaffected from 5.18.18 up to and including 5.18.*
unaffected from 5.19.2 up to and including 5.19.*
unaffected 6.0 and later
Other versions: affected

Is my server affected?

This CVE is in the Linux kernel. Compare the running kernel with the fixed kernel version of your distribution, and reboot after a kernel update:

uname -r
# Debian, Ubuntu: does the changelog of the running kernel name the CVE?
zgrep -l CVE-2022-50215 /usr/share/doc/linux-image-$(uname -r)/changelog.Debian.gz
# RHEL, Rocky, Alma
rpm -q --changelog kernel | grep CVE-2022-50215

With Trivy, on the host and for a container image. When a package is affected, it prints the installed and the fixed version:

trivy rootfs --scanners vuln / | grep CVE-2022-50215
trivy image --scanners vuln IMAGE | grep CVE-2022-50215

Vulnpocalypse makes this comparison every day for the package lists of your servers and container images, including language packages (npm, PyPI, Go, Maven and others), and sends the command that installs the fix. Start free with one server and one domain or read how to install the collector.

References

Other references

Source: the record CVE-2022-50215 of the CVE List (CVE Program), CVE Terms of Use; the CISA KEV catalog and the CISA ADP container; EPSS of FIRST. The text of the record is shown as published. Data sources and licences.