On 2023-08-10, Kees Cook keescook@chromium.org wrote:
If an output buffer size exceeded U16_MAX, the min_t(u16, ...) cast in copy_data() was causing writes to truncate. This manifested as output bytes being skipped, seen as %NUL bytes in pstore dumps when the available record size was larger than 65536. Fix the cast to no longer truncate the calculation.
Thanks for tracking this down.
Reviewed-by: John Ogness john.ogness@linutronix.de