CVE-2021-47584
Severity CVSS v4.0:
Pending analysis
Type:
CWE-369
Divide By Zero
Publication date:
19/06/2024
Last modified:
19/08/2024
Description
In the Linux kernel, the following vulnerability has been resolved:<br />
<br />
iocost: Fix divide-by-zero on donation from low hweight cgroup<br />
<br />
The donation calculation logic assumes that the donor has non-zero<br />
after-donation hweight, so the lowest active hweight a donating cgroup can<br />
have is 2 so that it can donate 1 while keeping the other 1 for itself.<br />
Earlier, we only donated from cgroups with sizable surpluses so this<br />
condition was always true. However, with the precise donation algorithm<br />
implemented, f1de2439ec43 ("blk-iocost: revamp donation amount<br />
determination") made the donation amount calculation exact enabling even low<br />
hweight cgroups to donate.<br />
<br />
This means that in rare occasions, a cgroup with active hweight of 1 can<br />
enter donation calculation triggering the following warning and then a<br />
divide-by-zero oops.<br />
<br />
WARNING: CPU: 4 PID: 0 at block/blk-iocost.c:1928 transfer_surpluses.cold+0x0/0x53 [884/94867]<br />
...<br />
RIP: 0010:transfer_surpluses.cold+0x0/0x53<br />
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 0b 48 c7 c7 30 da ab b5 e8 71 3f fe ff 4c 89 e8 4d 85 ed 74 0<br />
4<br />
...<br />
Call Trace:<br />
<br />
ioc_timer_fn+0x1043/0x1390<br />
call_timer_fn+0xa1/0x2c0<br />
__run_timers.part.0+0x1ec/0x2e0<br />
run_timer_softirq+0x35/0x70<br />
...<br />
iocg: invalid donation weights in /a/b: active=1 donating=1 after=0<br />
<br />
Fix it by excluding cgroups w/ active hweight
Impact
Base Score 3.x
5.50
Severity 3.x
MEDIUM
Vulnerable products and versions
| CPE | From | Up to |
|---|---|---|
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 5.10 (including) | 5.10.88 (excluding) |
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 5.11 (including) | 5.15.11 (excluding) |
To consult the complete list of CPE names with products and versions, see this page



