# CVE-2022-49394: blk-iolatency: Fix inflight count imbalances and IO hangs on offline

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

- **Severity:** MEDIUM 5.5
- **CVSS:** 5.5 (v3.1, NVD) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: None; Integrity impact: None; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 0.29% (percentile 14, 2026-11-26)
- **Published:** 2025-02-26T02:11:25.197Z
- **Modified:** 2026-06-17T05:17:55.520Z

## Who should check

- Anyone running Linux \>= 6d482bc5697763eb1214f207286daa201b32d20a, \< 515d077ee3085ae343b6bea7fd031f9906645f38; \>= 8c772a9bfc7c07c76f4a58b58910452fbb20843b, \< d19fa8f252000d141f9199ca32959c50314e1f05; \>= 8c772a9bfc7c07c76f4a58b58910452fbb20843b, \< 77692c02e1517c54f2fd0535f41aa4286ac9f140; \>= 8c772a9bfc7c07c76f4a58b58910452fbb20843b, \< a30acbb5dfb7bcc813ad6a18ca31011ac44e5547; \>= 8c772a9bfc7c07c76f4a58b58910452fbb20843b, \< 968f7a239c590454ffba79c126fbe0e963a0ba78; \>= 8c772a9bfc7c07c76f4a58b58910452fbb20843b, \< 5b0ff3ebbef791341695b718f8d2870869cf1d01; \>= 8c772a9bfc7c07c76f4a58b58910452fbb20843b, \< 8a177a36da6c54c98b8685d4f914cb3637d53c0d; beed6109acd4efc2f1717c31bddcd0ad7ebbf253; \>= 4.19.29, \< 4.19.247; \>= 4.20.16, \< 4.21
- Anyone running Linux 5.0

## Description

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

blk-iolatency: Fix inflight count imbalances and IO hangs on offline

iolatency needs to track the number of inflight IOs per cgroup. As this
tracking can be expensive, it is disabled when no cgroup has iolatency
configured for the device. To ensure that the inflight counters stay
balanced, iolatency\_set\_limit() freezes the request\_queue while manipulating
the enabled counter, which ensures that no IO is in flight and thus all
counters are zero.

Unfortunately, iolatency\_set\_limit() isn't the only place where the enabled
counter is manipulated. iolatency\_pd\_offline() can also dec the counter and
trigger disabling. As this disabling happens without freezing the q, this
can easily happen while some IOs are in flight and thus leak the counts.

This can be easily demonstrated by turning on iolatency on an one empty
cgroup while IOs are in flight in other cgroups and then removing the
cgroup. Note that iolatency shouldn't have been enabled elsewhere in the
system to ensure that removing the cgroup disables iolatency for the whole
device.

The following keeps flipping on and off iolatency on sda:

  echo +io \> /sys/fs/cgroup/cgroup.subtree\_control
  while true; do
      mkdir -p /sys/fs/cgroup/test
      echo '8:0 target=100000' \> /sys/fs/cgroup/test/io.latency
      sleep 1
      rmdir /sys/fs/cgroup/test
      sleep 1
  done

and there's concurrent fio generating direct rand reads:

  fio --name test --filename=/dev/sda --direct=1 --rw=randread \\
      --runtime=600 --time\_based --iodepth=256 --numjobs=4 --bs=4k

while monitoring with the following drgn script:

  while True:
    for css in css\_for\_each\_descendant\_pre(prog\['blkcg\_root'\].css.address\_of\_()):
        for pos in hlist\_for\_each(container\_of(css, 'struct blkcg', 'css').blkg\_list):
            blkg = container\_of(pos, 'struct blkcg\_gq', 'blkcg\_node')
            pd = blkg.pd\[prog\['blkcg\_policy\_iolatency'\].plid\]
            if pd.value\_() == 0:
                continue
            iolat = container\_of(pd, 'struct iolatency\_grp', 'pd')
            inflight = iolat.rq\_wait.inflight.counter.value\_()
            if inflight:
                print(f'inflight={inflight} {disk\_name(blkg.q.disk).decode("utf-8")} '
                      f'{cgroup\_path(css.cgroup).decode("utf-8")}')
    time.sleep(1)

The monitoring output looks like the following:

  inflight=1 sda /user.slice
  inflight=1 sda /user.slice
  ...
  inflight=14 sda /user.slice
  inflight=13 sda /user.slice
  inflight=17 sda /user.slice
  inflight=15 sda /user.slice
  inflight=18 sda /user.slice
  inflight=17 sda /user.slice
  inflight=20 sda /user.slice
  inflight=19 sda /user.slice \<- fio stopped, inflight stuck at 19
  inflight=19 sda /user.slice
  inflight=19 sda /user.slice

If a cgroup with stuck inflight ends up getting throttled, the throttled IOs
will never get issued as there's no completion event to wake it up leading
to an indefinite hang.

This patch fixes the bug by unifying enable handling into a work item which
is automatically kicked off from iolatency\_set\_min\_lat\_nsec() which is
called from both iolatency\_set\_limit() and iolatency\_pd\_offline() paths.
Punting to a work item is necessary as iolatency\_pd\_offline() is called
under spinlocks while freezing a request\_queue requires a sleepable context.

This also simplifies the code reducing LOC sans the comments and avoids the
unnecessary freezes which were happening whenever a cgroup's latency target
is newly set or cleared.

## Affected and fixed versions

