Skip to content

fpga: zynqpl: fix bitstream header scan length checks

Michal Simek u-boot 1 version Applied

Status from this message: Applied.

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 1 replyApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/2fpga: zynqpl: use actread for bitstream scan in zynq_loadfsdrivers/fpga/zynqpl.c+1 -10 replies
2/2fpga: zynqpl: stop header scan once a full header can't fitdrivers/fpga/zynqpl.c+1 -10 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/2] fpga: zynqpl: fix bitstream header scan length checks

Hi,

This series fixes bitstream header scan length checks in check_data(), reachable from fpga load and fpga loadfs.

Patch 1 stops the bitstream header scan once there's no longer enough room left for a full header. The old scan kept checking positions near the end of the buffer that could never hold a complete header, and a match there caused an unbounded header read to go past the buffer end.

Patch 2 fixes zynq_loadfs() passing blocksize into zynq_validate_bitstream() after fs_read(), even when actread was smaller. Pass actread so the scan length matches the bytes actually written into the buffer.

Thanks,
Michal

Suraj Kakade (2):
fpga: zynqpl: use actread for bitstream scan in zynq_loadfs
fpga: zynqpl: stop header scan once a full header can't fit

 drivers/fpga/zynqpl.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

---

Signature · 1 line
2.43.0