]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
media: verisilicon: Protect G2 HEVC decoder against invalid DPB index
authorNicolas Dufresne <nicolas.dufresne@collabora.com>
Mon, 22 Sep 2025 18:43:39 +0000 (14:43 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 8 Jan 2026 09:14:45 +0000 (10:14 +0100)
commit3d0ec859e009ef1b148fae472b016648735eb57e
treecc8b82e5538293d16cf8483fb9dc5f20b06914b1
parent3680da86c180a76175f23ef561f77d0a2b33fee6
media: verisilicon: Protect G2 HEVC decoder against invalid DPB index

commit 47825b1646a6a9eca0f90baa3d4f98947c2add96 upstream.

Fix the Hantro G2 HEVC decoder so that we use DPB index 0 whenever a
ninvalid index is received from user space. This protects the hardware
from doing faulty memory access which then leads to bus errors.

To be noted that when a reference is missing, userspace such as GStreamer
passes an invalid DPB index of 255. This issue was found by seeking to a
CRA picture using GStreamer. The framework is currently missing the code
to skip over RASL pictures placed after the CRA. This situation can also
occur while doing live streaming over lossy transport.

Fixes: cb5dd5a0fa518 ("media: hantro: Introduce G2/HEVC decoder")
Cc: stable@vger.kernel.org
Reviewed-by: Benjamin Gaignard <benjamin.gaignard@collabora.com>
Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/media/platform/verisilicon/hantro_g2_hevc_dec.c