Skip to content

media: iris: add missing packet size checks

Hungyu Lin linux-arm-msm linux-media lkml 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v2 Latest3 patches 0 repliesNew

Changes in v2 from the cover letter

- Add patch 1. A packet size of 1 to 3 was accepted, so the check in patch 2 could compare bytes that were not copied (Konrad)
- Link to v1: https://lore.kernel.org/r/[email protected]

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3media: iris: reject packets that are smaller than the size fielddrivers/media/platform/qcom/iris/iris_hfi_queue.c+1 -10 replies
2/3media: iris: check the packet size after reading from shared memorydrivers/media/platform/qcom/iris/iris_hfi_queue.c+2 -00 replies
3/3media: iris: fix out-of-bounds read in gen1 sequence change eventdrivers/media/platform/qcom/iris/iris_hfi_gen1_response.c+54 -190 replies

Reviews trailers per patch

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

Read the v2 thread

Cover letter [PATCH v2 0/3] media: iris: add missing packet size checks

venus got two fixes in May 2025 for packets that the firmware sends through the shared queues:

49befc830daa ("media: venus: Add a check for packet size after reading from shared memory") 06d6770ff0d8 ("media: venus: Fix OOB read due to missing payload bound check")

The iris gen1 code has the same logic and has neither of them.

Patch 1 rejects a packet size that is smaller than the size field itself. Patch 2 makes sure that the size field of a packet did not change while the packet was copied out of the shared queue. Patch 3 uses that size to bound the walk over the properties of a sequence change event.

Changes in v2:
- Add patch 1. A packet size of 1 to 3 was accepted, so the check in patch 2 could compare bytes that were not copied (Konrad)
- Link to v1: https://lore.kernel.org/r/[email protected]

Hungyu Lin (3):
media: iris: reject packets that are smaller than the size field
media: iris: check the packet size after reading from shared memory
media: iris: fix out-of-bounds read in gen1 sequence change event

 .../qcom/iris/iris_hfi_gen1_response.c        | 73 ++++++++++++++-----
 .../media/platform/qcom/iris/iris_hfi_queue.c |  4 +-
 2 files changed, 57 insertions(+), 20 deletions(-)

base-commit: 7475ea8b58616b33c04afb976cf0fbaad9dd63fb

Signature · 1 line
2.43.0