# CVE-2021-47584: iocost: Fix divide-by-zero on donation from low hweight cgroup

> 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.30% (percentile 16, 2026-11-26)
- **CWE:** CWE-369
- **Published:** 2024-06-19T14:53:50.119Z
- **Modified:** 2026-06-17T04:17:48.873Z

## Who should check

- Anyone running Linux \>= f1de2439ec43b74764f2a26e3a310b24407e3bde, \< a7c80674538f15f85d68138240aae440b8039519; \>= f1de2439ec43b74764f2a26e3a310b24407e3bde, \< 3a1a4eb574178c21241a6200f4785572e661c472; \>= f1de2439ec43b74764f2a26e3a310b24407e3bde, \< edaa26334c117a584add6053f48d63a988d25a6e
- Anyone running Linux 5.10

## Description

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

iocost: Fix divide-by-zero on donation from low hweight cgroup

The donation calculation logic assumes that the donor has non-zero
after-donation hweight, so the lowest active hweight a donating cgroup can
have is 2 so that it can donate 1 while keeping the other 1 for itself.
Earlier, we only donated from cgroups with sizable surpluses so this
condition was always true. However, with the precise donation algorithm
implemented, f1de2439ec43 ("blk-iocost: revamp donation amount
determination") made the donation amount calculation exact enabling even low
hweight cgroups to donate.

This means that in rare occasions, a cgroup with active hweight of 1 can
enter donation calculation triggering the following warning and then a
divide-by-zero oops.

 WARNING: CPU: 4 PID: 0 at block/blk-iocost.c:1928 transfer\_surpluses.cold+0x0/0x53 \[884/94867\]
 ...
 RIP: 0010:transfer\_surpluses.cold+0x0/0x53
 Code: 92 ff 48 c7 c7 28 d1 ab b5 65 48 8b 34 25 00 ae 01 00 48 81 c6 90 06 00 00 e8 8b 3f fe ff 48 c7 c0 ea ff ff ff e9 95 ff 92 ff \<0f\> 0b 48 c7 c7 30 da ab b5 e8 71 3f fe ff 4c 89 e8 4d 85 ed 74 0
4
 ...
 Call Trace:
  \<IRQ\>
  ioc\_timer\_fn+0x1043/0x1390
  call\_timer\_fn+0xa1/0x2c0
  \_\_run\_timers.part.0+0x1ec/0x2e0
  run\_timer\_softirq+0x35/0x70
 ...
 iocg: invalid donation weights in /a/b: active=1 donating=1 after=0

Fix it by excluding cgroups w/ active hweight \< 2 from donating. Excluding
these extreme low hweight donations shouldn't affect work conservation in
any meaningful way.

## Affected and fixed versions

- Linux: \>= f1de2439ec43b74764f2a26e3a310b24407e3bde, \< a7c80674538f15f85d68138240aae440b8039519; \>= f1de2439ec43b74764f2a26e3a310b24407e3bde, \< 3a1a4eb574178c21241a6200f4785572e661c472; \>= f1de2439ec43b74764f2a26e3a310b24407e3bde, \< edaa26334c117a584add6053f48d63a988d25a6e (cvelist)
- Linux: 5.10 (cvelist)

## Mitigation

- No fix listed yet: follow the vendor advisory.

## Check your systems with an agent

Paste this into a coding agent:

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

Details: https://flawdb.com/CVE-2021-47584.md
Affected: Linux >= f1de2439ec43b74764f2a26e3a310b24407e3bde, < a7c80674538f15f85d68138240aae440b8039519; >= f1de2439ec43b74764f2a26e3a310b24407e3bde, < 3a1a4eb574178c21241a6200f4785572e661c472; >= f1de2439ec43b74764f2a26e3a310b24407e3bde, < edaa26334c117a584add6053f48d63a988d25a6e; Linux 5.10
Fixed in: Linux 3a1a4eb574178c21241a6200f4785572e661c472

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-47584 being exploited?

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

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

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

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

Linux \>= f1de2439ec43b74764f2a26e3a310b24407e3bde, \< a7c80674538f15f85d68138240aae440b8039519; \>= f1de2439ec43b74764f2a26e3a310b24407e3bde, \< 3a1a4eb574178c21241a6200f4785572e661c472; \>= f1de2439ec43b74764f2a26e3a310b24407e3bde, \< edaa26334c117a584add6053f48d63a988d25a6e; Linux 5.10.

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

Yes. Fixed in Linux 3a1a4eb574178c21241a6200f4785572e661c472. No fix listed yet: follow the vendor advisory.

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

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/a7c80674538f15f85d68138240aae440b8039519>
- patch: <https://git.kernel.org/stable/c/3a1a4eb574178c21241a6200f4785572e661c472>
- patch: <https://git.kernel.org/stable/c/edaa26334c117a584add6053f48d63a988d25a6e>

## 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-47584>

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