All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sudeep Holla <sudeep.holla@arm.com>
To: "Arnd Bergmann" <arnd@arndb.de>
Cc: "Arnd Bergmann" <arnd@kernel.org>,
	"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 16:37:56 +0100	[thread overview]
Message-ID: <ZuG5VKBcbHN2kiut@bogus> (raw)
In-Reply-To: <0ae7475f-f53a-45e3-a484-667820042724@app.fastmail.com>

On Wed, Sep 11, 2024 at 02:44:25PM +0000, Arnd Bergmann wrote:
> On Wed, Sep 11, 2024, at 14:14, Sudeep Holla wrote:
> > 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
> 
> Unfortunately I also don't have a reproducer at the moment,
> but I know it was from a randconfig build with gcc-14.2. I tried
> another few hundred randconfigs now with my patch reverted but it
> didn't come back. I assume it only shows up in rare combinations
> of some options,
>

Oh OK.

> Do you have any additional information on the endianess question?
> Is this arm_ffa firmware code supposed to work with big-endian
> kernels?
>

I am trying to check if that is a requirement. Also the specification
doesn't have any specific mention about it. Since it executes on the same
AP cores as Linux in different EL, I assume the entire stack must be
running same endian-ness. I will check internally. Unlike SCMI, I haven't
tested FF-A with big-endian kernel so far.

> > Also do you want this sent as fix on top of my FF-A PR now or after -rc1 ?
> 
> Earlier would be better I think. I usually have one set of
> bugfixes before rc1 even if it doesn't make it into the
> first set of branches.
>

I will try to send earlier unless this endian-ness triggers more questions.
I will update here anyways.

-- 
Regards,
Sudeep


  reply	other threads:[~2024-09-11 15:55 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
2024-09-11 14:44   ` Arnd Bergmann
2024-09-11 15:37     ` Sudeep Holla [this message]
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=ZuG5VKBcbHN2kiut@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.