Re: [PATCH] HID: hyperv: avoid struct memcpy overrun warning

From: Benjamin Tissoires
Date: Mon Jul 10 2023 - 04:33:35 EST


On Wed, 05 Jul 2023 16:02:24 +0200, Arnd Bergmann wrote:
> A previous patch addressed the fortified memcpy warning for most
> builds, but I still see this one with gcc-9:
>
> In file included from include/linux/string.h:254,
> from drivers/hid/hid-hyperv.c:8:
> In function 'fortify_memcpy_chk',
> inlined from 'mousevsc_on_receive' at drivers/hid/hid-hyperv.c:272:3:
> include/linux/fortify-string.h:583:4: error: call to '__write_overflow_field' declared with attribute warning: detected write beyond size of field (1st parameter); maybe use struct_group()? [-Werror=attribute-warning]
> 583 | __write_overflow_field(p_size_field, size);
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> [...]

Applied to https://git.kernel.org/pub/scm/linux/kernel/git/hid/hid.git (for-6.5/upstream-fixes), thanks!

[1/1] HID: hyperv: avoid struct memcpy overrun warning
https://git.kernel.org/hid/hid/c/5f151364b1da

Cheers,
--
Benjamin Tissoires <bentiss@xxxxxxxxxx>