- Linux: \>= 6d482bc5697763eb1214f207286daa201b32d20a, \< 515d077ee3085ae343b6bea7fd031f9906645f38; \>= 8c772a9bfc7c07c76f4a58b58910452fbb20843b, \< d19fa8f252000d141f9199ca32959c50314e1f05; \>= 8c772a9bfc7c07c76f4a58b58910452fbb20843b, \< 77692c02e1517c54f2fd0535f41aa4286ac9f140; \>= 8c772a9bfc7c07c76f4a58b58910452fbb20843b, \< a30acbb5dfb7bcc813ad6a18ca31011ac44e5547; \>= 8c772a9bfc7c07c76f4a58b58910452fbb20843b, \< 968f7a239c590454ffba79c126fbe0e963a0ba78; \>= 8c772a9bfc7c07c76f4a58b58910452fbb20843b, \< 5b0ff3ebbef791341695b718f8d2870869cf1d01; \>= 8c772a9bfc7c07c76f4a58b58910452fbb20843b, \< 8a177a36da6c54c98b8685d4f914cb3637d53c0d; beed6109acd4efc2f1717c31bddcd0ad7ebbf253; \>= 4.19.29, \< 4.19.247; \>= 4.20.16, \< 4.21 (cvelist)
- Linux: 5.0 (cvelist)

## Mitigation

- Upgrade Linux to 4.21 or later.

## Check your systems with an agent

Paste this into a coding agent:

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

Details: https://flawdb.com/CVE-2022-49394.md
Affected: Linux >= 6d482bc5697763eb1214f207286daa201b32d20a, < 515d077ee3085ae343b6bea7fd031f9906645f38; >= 8c772a9bfc7c07c76f4a58b58910452fbb20843b, < d19fa8f252000d141f9199ca32959c50314e1f05; >= 8c772a9bfc7c07c76f4a58b58910452fbb20843b, < 77692c02e1517c54f2fd0535f41aa4286ac9f140; >= 8c772a9bfc7c07c76f4a58b…
Fixed in: Linux 515d077ee3085ae343b6bea7fd031f9906645f38, Linux 77692c02e1517c54f2fd0535f41aa4286ac9f140, Linux 968f7a239c590454ffba79c126fbe0e963a0ba78, Linux 5b0ff3ebbef791341695b718f8d2870869cf1d01, Linux 8a177a36da6c54c98b8685d4f914cb3637d53c0d, Linux 4.19.247, Linux 4.21

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-2022-49394 being exploited?

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

### How serious is CVE-2022-49394?

Medium: CVSS 5.5 (v3.1, scored by NVD). Not remotely exploitable (local or adjacent access needed).

### Which versions are affected by CVE-2022-49394?

Linux \>= 6d482bc5697763eb1214f207286daa201b32d20a, \< 515d077ee3085ae343b6bea7fd031f9906645f38; \>= 8c772a9bfc7c07c76f4a58b58910452fbb20843b, \< d19fa8f252000d141f9199ca32959c50314e1f05; \>= 8c772a9bfc7c07c76f4a58b58910452fbb20843b, \< 77692c02e1517c54f2fd0535f41aa4286ac9f140; \>= 8c772a9bfc7c07c76f4a58b58910452fbb20843b, \< a30acbb5dfb7bcc813ad6a18ca31011ac44e5547; \>= 8c772a9bfc7c07c76f4a58b58910452fbb20843b, \< 968f7a239c590454ffba79c126fbe0e963a0ba78; \>= 8c772a9bfc7c07c76f4a58b58910452fbb20843b, \< 5b0ff3ebbef791341695b718f8d2870869cf1d01; \>= 8c772a9bfc7c07c76f4a58b58910452fbb20843b, \< 8a177a36da6c54c98b8685d4f914cb3637d53c0d; beed6109acd4efc2f1717c31bddcd0ad7ebbf253; \>= 4.19.29, \< 4.19.247; \>= 4.20.16, \< 4.21; Linux 5.0.

### Is there a fix for CVE-2022-49394?

Yes. Fixed in Linux 515d077ee3085ae343b6bea7fd031f9906645f38, Linux 77692c02e1517c54f2fd0535f41aa4286ac9f140, Linux 968f7a239c590454ffba79c126fbe0e963a0ba78, Linux 5b0ff3ebbef791341695b718f8d2870869cf1d01, Linux 8a177a36da6c54c98b8685d4f914cb3637d53c0d, Linux 4.19.247, Linux 4.21. Upgrade Linux to 4.21 or later.

### How do I check if I'm affected by CVE-2022-49394?

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/515d077ee3085ae343b6bea7fd031f9906645f38>
- patch: <https://git.kernel.org/stable/c/d19fa8f252000d141f9199ca32959c50314e1f05>
- patch: <https://git.kernel.org/stable/c/77692c02e1517c54f2fd0535f41aa4286ac9f140>
- patch: <https://git.kernel.org/stable/c/a30acbb5dfb7bcc813ad6a18ca31011ac44e5547>
- patch: <https://git.kernel.org/stable/c/968f7a239c590454ffba79c126fbe0e963a0ba78>
- patch: <https://git.kernel.org/stable/c/5b0ff3ebbef791341695b718f8d2870869cf1d01>
- patch: <https://git.kernel.org/stable/c/8a177a36da6c54c98b8685d4f914cb3637d53c0d>

## 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-2022-49394>

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