From: Sudeep Holla <sudeep.holla@arm.com>
To: Arnd Bergmann <arnd@kernel.org>
Cc: Arnd Bergmann <arnd@arndb.de>,
Cristian Marussi <cristian.marussi@arm.com>,
Jens Wiklander <jens.wiklander@linaro.org>,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] firmware: arm_ffa: avoid string-fortify warningn in export_uuid()
Date: Wed, 11 Sep 2024 15:14:54 +0100 [thread overview]
Message-ID: <ZuGl3v0y4SYR1np7@bogus> (raw)
In-Reply-To: <20240909110938.247976-1-arnd@kernel.org>
On Mon, Sep 09, 2024 at 11:09:24AM +0000, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.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
next prev parent reply other threads:[~2024-09-11 14:27 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-09 11:09 [PATCH] firmware: arm_ffa: avoid string-fortify warningn in export_uuid() Arnd Bergmann
2024-09-11 14:14 ` Sudeep Holla [this message]
2024-09-11 14:44 ` Arnd Bergmann
2024-09-11 15:37 ` Sudeep Holla
2024-10-15 15:27 ` Sudeep Holla
-- strict thread matches above, loose matches on Subject: below --
2024-09-09 11:09 Arnd Bergmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZuGl3v0y4SYR1np7@bogus \
--to=sudeep.holla@arm.com \
--cc=arnd@arndb.de \
--cc=arnd@kernel.org \
--cc=cristian.marussi@arm.com \
--cc=jens.wiklander@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.