All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] board: xilinx: Fix board name overflow and allow board ft_board_setup()
@ 2026-09-09 19:20 Sriram Sriram
  2026-09-09 19:20 ` [PATCH 1/2] board: xilinx: Use strlcat() in board_name_decode() Sriram Sriram
  2026-09-09 19:20 ` [PATCH 2/2] board: xilinx: Make ft_board_setup() weak Sriram Sriram
  0 siblings, 2 replies; 8+ messages in thread
From: Sriram Sriram @ 2026-09-09 19:20 UTC (permalink / raw)
  To: u-boot; +Cc: Michal Simek, Tom Rini, Drew Kluemke, Sriram Sriram

Two independent fixes to the xilinx vendor common board file, both found
while bringing a downstream Versal NET board up to date with mainline.

Patch 1 fixes a heap buffer overflow in board_name_decode(). The name is
built with strcat() into a 50 byte allocation, and the length check that
is supposed to catch the overflow only runs after the writes. Each EEPROM
descriptor can contribute up to 29 characters, so a base board plus a
carrier card already overruns the buffer with EEPROM-supplied data.

Patch 2 marks ft_board_setup() __weak so that a board using the xilinx
vendor common library can supply its own device tree fixups, the same way
the file already allows board_name_decode(), board_detection(),
soc_detection() and board_rng_seed() to be overridden. Today such a board
fails to link with "multiple definition of ft_board_setup".

Both patches were build tested on xilinx_zynqmp_kria_defconfig, which
enables CONFIG_DTB_RESELECT and CONFIG_OF_BOARD_SETUP and so compiles
both of the changed functions.

Drew Kluemke (1):
  board: xilinx: Use strlcat() in board_name_decode()

Sriram Sriram (1):
  board: xilinx: Make ft_board_setup() weak

 board/xilinx/common/board.c | 22 +++++++++++++---------
 1 file changed, 13 insertions(+), 9 deletions(-)

-- 
2.49.0


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2026-09-10  9:43 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-09 19:20 [PATCH 0/2] board: xilinx: Fix board name overflow and allow board ft_board_setup() Sriram Sriram
2026-09-09 19:20 ` [PATCH 1/2] board: xilinx: Use strlcat() in board_name_decode() Sriram Sriram
2026-09-10  7:56   ` Maarten Brock
2026-09-10  7:59     ` Michal Simek
2026-09-10  8:03   ` Michal Simek
2026-09-10  9:30     ` Maarten Brock
2026-09-10  9:43       ` Michal Simek
2026-09-09 19:20 ` [PATCH 2/2] board: xilinx: Make ft_board_setup() weak Sriram Sriram

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.