Skip to content

accel/ivpu: Harden parsing of firmware-shared buffers

Dawid Osuchowski dri-devel stable 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest3 patches 4 repliesIn review
  2. v12 patches 0 repliesSuperseded

Changes in v2 from the cover letter

- Added a new patch ("accel/ivpu: Limit firmware log name prints to field size") after Sashiko pointed out that log->name was still being printed with an unbounded "%s" conversion. The field is fixed-size and expected to be NUL-terminated, but a firmware bug could drop the terminator; harden the host against that case.
- No changes to the other two patches.

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3accel/ivpu: Validate full buffer range in ivpu_to_cpu_addrdrivers/accel/ivpu/ivpu_gem.h drivers/accel/ivpu/ivpu_ipc.c+15 -61 reply
2/3accel/ivpu: Validate firmware log buffer metadatadrivers/accel/ivpu/ivpu_fw_log.c+45 -311 reply
3/3accel/ivpu: Limit firmware log name prints to field sizedrivers/accel/ivpu/ivpu_fw_log.c+9 -61 reply

Reviews trailers per patch

All 3 patches have a Reviewed-by or Acked-by.

PatchKarol Wachowski
1/3R-b
2/3R-b
3/3R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/3] accel/ivpu: Harden parsing of firmware-shared buffers

The IPC and firmware tracing buffers live in memory shared with the NPU firmware, so every field the host reads from them is untrusted input. This series fixes places where the host trusted such input and could end up dereferencing addresses outside the underlying BO.

All patches are tagged for stable.

Changes since v1:
- Added a new patch ("accel/ivpu: Limit firmware log name prints to field size") after Sashiko pointed out that log->name was still being printed with an unbounded "%s" conversion. The field is fixed-size and expected to be NUL-terminated, but a firmware bug could drop the terminator; harden the host against that case.
- No changes to the other two patches.

Dawid Osuchowski (1):
accel/ivpu: Limit firmware log name prints to field size

Magdalena Schulfer (2):
accel/ivpu: Validate full buffer range in ivpu_to_cpu_addr accel/ivpu: Validate firmware log buffer metadata

 drivers/accel/ivpu/ivpu_fw_log.c | 87 +++++++++++++++++++-------------
 drivers/accel/ivpu/ivpu_gem.h    | 14 +++--
 drivers/accel/ivpu/ivpu_ipc.c    |  7 +--
 3 files changed, 67 insertions(+), 41 deletions(-)
Signature · 1 line
2.43.0