CVE-2026-139027: Linux kernel vivid test driver writes past the capture buffer for an odd frame height

ByLinuxtastic

December 2, 2026 #CVE, #Linux Kernel

vivid is the kernel’s virtual video test driver: it registers fake capture and output devices so V4L2 applications can be tested without a camera. Its test-pattern generator sizes the capture buffer from the frame height with a truncating division, but fills chroma lines for a vertically subsampled format with a rounding-up count, so “a 720×49 NV12 capture format, i.e. an odd height for a format whose chroma plane is vertically subsampled” allocates 52,920 bytes and writes 53,280. syzbot reported it as a KASAN vmalloc out-of-bounds write. Red Hat rates it Important at 7.8 as a local escalation for anyone who can open the device. If vivid is loaded on a machine with untrusted local users, unload it now and upgrade to 5.10.275, 5.15.226, 6.1.193, 6.6.163, 6.12.117, 6.18.63, 7.3.4 or later.

CVE-2026-139027 at a glance.

ComponentLinux kernel, media test driver vivid (drivers/media/test-drivers/vivid/vivid-vid-cap.c), with the overflow landing in the shared test-pattern generator drivers/media/common/v4l2-tpg/v4l2-tpg-core.c
Affected versionsfrom ddcaee9dd4c0: 4.1 up to 5.10 before 5.10.275, 5.15 before 5.15.226, 6.1 before 6.1.193, 6.6 before 6.6.163, 6.12 before 6.12.117, 6.18 before 6.18.63, 7.3 before 7.3.4 and 7.4 before 7.4-rc1; only kernels with CONFIG_VIDEO_VIVID built, and only once the module is loaded
Fixed inmainline 7.4-rc1 (commit a2ec28dd, “round the height down to the vertical subsampling factor”, which makes the buffer and the generator agree) and stable 5.10.275, 5.15.226, 6.1.193, 6.6.163, 6.12.117, 6.18.63, 7.3.4; eight commits in the record
SeverityRed Hat Important, CVSS 3.1 7.8 (AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H, draft, CWE-787), bug 2586584 “vivid: out-of-bounds write via odd frame height in vertically subsampled formats”; the kernel CNA gives no score and NVD (Received, 30 November) carries none; Ubuntu Medium; SUSE could not be read on 2 December 2026
Exploited in the wildNot on the CISA KEV catalogue (2026.11.30). EPSS 0.00211 (12th percentile) on 1 December 2026
Who is exposedMachines where vivid is loaded and a user who is not root can open its /dev/video* node: V4L2 development hosts, CI runners for media software, and desktops where someone once loaded it for a webcam test and never unloaded it. Red Hat ships no vivid module and marks every RHEL kernel not affected; where a distribution builds it as a module, nothing loads it on its own
PublishedCVE record 30 November 2026 (kernel CNA); this page built 2 December 2026, last updated 2 December 2026

What it is

For a planar format such as NV12 the chroma plane carries half as many lines as the luma plane. When an application sets a capture format, vivid computes each plane’s buffer size as the line width times the height, divided by the plane’s vertical downsampling factor. For a single buffer holding both planes the line width is 720 + 360 = 1080 bytes, so a height of 49 gives 1080 × 49 = 52,920 bytes, the integer division silently dropping half a chroma line. The test-pattern generator does the opposite arithmetic: “tpg_fill_plane_buffer() however emits one chroma line for every two luma lines, i.e. DIV_ROUND_UP(49, 2) = 25 lines”, and needs 49 × 720 + 25 × 720 = 53,280 bytes. The last chroma line’s memcpy() runs 360 bytes past the end of the vmalloc’d buffer, which syzbot caught as a 720-byte write at the boundary.

Any process that can open the capture device chooses the format with an ordinary VIDIOC_S_FMT ioctl, so the odd height is attacker-controlled and the overflow is a write of pattern data into whatever vmalloc allocation follows the buffer. That is why Red Hat scores it as a local escalation rather than a crash: the written bytes are the generator’s own, not arbitrary, but the length and the target page are chosen by the caller.

The fix in drivers/media/test-drivers/vivid/vivid-vid-cap.c rounds the requested height down to a multiple of the format’s vertical subsampling factor before the sizes are computed, so a 49-line NV12 request becomes 48 lines and the two calculations agree. Because vivid is a test driver, the kernel’s answer is also the obvious one: it should not be loaded on a machine that is not testing V4L2 software.

Who is affected on Linux

Each row is what the distribution’s own security tracker said on 2 December 2026; the link in the row is the tracker page, which will be newer than this one. The vulnerable code runs only where the vivid module is loaded.

