Re: [PATCH v2 2/3] media: iris: check the packet size after reading from shared memory

From: bod

Date: Tue Dec 01 2026 - 07:07:41 EST


On 2026-11-26 21:29 +0000, Hungyu Lin wrote:
> iris_hfi_queue_read() takes the size of a packet from the first word of
> the packet in the shared queue and then copies that many bytes, including
> that word, out of the queue. The firmware can change the word in between,
> so the size field of the copy can be larger than what was copied. The
> gen1 response handlers use that field as the length of the packet, for
> example to walk the buffer requirements in
> iris_hfi_gen1_session_property_info().
>
> venus got the same check in commit 49befc830daa ("media: venus: Add a
> check for packet size after reading from shared memory"). Compare the
> size field of the copy with the size that was used for the copy and fail
> the read if they differ.
>
> Fixes: fb583a214337 ("media: iris: introduce host firmware interface with necessary hooks")
> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: Hungyu Lin <dennylin0707@xxxxxxxxx>
> ---

Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@xxxxxxxxxx>
---
bod