[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAE-0n52aQpFe4q47=3=dmozwgb375zuCt2um8PTpYScLkgBs8w@mail.gmail.com>
Date: Thu, 12 Jan 2023 15:25:38 -0800
From: Stephen Boyd <swboyd@...omium.org>
To: Jack Rosenthal <jrosenth@...omium.org>,
Kees Cook <keescook@...omium.org>
Cc: Paul Menzel <pmenzel@...gen.mpg.de>,
Guenter Roeck <groeck@...omium.org>,
Julius Werner <jwerner@...omium.org>,
Brian Norris <briannorris@...omium.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
linux-kernel@...r.kernel.org, linux-hardening@...r.kernel.org
Subject: Re: [PATCH v3] firmware: coreboot: Check size of table entry and
split memcpy
Quoting Kees Cook (2023-01-12 15:03:16)
> 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@...gen.mpg.de>
> Link: https://lore.kernel.org/all/03ae2704-8c30-f9f0-215b-7cdf4ad35a9a@molgen.mpg.de/
> Cc: Jack Rosenthal <jrosenth@...omium.org>
> Cc: Guenter Roeck <groeck@...omium.org>
> Cc: Julius Werner <jwerner@...omium.org>
> Cc: Brian Norris <briannorris@...omium.org>
> Cc: Stephen Boyd <swboyd@...omium.org>
> Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
> Signed-off-by: Kees Cook <keescook@...omium.org>
> Reviewed-by: Julius Werner <jwerner@...omium.org>
> Reviewed-by: Guenter Roeck <groeck@...omium.org>
> Link: https://lore.kernel.org/r/20230107031406.gonna.761-kees@kernel.org
> ---
Reviewed-by: Stephen Boyd <swboyd@...omium.org>
Powered by blists - more mailing lists