From: Jack Rosenthal <jrosenth@chromium.org>
To: Kees Cook <keescook@chromium.org>
Cc: Paul Menzel <pmenzel@molgen.mpg.de>,
Guenter Roeck <groeck@chromium.org>,
Julius Werner <jwerner@chromium.org>,
Brian Norris <briannorris@chromium.org>,
Stephen Boyd <swboyd@chromium.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org
Subject: Re: [PATCH v3] firmware: coreboot: Check size of table entry and split memcpy
Date: Thu, 12 Jan 2023 23:31:47 -0700 [thread overview]
Message-ID: <Y8D608sr+jhBQCXG@chromium.org> (raw)
In-Reply-To: <20230112230312.give.446-kees@kernel.org>
On 2023-01-12 at 15:03 -0800, Kees Cook wrote:
> The memcpy() of the data following a coreboot_table_entry couldn't
> be evaluated by the compiler under CONFIG_FORTIFY_SOURCE. To make it
> easier to reason about, add an explicit flexible array member to struct
> coreboot_device so the entire entry can be copied at once. Additionally,
> validate the sizes before copying. Avoids this run-time false positive
> warning:
>
> memcpy: detected field-spanning write (size 168) of single field "&device->entry" at drivers/firmware/google/coreboot_table.c:103 (size 8)
>
> Reported-by: Paul Menzel <pmenzel@molgen.mpg.de>
> Link: https://lore.kernel.org/all/03ae2704-8c30-f9f0-215b-7cdf4ad35a9a@molgen.mpg.de/
> Cc: Jack Rosenthal <jrosenth@chromium.org>
> Cc: Guenter Roeck <groeck@chromium.org>
> Cc: Julius Werner <jwerner@chromium.org>
> Cc: Brian Norris <briannorris@chromium.org>
> Cc: Stephen Boyd <swboyd@chromium.org>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Signed-off-by: Kees Cook <keescook@chromium.org>
> Reviewed-by: Julius Werner <jwerner@chromium.org>
> Reviewed-by: Guenter Roeck <groeck@chromium.org>
> Link: https://lore.kernel.org/r/20230107031406.gonna.761-kees@kernel.org
> ---
Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
prev parent reply other threads:[~2023-01-13 6:48 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-12 23:03 [PATCH v3] firmware: coreboot: Check size of table entry and split memcpy Kees Cook
2023-01-12 23:25 ` Stephen Boyd
2023-01-13 6:31 ` Jack Rosenthal [this message]
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=Y8D608sr+jhBQCXG@chromium.org \
--to=jrosenth@chromium.org \
--cc=briannorris@chromium.org \
--cc=gregkh@linuxfoundation.org \
--cc=groeck@chromium.org \
--cc=jwerner@chromium.org \
--cc=keescook@chromium.org \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pmenzel@molgen.mpg.de \
--cc=swboyd@chromium.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox