Re: include/linux/fortify-string.h:267:25: warning: call to '__write_overflow_field' declared with attribute warning: detected write beyond size of field (1st parameter); maybe use struct_group()?
From: Kees Cook
Date: Tue Apr 19 2022 - 00:19:15 EST
On Thu, Apr 14, 2022 at 11:54:03PM +0800, kernel test robot wrote:
> In function 'fortify_memcpy_chk',
> inlined from 'firm_send_command' at drivers/usb/serial/whiteheat.c:587:4:
> >> include/linux/fortify-string.h:267:25: warning: call to '__write_overflow_field' declared with attribute warning: detected write beyond size of field (1st parameter); maybe use struct_group()? [-Wattribute-warning]
> 267 | __write_overflow_field(p_size_field, size);
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Thanks! Proposed patch:
https://lore.kernel.org/linux-hardening/20220419041742.4117026-1-keescook@xxxxxxxxxxxx/
--
Kees Cook