[PATCH v1 1/1] smb: client: Rework memcpy() to avoid compilation error

Andy Shevchenko andriy.shevchenko at linux.intel.com
Mon Jul 17 10:02:33 UTC 2023


On Mon, Jul 17, 2023 at 01:00:03PM +0300, Andy Shevchenko wrote:
> In function ‘fortify_memcpy_chk’,
>     inlined from ‘CIFS_open’ at fs/smb/client/cifssmb.c:1249:3:
> include/linux/fortify-string.h:592:25: error: call to ‘__read_overflow2_field’ declared with attribute warning: detected read beyond size of field (2nd parameter); maybe use struct_group()? [-Werror=attribute-warning]
>   592 |                         __read_overflow2_field(q_size_field, size);
>       |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> cc1: all warnings being treated as errors
> 
> Instead of memcpy() use member-by-member copy. Let compiler do its job
> on optimisation.

It seems there are more similar errors, feel free to apply this one, and/or
address the rest and consider this as a build bug report (for `make W=1`).

-- 
With Best Regards,
Andy Shevchenko





More information about the samba-technical mailing list