CVE-2026-139041

media: vicodec: make encoder CAPTURE dimensions read-only

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: make encoder CAPTURE dimensions read-only

Setting the encoder's compressed CAPTURE format to a smaller resolution
than the raw OUTPUT format makes the encoder write past the end of the
CAPTURE buffer.

For a stateful encoder the CAPTURE width and height are not
client-settable; Documentation/userspace-api/media/v4l/dev-encoder.rst
specifies them as "ignored (read-only)" on VIDIOC_S_FMT. vicodec only
implements half of that: vidioc_s_fmt_vid_out() derives the CAPTURE coded
size and sizeimage from the OUTPUT format, but S_FMT on the CAPTURE queue
overwrites them. The encoder then takes its geometry from the OUTPUT
queue alone, and v4l2_fwht_encode() gets no destination length.

Overwrite the requested width and height with the OUTPUT queue's coded
dimensions in vidioc_try_fmt_vid_cap(), making them read-only as the
interface requires.

Analysis

AI-generated

Technical impact

The Linux kernel media vicodec driver allowed setting a compressed CAPTURE format smaller than the raw OUTPUT format, which caused code in v4l2_fwht_encode to write past the end of the CAPTURE buffer. This out‑of‑bounds write can corrupt kernel memory and provides a path for an attacker to achieve arbitrary kernel writes, enabling privilege escalation or arbitrary code execution.

Affected Systems

The vulnerability resides in the Linux kernel media vicodec driver. All Linux kernel versions that contain the buggy logic and have not yet incorporated the fix are potentially affected; no specific version range is listed in the CVE data.

Risk and Exploitability

No CVSS or EPSS scores are provided, but a kernel boundary violation of this nature is considered severe. Exploitability requires a local user with write access to the video device to formulate a malformed video format request; from there, the attacker could gain kernel privileges. The vulnerability is not listed in CISA KEV, so it has not yet been identified as a known exploited vulnerability.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade the Linux kernel to a version that includes the vicodec fix, which replaces the buggy logic and enforces read‑only CAPTURE dimensions.
  • If a kernel upgrade cannot be applied immediately, blacklist or unload the vicodec kernel module to prevent any use of the vulnerable driver.
  • Restrict device permissions on /dev/video* so that only trusted users or processes can write to them, thereby reducing the chance that a local attacker can reach the vulnerable code.

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: make encoder CAPTURE dimensions read-only Setting the encoder's compressed CAPTURE format to a smaller resolution than the raw OUTPUT format makes the encoder write past the end of the CAPTURE buffer. For a stateful encoder the CAPTURE width and height are not client-settable; Documentation/userspace-api/media/v4l/dev-encoder.rst specifies them as "ignored (read-only)" on VIDIOC_S_FMT. vicodec only implements half of that: vidioc_s_fmt_vid_out() derives the CAPTURE coded size and sizeimage from the OUTPUT format, but S_FMT on the CAPTURE queue overwrites them. The encoder then takes its geometry from the OUTPUT queue alone, and v4l2_fwht_encode() gets no destination length. Overwrite the requested width and height with the OUTPUT queue's coded dimensions in vidioc_try_fmt_vid_cap(), making them read-only as the interface requires.
Title media: vicodec: make encoder CAPTURE dimensions read-only
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