[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZuGl3v0y4SYR1np7@bogus>
Date: Wed, 11 Sep 2024 15:14:54 +0100
From: Sudeep Holla <sudeep.holla@....com>
To: Arnd Bergmann <arnd@...nel.org>
Cc: Arnd Bergmann <arnd@...db.de>,
Cristian Marussi <cristian.marussi@....com>,
Jens Wiklander <jens.wiklander@...aro.org>,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] firmware: arm_ffa: avoid string-fortify warningn in
export_uuid()
On Mon, Sep 09, 2024 at 11:09:24AM +0000, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@...db.de>
>
> 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);
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> Use a union for the conversion instead and make sure the byte order
> is fixed in the process.
>
Thanks for spotting and fixing the issue. I tested enabling
CONFIG_FORTIFY_SOURCE but couldn't hit this with gcc 13 and clang 20
Also do you want this sent as fix on top of my FF-A PR now or after -rc1 ?
--
Regards,
Sudeep
Powered by blists - more mailing lists