# CVE-2021-47192: scsi: core: sysfs: Fix hang when device state is set via sysfs

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** MEDIUM 5.3
- **CVSS:** 5.3 (v3.1, CNA) `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N`
- **CVSS metrics:** Attack vector: Network; Attack complexity: Low; Privileges required: None; User interaction: None; Scope: Unchanged; Confidentiality impact: Low; Integrity impact: None; Availability impact: None
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Remote, no login needed
- **EPSS:** 0.70% (percentile 48, 2026-11-26)
- **CWE:** CWE-667
- **Published:** 2024-04-10T18:56:30.097Z
- **Modified:** 2026-06-17T04:16:52.630Z

## Who should check

- Anyone running Linux \>= 69aa1a1a569f5c6d554b59352130ef363342ed4c, \< edd783162bf2385b43de6764f2d4c6e9f4f6be27; \>= 711459514e297d748f15ba1f5292a3276c3d1dd0, \< a792e0128d232251edb5fdf42fb0f9fbb0b44a73; \>= f0f82e2476f6adb9c7a0135cfab8091456990c99, \< bcc0e3175a976b7fa9a353960808adb0bb49ead8; \>= f0f82e2476f6adb9c7a0135cfab8091456990c99, \< 4edd8cd4e86dd3047e5294bbefcc0a08f66a430f; c6751ce1a2a415a78e4f5b621628da03196b804c; \>= 5.4.143, \< 5.4.162; \>= 5.10.61, \< 5.10.82; \>= 5.13.13, \< 5.14
- Anyone running Linux 5.14

## Description

In the Linux kernel, the following vulnerability has been resolved:

scsi: core: sysfs: Fix hang when device state is set via sysfs

This fixes a regression added with:

commit f0f82e2476f6 ("scsi: core: Fix capacity set to zero after
offlinining device")

The problem is that after iSCSI recovery, iscsid will call into the kernel
to set the dev's state to running, and with that patch we now call
scsi\_rescan\_device() with the state\_mutex held. If the SCSI error handler
thread is just starting to test the device in scsi\_send\_eh\_cmnd() then it's
going to try to grab the state\_mutex.

We are then stuck, because when scsi\_rescan\_device() tries to send its I/O
scsi\_queue\_rq() calls -\> scsi\_host\_queue\_ready() -\> scsi\_host\_in\_recovery()
which will return true (the host state is still in recovery) and I/O will
just be requeued. scsi\_send\_eh\_cmnd() will then never be able to grab the
state\_mutex to finish error handling.

To prevent the deadlock move the rescan-related code to after we drop the
state\_mutex.

This also adds a check for if we are already in the running state. This
prevents extra scans and helps the iscsid case where if the transport class
has already onlined the device during its recovery process then we don't
need userspace to do it again plus possibly block that daemon.

## Affected and fixed versions

- Linux: \>= 69aa1a1a569f5c6d554b59352130ef363342ed4c, \< edd783162bf2385b43de6764f2d4c6e9f4f6be27; \>= 711459514e297d748f15ba1f5292a3276c3d1dd0, \< a792e0128d232251edb5fdf42fb0f9fbb0b44a73; \>= f0f82e2476f6adb9c7a0135cfab8091456990c99, \< bcc0e3175a976b7fa9a353960808adb0bb49ead8; \>= f0f82e2476f6adb9c7a0135cfab8091456990c99, \< 4edd8cd4e86dd3047e5294bbefcc0a08f66a430f; c6751ce1a2a415a78e4f5b621628da03196b804c; \>= 5.4.143, \< 5.4.162; \>= 5.10.61, \< 5.10.82; \>= 5.13.13, \< 5.14 (cvelist)
- Linux: 5.14 (cvelist)

## Mitigation

- Upgrade Linux to 5.14 or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2021-47192. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2021-47192.md
Affected: Linux >= 69aa1a1a569f5c6d554b59352130ef363342ed4c, < edd783162bf2385b43de6764f2d4c6e9f4f6be27; >= 711459514e297d748f15ba1f5292a3276c3d1dd0, < a792e0128d232251edb5fdf42fb0f9fbb0b44a73; >= f0f82e2476f6adb9c7a0135cfab8091456990c99, < bcc0e3175a976b7fa9a353960808adb0bb49ead8; >= f0f82e2476f6adb9c7a0135…
Fixed in: Linux 4edd8cd4e86dd3047e5294bbefcc0a08f66a430f, Linux 5.4.162, Linux 5.10.82, Linux 5.14

Steps:
1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2021-47192 being exploited?

There is no confirmed exploitation: CVE-2021-47192 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.70% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2021-47192?

Medium: CVSS 5.3 (v3.1, scored by CNA). Remote, no login needed.

### Which versions are affected by CVE-2021-47192?

Linux \>= 69aa1a1a569f5c6d554b59352130ef363342ed4c, \< edd783162bf2385b43de6764f2d4c6e9f4f6be27; \>= 711459514e297d748f15ba1f5292a3276c3d1dd0, \< a792e0128d232251edb5fdf42fb0f9fbb0b44a73; \>= f0f82e2476f6adb9c7a0135cfab8091456990c99, \< bcc0e3175a976b7fa9a353960808adb0bb49ead8; \>= f0f82e2476f6adb9c7a0135cfab8091456990c99, \< 4edd8cd4e86dd3047e5294bbefcc0a08f66a430f; c6751ce1a2a415a78e4f5b621628da03196b804c; \>= 5.4.143, \< 5.4.162; \>= 5.10.61, \< 5.10.82; \>= 5.13.13, \< 5.14; Linux 5.14.

### Is there a fix for CVE-2021-47192?

Yes. Fixed in Linux 4edd8cd4e86dd3047e5294bbefcc0a08f66a430f, Linux 5.4.162, Linux 5.10.82, Linux 5.14. Upgrade Linux to 5.14 or later.

### How do I check if I'm affected by CVE-2021-47192?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- patch: <https://git.kernel.org/stable/c/edd783162bf2385b43de6764f2d4c6e9f4f6be27>
- patch: <https://git.kernel.org/stable/c/a792e0128d232251edb5fdf42fb0f9fbb0b44a73>
- patch: <https://git.kernel.org/stable/c/bcc0e3175a976b7fa9a353960808adb0bb49ead8>
- patch: <https://git.kernel.org/stable/c/4edd8cd4e86dd3047e5294bbefcc0a08f66a430f>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2021-47192>

HTML: <https://flawdb.com/CVE-2021-47192> · JSON: <https://flawdb.com/api/v1/entries/CVE-2021-47192>
