mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Nicolas Dufresne <nicolas.dufresne@collabora.com>
To: Detlev Casanova <detlev.casanova@collabora.com>,
	 linux-kernel@vger.kernel.org
Cc: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>,
	Mauro Carvalho Chehab	 <mchehab@kernel.org>,
	Heiko Stuebner <heiko@sntech.de>,
	 linux-media@vger.kernel.org, linux-rockchip@lists.infradead.org,
	 linux-arm-kernel@lists.infradead.org, kernel@collabora.com,
	Christian Hewitt	 <christianshewitt@gmail.com>,
	Jonas Karlman <jonas@kwiboo.se>
Subject: Re: [PATCH] media: rkvdec: Improve handling missing short/long term RPS
Date: Fri, 06 Feb 2026 15:59:42 -0500	[thread overview]
Message-ID: <600cc65678331b0c419d0b517d6c9003481223b8.camel@collabora.com> (raw)
In-Reply-To: <20260123192244.1441637-1-detlev.casanova@collabora.com>

[-- Attachment #1: Type: text/plain, Size: 1889 bytes --]

Le vendredi 23 janvier 2026 à 14:22 -0500, Detlev Casanova a écrit :
> The values of ext_sps_st_rps and ext_sps_lt_rps in struct rkvdec_hevc_run
> are not initialized when the respective controls are not set by userspace.
> 
> When this is the case, set them to NULL so the rkvdec_hevc_run_preamble
> function that parses controls does not access garbage data which leads to
> a panic on unaccessible memory.
> 
> Fixes: c9a59dc2acc7 ("media: rkvdec: Add HEVC support for the VDPU381 variant")
> Reported-by: Christian Hewitt <christianshewitt@gmail.com>
> Suggested-by: Jonas Karlman <jonas@kwiboo.se>
> Signed-off-by: Detlev Casanova <detlev.casanova@collabora.com>

Reviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>

I'll pick this in fixes, so we don't release 6.20 (or 7) with that bug.

cheers,
Nicolas

> ---
>  drivers/media/platform/rockchip/rkvdec/rkvdec-hevc-common.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/media/platform/rockchip/rkvdec/rkvdec-hevc-common.c b/drivers/media/platform/rockchip/rkvdec/rkvdec-hevc-common.c
> index 28267ee30190..3119f3bc9f98 100644
> --- a/drivers/media/platform/rockchip/rkvdec/rkvdec-hevc-common.c
> +++ b/drivers/media/platform/rockchip/rkvdec/rkvdec-hevc-common.c
> @@ -500,11 +500,15 @@ void rkvdec_hevc_run_preamble(struct rkvdec_ctx *ctx,
>  		ctrl = v4l2_ctrl_find(&ctx->ctrl_hdl,
>  				      V4L2_CID_STATELESS_HEVC_EXT_SPS_ST_RPS);
>  		run->ext_sps_st_rps = ctrl ? ctrl->p_cur.p : NULL;
> +	} else {
> +		run->ext_sps_st_rps = NULL;
>  	}
>  	if (ctx->has_sps_lt_rps) {
>  		ctrl = v4l2_ctrl_find(&ctx->ctrl_hdl,
>  				      V4L2_CID_STATELESS_HEVC_EXT_SPS_LT_RPS);
>  		run->ext_sps_lt_rps = ctrl ? ctrl->p_cur.p : NULL;
> +	} else {
> +		run->ext_sps_lt_rps = NULL;
>  	}
>  
>  	rkvdec_run_preamble(ctx, &run->base);

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

      parent reply	other threads:[~2026-02-06 20:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-23 19:22 Detlev Casanova
2026-01-24  2:02 ` Christian Hewitt
2026-02-06 20:59 ` Nicolas Dufresne [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=600cc65678331b0c419d0b517d6c9003481223b8.camel@collabora.com \
    --to=nicolas.dufresne@collabora.com \
    --cc=christianshewitt@gmail.com \
    --cc=detlev.casanova@collabora.com \
    --cc=ezequiel@vanguardiasur.com.ar \
    --cc=heiko@sntech.de \
    --cc=jonas@kwiboo.se \
    --cc=kernel@collabora.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=mchehab@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®