CVE-2026-89882 PUBLISHED

media: rkvdec: hevc: guard INTER_REF_PIC_SET_PRED index underflow

Assigner: Linux
Reserved: 11.09.2026 Published: 16.09.2026 Updated: 16.09.2026

In the Linux kernel, the following vulnerability has been resolved:

media: rkvdec: hevc: guard INTER_REF_PIC_SET_PRED index underflow

st_ref_pic_set_prediction() computes the reference RPS index as st_rps_idx - (delta_idx_minus1 + 1) per HEVC spec equation 7-59. Both operands are u8, so when delta_idx_minus1 + 1 exceeds the current index the subtraction wraps and the subsequent array access at calculated_rps_st_sets[ref_rps_idx] reads far out of bounds.

A userspace V4L2 client that can open the RKVDEC m2m decoder can submit an EXT_SPS_ST_RPS control with INTER_REF_PIC_SET_PRED set and delta_idx_minus1 crafted to trigger the underflow.

Reject the entry early when the reference index would underflow.

Metrics

CVSS Vector: CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
CVSS Score: 7.8

AV:L - The EXT_SPS_ST_RPS control is applied only via VIDIOC_S_EXT_CTRLS or a media request on the local rkvdec V4L2 m2m node (/dev/videoN), then consumed in rkvdec_hevc_run after QBUF/STREAMON. The HEVC RPS parser is not reachable from the network stack. AC:L - The attacker sets INTER_REF_PIC_SET_PRED and a delta_idx_minus1 that makes the u8 index wrap (e.g. idx=0 and delta_idx_minus1=0 yields ref_rps_idx=255). v4l2-ctrls never validates delta_idx_minus1 and try_ctrl only checks SPS, so the out-of-bounds access is deterministic with no race. PR:L - rkvdec_open and the ioctl path perform no capability check. An unprivileged local account that can open the decoder node is sufficient, typically via the video group or the Android/embedded media codec service that sandboxed apps can reach. UI:N - The attacking process itself opens the decoder, attaches a crafted EXT_SPS_ST_RPS control, queues buffers, and starts streaming. No separate victim action is required. S:U - The underflow corrupts kernel heap, stack, and the driver's DMA RPS table inside the same kernel security authority. This is local privilege escalation, not a VM escape, IOMMU bypass, or sandbox-boundary crossing. C:H - A wrapped u8 ref_rps_idx indexes calculated_rps_st_sets tens of kilobytes past the kzalloc allocation (up to 255 * sizeof(struct calculated_rps_st_set)). Those out-of-bounds bytes become loop bounds and are copied into the hardware RPS table, giving an attacker-steerable kernel memory read. I:H - Out-of-bounds num_delta_pocs overflows the 16-byte stack arrays use_delta_flag and used_by_curr_pic_flag, later loops write past st_rps->delta_poc_s0[16] on the heap, and assemble_hw_st_rps bit-writes rps->info with an unbounded index. That is an attacker-influenced kernel write usable for control-flow hijack. A:H - The far out-of-bounds pointer, stack smash, and DMA RPS-table overrun each cause a kernel oops, KASAN report, or wedged decoder, and the attacker can repeat the sequence at will.

Product Status

Vendor Linux
Product Linux
Versions Default: unaffected
  • affected from c9a59dc2acc72789d5c778af080d1e65af84862c to 74938f83a8abbee8f502dfb5d94213b2497d1edf (excl.)
  • affected from c9a59dc2acc72789d5c778af080d1e65af84862c to 052c5ed5a1d96a6b24fd50ccda16fc6841ee7ca3 (excl.)
Vendor Linux
Product Linux
Versions Default: affected
  • Version 7.0 is affected
  • unaffected from 0 to 7.0 (excl.)
  • unaffected from 7.2.5 to 7.2.* (incl.)
  • unaffected from 7.3-rc1 to * (incl.)

References