Re: [PATCH 3/7] media: rkvdec: hevc: bound the RPS reads by the control size

From: Daniel Golle

Date: Fri Nov 20 2026 - 18:18:09 EST


Hi Nicolas,

thanks for the review and sorry about the messy text.

On Mon, Nov 16, 2026 at 08:49:44AM -0500, Nicolas Dufresne wrote:
> Le samedi 14 novembre 2026 à 10:22 +0000, Daniel Golle a écrit :
> > The RPS helpers read num_short_term_ref_pic_sets elements of the
> > EXT_SPS_ST_RPS control and num_long_term_ref_pics_sps elements of the
> > EXT_SPS_LT_RPS control, however many elements userspace passed.
> >
>
> What did you want to say?

The number of RPS entries comes from the SPS control, the entries
themselves from the EXT_SPS_ST_RPS/LT_RPS array controls. The driver
never checks that the arrays are as long as the SPS says, so it reads
past the end of what userspace passed. I will reword the message
along these lines in v2.

>
> > Beyond
> > the passed elements they read stale entries of the control's array,
> > and past its allocation once the SPS counts more sets than the control
>
> More broken text, can you work a bit on your messages, be concise, precise,
> don't get into details but into the understanding of what you are achieving. The
> code is precise enough.

Got it. Reading it again now I understand your point, I may have been a
bit too excited about my findings on a Saturday morning...