CVE-2026-80710: s390/dasd: Fix undersized format-check buffer
In the Linux kernel, the following vulnerability has been resolved:
s390/dasd: Fix undersized format-check buffer
fmtbuffersize in dasdeckdcheckdeviceformat() is declared as int, even though one of the multiplicands, sizeof(struct eckdcount), is a sizet. The expression
trkcount rptmax sizeof(struct eckdcount)
is therefore correctly evaluated at 64-bit width, but the result is silently truncated when it is stored back into the 32-bit fmtbuffersize variable. For a sufficiently large track range (startunit/stopunit 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 checkmuloverflow() and keep it in a sizet, so that a value that no longer fits results in -EINVAL instead of a silently truncated allocation size.
Affected Software
Event History
Frequently Asked Questions
What conditions are needed to trigger the memory overwrite?
A caller must supply a sufficiently large track range through start_unit and stop_unit. The resulting track-count calculation must exceed the capacity of the 32-bit fmt_buffer_size variable, causing truncation before allocation.
Does exploitation depend on kzalloc() failing?
No. kzalloc() can successfully allocate the truncated, undersized buffer. The subsequent channel-program construction uses the original untruncated track count and can write beyond that allocation.
How does the fix handle oversized format-check requests?
The fix stores the buffer size in a size_t and uses check_mul_overflow() for the size calculation. Requests whose calculated size cannot be represented are rejected with -EINVAL rather than proceeding with a truncated allocation.