In the Linux kernel, the following vulnerability has been resolved:
media: v4l2-ctrls: validate HEVC tile counts
The stateless HEVC decoders read num_tile_columns_minus1 + 1 entries from
column_width_minus1[] and num_tile_rows_minus1 + 1 from row_height_minus1[]
and use them as tile-loop bounds, but std_validate_compound() does not
bound these u8 counts. Reject a V4L2_CTRL_TYPE_HEVC_PPS with tiling
enabled whose tile counts exceed the uAPI array capacity, mirroring the
existing compound-control range checks.
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 attacker-controlled bytes are num_tile_columns_minus1, num_tile_rows_minus1 and column_width_minus1[]/row_height_minus1[] in struct v4l2_ctrl_hevc_pps, copied from userspace by VIDIOC_S_EXT_CTRLS through v4l_s_ext_ctrls → v4l2_s_ext_ctrls → user_to_new into std_validate_compound(); no network protocol carries those fields.
AC:L - Setting V4L2_HEVC_PPS_FLAG_TILES_ENABLED with num_tile_columns_minus1>=20 or num_tile_rows_minus1>=22 is enough; the next decode job (hantro_g2_hevc_dec_run→prepare_tile_info_buffer, rkvdec assemble_hw_pps→compute_tiles_non_uniform, or cedrus_h265_setup→cedrus_h265_write_tiles) uses those u8 counts as loop bounds with no race or hardware-fault precondition.
PR:L - rkvdec_open(), hantro_open() and cedrus_open() perform no capable() check; v4l2_open only requires opening the decoder /dev/videoN. On Rockchip, Allwinner and Hantro devices that node is granted to unprivileged video-group or Android media-client users, not init-namespace root.
UI:N - The attacking process opens the HEVC decoder itself, issues VIDIOC_S_EXT_CTRLS with the crafted V4L2_CTRL_TYPE_HEVC_PPS, then QBUF/STREAMON via the request API. No separate victim mount, file-open, or playback action is required.
S:U - The overflows remain in kernel stack (vdpu383 assemble_hw_pps column_width[22]), hantro tile_sizes DMA memory, and the rkvdec param_set PPS packet. This is kernel memory corruption under the same security authority, not a VM, IOMMU, or sandbox escape.
C:H - cedrus_h265_write_tiles() and compute_tiles_non_uniform() index column_width_minus1[20] and row_height_minus1[22] with a u8 count up to 255, reading past the v4l2_ctrl_hevc_pps object into adjacent kernel heap that is then copied into stack and DMA tile buffers.
I:H - compute_tiles_non_uniform() writes attacker-chosen column_width_minus1[i]+1 values past stack arrays column_width[20/22]; prepare_tile_info_buffer() writes up to 256x256 u16 pairs into a 20x22 tile_sizes DMA buffer; rkvdec_set_bw_field() stores COLUMN_WIDTH(i) past the 80-byte PPS packet.
A:H - The stack smash of column_width/row_height, the tile_sizes DMA overflow, and rkvdec_set_bw_field() writes past param_set can walk into unmapped or poisoned memory and oops the kernel, and can wedge the HEVC decoder hardware. The trigger is repeatable at will.
| Attack Vector |
Local |
Scope |
Unchanged |
| Attack Complexity |
Low |
Confidentiality Impact |
High |
| Privileges Required |
Low |
Integrity Impact |
High |
| User Interaction |
None |
Availability Impact |
High |
AV:L - The attacker-controlled bytes are num_tile_columns_minus1, num_tile_rows_minus1 and column_width_minus1[]/row_height_minus1[] in struct v4l2_ctrl_hevc_pps, copied from userspace by VIDIOC_S_EXT_CTRLS through v4l_s_ext_ctrls → v4l2_s_ext_ctrls → user_to_new into std_validate_compound(); no network protocol carries those fields.
AC:L - Setting V4L2_HEVC_PPS_FLAG_TILES_ENABLED with num_tile_columns_minus1>=20 or num_tile_rows_minus1>=22 is enough; the next decode job (hantro_g2_hevc_dec_run→prepare_tile_info_buffer, rkvdec assemble_hw_pps→compute_tiles_non_uniform, or cedrus_h265_setup→cedrus_h265_write_tiles) uses those u8 counts as loop bounds with no race or hardware-fault precondition.
PR:L - rkvdec_open(), hantro_open() and cedrus_open() perform no capable() check; v4l2_open only requires opening the decoder /dev/videoN. On Rockchip, Allwinner and Hantro devices that node is granted to unprivileged video-group or Android media-client users, not init-namespace root.
UI:N - The attacking process opens the HEVC decoder itself, issues VIDIOC_S_EXT_CTRLS with the crafted V4L2_CTRL_TYPE_HEVC_PPS, then QBUF/STREAMON via the request API. No separate victim mount, file-open, or playback action is required.
S:U - The overflows remain in kernel stack (vdpu383 assemble_hw_pps column_width[22]), hantro tile_sizes DMA memory, and the rkvdec param_set PPS packet. This is kernel memory corruption under the same security authority, not a VM, IOMMU, or sandbox escape.
C:H - cedrus_h265_write_tiles() and compute_tiles_non_uniform() index column_width_minus1[20] and row_height_minus1[22] with a u8 count up to 255, reading past the v4l2_ctrl_hevc_pps object into adjacent kernel heap that is then copied into stack and DMA tile buffers.
I:H - compute_tiles_non_uniform() writes attacker-chosen column_width_minus1[i]+1 values past stack arrays column_width[20/22]; prepare_tile_info_buffer() writes up to 256x256 u16 pairs into a 20x22 tile_sizes DMA buffer; rkvdec_set_bw_field() stores COLUMN_WIDTH(i) past the 80-byte PPS packet.
A:H - The stack smash of column_width/row_height, the tile_sizes DMA overflow, and rkvdec_set_bw_field() writes past param_set can walk into unmapped or poisoned memory and oops the kernel, and can wedge the HEVC decoder hardware. The trigger is repeatable at will.
CVSS 3.1