CyberRota Analysis
AI-GeneratedThe vulnerability affects the Linux kernel's handling of device format checks in the s390/dasd subsystem, where an integer buffer size variable is incorrectly used to store a value that can exceed its maximum capacity. This oversight can lead to buffer underallocation, allowing for potential out-of-bounds writes and subsequent memory corruption. Organizations using Linux on s390 architecture should prioritize this issue to mitigate risks associated with data integrity and system stability.
Original NVD Description
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.