Re: [PATCH] firmware: arm_ffa: avoid string-fortify warningn in export_uuid()

From: Sudeep Holla
Date: Tue Oct 15 2024 - 11:27:25 EST


On Mon, 09 Sep 2024 11:09:24 +0000, Arnd Bergmann wrote:
> Copying to a 16 byte structure into an 8-byte struct member
> causes a compile-time warning:
>
> In file included from drivers/firmware/arm_ffa/driver.c:25:
> In function 'fortify_memcpy_chk',
> inlined from 'export_uuid' at include/linux/uuid.h:88:2,
> inlined from 'ffa_msg_send_direct_req2' at drivers/firmware/arm_ffa/driver.c:488:2:
> include/linux/fortify-string.h:571:25: 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]
> 571 | __write_overflow_field(p_size_field, size);
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> [...]

Sorry for the delay, was trying to see if I can test BE kernel and see if
it needs more fixing. The spec does require all memory region to be LE.
I will do that later, for now I am pulling this as fix for v6.12

Applied to sudeep.holla/linux (for-next/ffa/fixes), thanks!

[1/1] firmware: arm_ffa: avoid string-fortify warningn in export_uuid()
https://git.kernel.org/sudeep.holla/c/629253b2f6d7
--
Regards,
Sudeep