diff options
author | Kees Cook <[email protected]> | 2023-01-12 15:03:16 -0800 |
---|---|---|
committer | Kees Cook <[email protected]> | 2023-01-13 15:22:03 -0800 |
commit | 3b293487b8752cc42c1cbf8a0447bc6076c075fa (patch) | |
tree | 7503d756954f04b7a1b354fb8bdcdc506e17f4df /scripts/gcc-plugins/gcc-common.h | |
parent | 88603b6dc419445847923fcb7fe5080067a30f98 (diff) |
firmware: coreboot: Check size of table entry and use flex-array
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 <[email protected]>
Link: https://lore.kernel.org/all/[email protected]/
Cc: Jack Rosenthal <[email protected]>
Cc: Guenter Roeck <[email protected]>
Cc: Julius Werner <[email protected]>
Cc: Brian Norris <[email protected]>
Cc: Stephen Boyd <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Signed-off-by: Kees Cook <[email protected]>
Reviewed-by: Julius Werner <[email protected]>
Reviewed-by: Guenter Roeck <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Reviewed-by: Stephen Boyd <[email protected]>
Reviewed-by: Jack Rosenthal <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Diffstat (limited to 'scripts/gcc-plugins/gcc-common.h')
0 files changed, 0 insertions, 0 deletions