CVE-2026-139042

media: vicodec: fix out-of-bounds write on under-rounded coded dimensions

Published Nov 30, 2026 CVSS n/a EPSS n/a KEV · Not listed
Description
In the Linux kernel, the following vulnerability has been resolved:

media: vicodec: fix out-of-bounds write on under-rounded coded dimensions

A capture format whose width or height is one more than a multiple of 16
makes the FWHT codec write one 8x8 block row, or column, past the end of
the capture plane, and read the same block out of the reference frame for
P-coded frames.

vic_round_dim() is documented to round a frame dimension up so that both
the luma and the chroma plane end up a multiple of 8, but it only rounds
the chroma plane:

round_up((dim) / (div), 8) * (div)

For div == 2 the result is a multiple of 16 in every case but one: when
dim % 16 == 1, dim / div is already a multiple of 8 and the macro returns
dim - 1. encode_plane() and decode_plane() round the same dimension with
round_up(dim, 8), which yields dim + 7 -- one block more than the coded
dimension that sized the buffer.

On a KASAN-enabled kernel, a 641x360 YUYV P-frame triggers:

BUG: KASAN: slab-out-of-bounds in add_deltas+0x450/0xcc0
Read of size 1 at addr ffff888009070800 by task trigger_bin/70

Call Trace:
add_deltas+0x450/0xcc0
decode_plane+0x1916/0x3390
fwht_decode_frame+0x173/0x620
v4l2_fwht_decode+0x751/0x1120
device_run+0x6bb/0x1850

Round the dimension itself up to a multiple of 8 * div. The rounding
changes only for div == 2 and dim % 16 == 1, and MAX_WIDTH and MAX_HEIGHT
are both multiples of 16, so the rounded value still fits the advertised
limits.

Analysis

AI-generated

Technical impact

An out‑of‑bounds write occurs in the Linux kernel vicodec driver when a capture format width or height is one more than a multiple of 16. The incorrect rounding in vic_round_dim() leads the codec to write beyond the allocated capture plane, corrupting adjacent memory. The defect can cause kernel crashes or memory corruption, resulting in denial of service.

Affected Systems

The vulnerability affects the Linux kernel’s vicodec component on all builds where the rounding logic has not been updated. No specific kernel version ranges are listed, so any kernel prior to the patch that includes the commit fixing this issue is vulnerable.

Risk and Exploitability

Because the flaw allows an attacker with local access to a device exposed through V4L2 to trigger a buffer overflow, the risk is high to local privilege users, leading to kernel crashes or potential escalation if the system is not hardened. No exploit has been published, EPSS is not available, and the issue is not listed in CISA KEV. The attack vector is local, requiring control over video capture pipelines. Systems without the fix should consider this a severe local code execution risk.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Ideally, update the kernel to a version that includes the vicodec dimension‑rounding fix.
  • Temporarily, adjust video capture pipelines to avoid frame dimensions that are one more than a multiple of 16, ensuring all widths and heights are clean divisions by 16.
  • Continuously monitor system logs for KASAN or kernel panic messages related to vicodec, and quarantine affected devices if crashes occur.

Generated by OpenCVE AI on November 30, 2026 at 19:10 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
Weaknesses CWE-122
Type Values Removed Values Added
Description In the Linux kernel, the following vulnerability has been resolved: media: vicodec: fix out-of-bounds write on under-rounded coded dimensions A capture format whose width or height is one more than a multiple of 16 makes the FWHT codec write one 8x8 block row, or column, past the end of the capture plane, and read the same block out of the reference frame for P-coded frames. vic_round_dim() is documented to round a frame dimension up so that both the luma and the chroma plane end up a multiple of 8, but it only rounds the chroma plane: round_up((dim) / (div), 8) * (div) For div == 2 the result is a multiple of 16 in every case but one: when dim % 16 == 1, dim / div is already a multiple of 8 and the macro returns dim - 1. encode_plane() and decode_plane() round the same dimension with round_up(dim, 8), which yields dim + 7 -- one block more than the coded dimension that sized the buffer. On a KASAN-enabled kernel, a 641x360 YUYV P-frame triggers: BUG: KASAN: slab-out-of-bounds in add_deltas+0x450/0xcc0 Read of size 1 at addr ffff888009070800 by task trigger_bin/70 Call Trace: add_deltas+0x450/0xcc0 decode_plane+0x1916/0x3390 fwht_decode_frame+0x173/0x620 v4l2_fwht_decode+0x751/0x1120 device_run+0x6bb/0x1850 Round the dimension itself up to a multiple of 8 * div. The rounding changes only for div == 2 and dim % 16 == 1, and MAX_WIDTH and MAX_HEIGHT are both multiples of 16, so the rounded value still fits the advertised limits.
Title media: vicodec: fix out-of-bounds write on under-rounded coded dimensions
First Time appeared Linux
Linux linux Kernel
CPEs cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
Vendors & Products Linux
Linux linux Kernel
References
Weaknesses
  • CWE-122

    Heap-based Buffer Overflow

Sources

Status
PUBLISHED
Assigner
Linux
Published
Updated
Nov 30, 2026, 1:27 PM
Reserved
Nov 30, 2026, 1:22 PM
Status
Received
Published
Nov 30, 2026, 2:18 PM
Modified
Nov 30, 2026, 2:18 PM