Linux
s390/dasd: Fix undersized format-check buffer
In the Linux kernel, the following vulnerability has been resolved: s390/dasd: Fix undersized format-check buffer fmt_buffer_size in dasd_eckd_check_device_format() is declared as int, even though one of the multiplicands, sizeof(struct eckd_count), is a size_t. The expression trkcount * rpt_max * sizeof(struct eckd_count) is therefore correctly evaluated at 64-bit width, but the result is silently truncated when it is stored back into the 32-bit fmt_buffer_size variable. For a sufficiently large track range (start_unit/stop_unit are caller-controlled) this truncation yields a buffer size far smaller than the number of tracks actually requested. kzalloc() then succeeds with an undersized allocation, while the subsequent channel program build still operates on the untruncated track count and writes past the end of that buffer. Compute the buffer size with check_mul_overflow() and keep it in a size_t, so that a value that no longer fits results in -EINVAL instead of a silently truncated allocation size.
Affected versions and mitigation
From the CVE record and the vendor's references.Affected
- >= 8fd575200db5b53f6ea6818dd017f1b43190db12, < 3d6be353ba0515247f527c6522348ac730b86ff0
- >= 8fd575200db5b53f6ea6818dd017f1b43190db12, < aca18289c86f22d3fc2f3f6ff615286e7b1702f6
- >= 8fd575200db5b53f6ea6818dd017f1b43190db12, < 9f88dda2f22927d22498801a92cab6a9424eaf86
- >= 8fd575200db5b53f6ea6818dd017f1b43190db12, < e16e0fc54120cee3c6f0362de95aab6792865857
- >= 8fd575200db5b53f6ea6818dd017f1b43190db12, < 87f3389cd3920714c53e704778f7ca7f1cf0c39c
- >= 8fd575200db5b53f6ea6818dd017f1b43190db12, < 7f40b346462f563a0d6e841a77b5163d2a882a04
Fixed in 3d6be353ba0515247f527c6522348ac730b86ff0, aca18289c86f22d3fc2f3f6ff615286e7b1702f6, 9f88dda2f22927d22498801a92cab6a9424eaf86, e16e0fc54120cee3c6f0362de95aab6792865857, 87f3389cd3920714c53e704778f7ca7f1cf0c39c, 7f40b346462f563a0d6e841a77b5163d2a882a04
- 4.7
Fixed in 0, 6.1.191, 6.6.151, 6.12.103, 6.18.44, 7.1.8, 7.2
Mitigation
Upgrade Linux to 3d6be353ba0515247f527c6522348ac730b86ff0 or aca18289c86f22d3fc2f3f6ff615286e7b1702f6 or 9f88dda2f22927d22498801a92cab6a9424eaf86 or e16e0fc54120cee3c6f0362de95aab6792865857 or 87f3389cd3920714c53e704778f7ca7f1cf0c39c or 7f40b346462f563a0d6e841a77b5163d2a882a04 or later.
Upgrade Linux to 0 or 6.1.191 or 6.6.151 or 6.12.103 or 6.18.44 or 7.1.8 or 7.2 or later.
Timeline
Days relative to CVE publicationNo public PoC found yet; not in CISA KEV.
PoC repositories
Found on GitHub.No PoC repositories found yet.