DistributionStatusFixed package
AlpineNot consulted for this page—
Debianbookworm (6.1.176-1, security 6.1.192-3) vulnerable; trixie (6.12.117-1, security 6.12.118-1) fixed; forky and sid (7.3.6-1) fixed, first fixed upload 7.3.4-1; no DSAtrixie 6.12.117-1; unstable 7.3.4-1
UbuntuMedium; the linux package is needs evaluation on every release from 14.04 to 26.10 on 2 December 2026, nothing releasednothing on 2 December 2026
RHEL, Rocky, Alma, CentOS StreamImportant, 7.8 (bug 2586584, CWE-787), but kernel and kernel-rt are not affected in RHEL 6 to 10 and every OpenShift RHCOS image: Red Hat does not build the vivid test driver—
openSUSE/SLENot consulted: suse.com refused the automated reader on 2 December 2026 (client error)—
Fedora, Arch; self-built kernelsNot consulted; upstream stable versions apply. A kernel built without CONFIG_VIDEO_VIVID has nothing to fix5.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: is the module loaded or even built, which kernel is running, and who can open the device it creates. On nearly every production host the first answer settles it.

# 1. is vivid loaded, and is it available to be loaded at all
lsmod | grep -w vivid
modinfo -n vivid 2>/dev/null || echo "vivid not built for this kernel"
grep -E '^CONFIG_VIDEO_VIVID=' /boot/config-$(uname -r) 2>/dev/null

# 2. the running kernel: fixed in 5.10.275, 5.15.226, 6.1.193, 6.6.163, 6.12.117, 6.18.63, 7.3.4 or later
uname -r

# 3. if loaded: which nodes are vivid's, and who can open them
for d in /sys/class/video4linux/video*; do printf '%s %s\n' "$(basename $d)" "$(cat $d/name)"; done 2>/dev/null | grep -i vivid
ls -l /dev/video* 2>/dev/null
getfacl /dev/video* 2>/dev/null | grep -E '^(user|group):[^:]'

No module and no CONFIG_VIDEO_VIVID line means the page does not apply. A loaded module on a kernel below the fixed version is the exposed case: by default the nodes belong to root:video with mode 0660, so the exposure is everyone in the video group, plus the console user through the ACL that systemd-logind grants on /dev/video*. That console-user ACL is what makes a desktop with a stray vivid an escalation for whoever is logged in.

How to fix it

Unload the module where it is not needed, which closes the hole immediately, then take the fixed kernel on the normal schedule and reboot. Hosts that test V4L2 software need the kernel update and, until it lands, device permissions that keep the nodes away from untrusted accounts.

# Immediate: unload vivid and stop it coming back (also removes it from the initramfs on the next rebuild)
modprobe -r vivid
echo 'blacklist vivid' > /etc/modprobe.d/vivid-cve-2026-139027.conf
echo 'install vivid /bin/false' >> /etc/modprobe.d/vivid-cve-2026-139027.conf
# Debian trixie (6.12.117-1) and forky / sid (7.3.4-1 and later) carry the fix; bookworm: watch the tracker row above
apt update && apt install linux-image-amd64 && systemctl reboot
# Ubuntu: needs evaluation on 2 December 2026; once the linux package is released
apt update && apt install linux-generic && systemctl reboot
# RHEL / Rocky / Alma: not affected (no vivid module); nothing to do
# Test hosts that must keep vivid until the fixed kernel: restrict the nodes to root and the test account
chmod 600 /dev/video* && setfacl -b /dev/video*
setfacl -m u:ci-runner:rw /dev/video*     # one named account, if the tests need it

The install vivid /bin/false line matters as well as the blacklist: a blacklist only stops automatic loading by alias, and a user with sudo modprobe rights or a test script that calls modprobe vivid explicitly gets past it, while the install override does not. What not to do: do not fix this by adding users to the video group or widening the device mode so a test suite runs, which is exactly the configuration the score assumes; and do not treat an odd-height format as something only a test would request, since the ioctl is available to any process with the node open.

Sources

  • CVE-2026-139027 at CVE.org — the kernel CNA record: the syzbot KASAN report, the 52,920 against 53,280 byte arithmetic, the file and version ranges (30 November 2026)
  • Fix commit a2ec28dd (mainline 7.4-rc1, the commit Debian cites) and the stable backports f8614b4e, f3b8f2f6, 00dd4a5c, 66ad567e, 6c55e02d, 883ba967, e9115c13; git.kernel.org refuses automated readers, so the diff is described from the CNA’s copy of the commit message
  • NVD entry — Received on 30 November 2026; no CVSS metric, CWE or CPE on 2 December 2026
  • Distribution trackers: Debian (bookworm vulnerable, trixie fixed in 6.12.117-1, unstable in 7.3.4-1) · Red Hat (Important 7.8, bug 2586584, CWE-787; every RHEL kernel not affected; the statement that vivid is not loaded by default) · Ubuntu (Medium, needs evaluation; read from the HTML page, the JSON endpoint refused) · SUSE (refused the automated reader on 2 December 2026)
  • CISA KEV catalogue 2026.11.30, not listed · EPSS 0.00211 (percentile 0.120) on 1 December 2026

Related reading

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.