vicodec is the kernel’s virtual video codec, a test driver that implements the FWHT format in software so that V4L2 codec applications can be exercised without hardware. The kernel CNA record describes an arithmetic slip in how it rounds frame sizes: “A capture format whose width or height is one more than a multiple of 16 makes the FWHT codec write one 8×8 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.” The macro meant to round a dimension so both luma and chroma planes are multiples of 8 “only rounds the chroma plane”, and for a dimension of 16n+1 it returns one less than the input while the encoder and decoder round the same dimension up by seven. The kernel CNA and Red Hat score it 7.8 as a local flaw, Red Hat rates it Important. If a host loads vicodec and users other than root can open its video devices, upgrade it to a kernel at or above 5.10.275, 5.15.226, 6.1.193, 6.6.163, 6.12.117, 6.18.63 or 7.3.4 and reboot, or unload the driver.
CVE-2026-139042 at a glance.
| Component | Linux kernel, the vicodec virtual codec driver (vicodec.ko, CONFIG_VIDEO_VICODEC): the vic_round_dim() macro in drivers/media/test-drivers/vicodec/codec-fwht.h |
| Affected versions | mainline 5.1 up to 7.4-rc1 (from commit 3b15f68e, “media: vicodec: Add support for resolution change event.”); 5.10.x below 5.10.275, 5.15.x below 5.15.226, 6.1.x below 6.1.193, 6.6.x below 6.6.163, 6.12.x below 6.12.117, 6.18.x below 6.18.63, 7.3.x below 7.3.4 |
| Fixed in | mainline 7.4-rc1 (commit 0183746e, the one Debian cites) and stable 5.10.275, 5.15.226, 6.1.193, 6.6.163, 6.12.117, 6.18.63, 7.3.4; eight fix commits in the record. The fix changes one line of the macro to round the dimension itself up to a multiple of 8 × div; the record notes the result only changes for div 2 and dim % 16 == 1 and still fits MAX_WIDTH and MAX_HEIGHT |
| Severity | Kernel CNA CVSS 3.1 7.8 (AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H), which NVD shows as its only metric; Red Hat Important, 7.8 on the same vector (score marked draft, CWE-787); Ubuntu Medium, no score. A heap write of one block row at a chosen size, from any process that can open the device |
| Exploited in the wild | Not on the CISA KEV catalogue (2026.11.30). EPSS 0.00329 (28th percentile) on 1 December 2026 |
| Who is exposed | Hosts with the vicodec module loaded and a user other than root able to open its /dev/videoN nodes, which on desktops with udev’s uaccess rules means whoever is logged in. The attacker sets a capture format of, for example, 641×360 and feeds a P-frame; the record’s KASAN report is a slab out-of-bounds read in add_deltas() from exactly that. Red Hat’s statement: vicodec “is a virtual codec test driver not loaded by default”, and exposure is limited to systems “that explicitly load the driver and where local unprivileged users can access the video device node”; every RHEL release is marked not affected because RHEL does not build it |
| Published | CVE record 30 November 2026 (kernel CNA, updated 1 December); this page built 2 December 2026, last updated 2 December 2026 |
What it is
FWHT works on 8×8 blocks, and because the chroma planes of a 4:2:0 frame are half the size of the luma plane, a frame dimension has to be a multiple of 16 for both to come out as whole blocks. vic_round_dim() was written to do that rounding and documented as such, but its expression, round_up((dim) / (div), 8) * (div), rounds the halved dimension and then doubles it. For almost every input that gives a multiple of 16. The record walks through the one it does not: when dim % 16 == 1, dim / 2 is already a multiple of 8, so the macro returns dim - 1. The encoder and decoder round the same dimension with a plain round_up(dim, 8), which gives dim + 7, one block more than the coded dimension that sized the buffer.
The buffer is sized by the smaller number and written by the larger, so the codec writes one block row, or one block column, past the end of the capture plane, and for P-frames, which are coded as differences from a reference, it reads the same block out of the reference frame too. The record’s 641×360 YUYV example trips KASAN in add_deltas() during decode_plane(); a width of 641 is 16 × 40 + 1. The write is into slab memory the driver allocated for the plane, which makes whatever sits after it the thing that gets corrupted, and the user who set the format decides the plane size and therefore the slab cache. That is a local privilege escalation in outline, which is how both vendors score it, though vicodec is a test driver and the audience for this record is mostly people who build kernels with the test drivers on.
The fix on GitHub, by Junrui Luo and committed by Hans Verkuil, changes one line of codec-fwht.h: the macro now rounds the dimension itself up to a multiple of 8 * div, which for div == 2 is 16. It is marked for stable, credits Yuhao Jiang as the reporter and names the 2019 commit that added resolution-change support as the origin. git.kernel.org and lore.kernel.org refuse automated readers, so the backports are described from the record and the mainline commit from its GitHub mirror.
Who is affected on Linux
Each row is what the distribution’s own security tracker said on 1 and 2 December 2026; the link in the row is the tracker page, which will be newer than this one. The driver has existed since 4.20 and the flaw since 5.1, so any distribution kernel that builds the media test drivers is in range; Red Hat does not.
| Distribution | Status | Fixed package |
|---|---|---|
| Alpine | Not consulted for this page | — |
| Debian | bookworm (6.1.176-1, security 6.1.192-3) vulnerable; trixie (6.12.117-1, security 6.12.118-1) fixed; fixed in forky and sid (7.3.6-1); no DSA | trixie 6.12.117-1; unstable 7.3.4-1; nothing for bookworm on 2 December 2026 |
| Ubuntu | Medium, no Ubuntu CVSS yet; linux needs evaluation in every supported release from 14.04 to 26.10 (no version named); no USN | nothing released on 1 December 2026 |
| RHEL, Rocky, Alma, CentOS Stream | Important, 7.8 (bug 2587130, “vicodec: Denial of Service via out-of-bounds write on crafted frame dimensions”); every RHEL release from 6 to 10, kernel and kernel-rt, and every OpenShift image not affected: the driver is not built | not applicable |
| openSUSE/SLE | Not consulted: suse.com refused the automated reader on 2 December 2026 (client error, twice) | — |
| Fedora, Arch; self-built kernels | Not consulted; upstream stable versions apply | 5.10.275 / 5.15.226 / 6.1.193 / 6.6.163 / 6.12.117 / 6.18.63 / 7.3.4 or later |
How to check
Three questions, in order: which kernel is running, is the vicodec driver built and loaded, and who can open its devices. The second settles it for most hosts; the driver exists for testing and few distributions load it.
# 1. the running kernel (compare with the fixed stable version for its series)
uname -r
# 2. is vicodec built and loaded
lsmod | grep -E '^vicodec'
modinfo -n vicodec 2>/dev/null || echo "vicodec not built for this kernel"
grep -s CONFIG_VIDEO_VICODEC /boot/config-$(uname -r)
# 3. the precondition: its video nodes and who may open them
for v in /sys/class/video4linux/video*; do printf '%s %s\n' "$(basename $v)" "$(cat $v/name)"; done 2>/dev/null | grep -i vicodec
ls -l /dev/video* 2>/dev/null
getfacl /dev/video* 2>/dev/null | grep -E '^user:[a-z]'A kernel at or above the fixed stable version for its series is done, and a host without the module is not in the path, which is every RHEL host and most servers. A host with vicodec loaded, whose video nodes are group video or carry a logged-in user’s ACL, is the record’s case; one where only root can open them has removed the unprivileged attacker. There is no log line for an attempt; a successful one is a KASAN report or slab corruption in codec-fwht.c functions such as add_deltas() or encode_plane().
How to fix it
Install the fixed kernel and reboot, or on a host that only loaded the driver for testing, unload it and leave it unloaded. Debian trixie, forky and sid had the fix out on 2 December; Debian bookworm and Ubuntu had it pending, and Red Hat does not ship the driver.
# Debian forky / sid (trixie and bookworm once a security update names this CVE)
apt update && apt install linux-image-amd64 && systemctl reboot # or linux-image-arm64# Ubuntu, RHEL family, SUSE: when the pending builds land
apt update && apt full-upgrade && systemctl reboot
dnf update kernel && systemctl reboot
zypper patch && systemctl reboot
uname -r# Until then, or instead: unload the test driver and keep it out
modprobe -r vicodec
printf 'install vicodec /bin/false\n' > /etc/modprobe.d/no-vicodec.confUnloading the driver is a complete mitigation on any host that is not actively testing V4L2 codec software, and there is no other reason to have it. What not to do: do not generalise the fix to the real codec drivers; the rounding macro is vicodec’s own, and a hardware codec driver does its own buffer sizing. And do not take Red Hat’s “not affected” rows as a statement about Fedora or about a self-built kernel with CONFIG_VIDEO_VICODEC on.
Sources
- CVE-2026-139042 at CVE.org — the kernel CNA record: the commit message with the “only rounds the chroma plane” explanation, the 641×360 KASAN report, the git and version ranges,
codec-fwht.h(30 November 2026, updated 1 December) - Fix commits on git.kernel.org: 0183746e (mainline, 7.4-rc1) and the backports e7259565, 67320019, 6f2a9c71, 27ea3bc7, 1a5ec52b, 1b317507, 805d4167; git.kernel.org refuses automated readers, so the mainline commit was read on GitHub: Junrui Luo, committed by Hans Verkuil, reported by Yuhao Jiang,
Fixes:3b15f68e,Cc: stable,codec-fwht.h+1/−1 - NVD entry — Received on 30 November 2026; shows the CNA’s 7.8 as a secondary metric, no NVD score, CWE or CPE on 2 December
- Distribution trackers: Debian (bookworm vulnerable, trixie fixed in 6.12.117-1, sid in 7.3.6-1) · Ubuntu (Medium; needs evaluation in every release) · Red Hat (Important 7.8, every RHEL release not affected (driver not built); bug 2587130) · SUSE (not reachable on 2 December)
- CISA KEV catalogue 2026.11.30, not listed · EPSS 0.00329 (percentile 0.281) on 1 December 2026
Related reading
- CVE-2026-138914: Linux kernel Amlogic video decoder writes a 32-aligned frame into a buffer sized for the raw width — the same mistake in a hardware decoder: rounded size, unrounded buffer
- CVE-2026-100016: Linux kernel ALSA compressed-audio device lets a gapless track change shrink the buffer under a stale write count — a media buffer whose size and use disagreed
- CVE-2026-139077: Linux kernel Nouveau driver turns a zero-size notifier request into a 4 GiB GPU DMA window — the same day’s set, another device node any logged-in user can open
- CVE-2026-138849: Linux kernel Qualcomm FastRPC let user space free Audio PD memory the DSP was still using — another /dev node with a user-chosen size
- CVE-2026-99480: Linux kernel Panthor GPU driver frees a group another thread is still creating — a desktop driver reachable from an unprivileged session
- The Kernel — module autoload, why an unused subsystem is still an attack surface, and how
install … /bin/falsediffers fromblacklist
This advisory page was assembled from the primary sources listed above on 2 December 2026 and is updated when they change. The facts are theirs; the checks and the ordering are ours. If a row in the distribution table is out of date, the tracker link in that row is the current word.

