In the MPI passthrough IOCTL handler, the userland buffer entry list was
parsed without verifying whether the user-supplied buffer size was large
enough to hold the claimed number of entries. A malformed or malicious
request specifying a large entry count with a small buffer size could cause
the driver to read past user-allocated memory during copy operations.
In addition, the scatter-gather descriptor counter was defined as an 8-bit
integer, risking truncation when processing large data transfers requiring
more than 255 descriptors.
Validate that the user-provided buffer size accommodates the header and all
requested buffer entries before parsing, widen descriptor counting to 16
bits, and use exact structure member offsets when computing target device
information lengths.