CVE-2026-138905
published high CVSS 3.1 · 7.8media: vicodec: fix NULL deref on oversized frame
Package status and fixes
| Distro / vendor | Release | Package / product | Publisher status | Fixed build | Source |
|---|---|---|---|---|---|
| Linux | — | Linux3b15f68e19c28a76d175f61943a8c23224afce93 to < ed06bca3414b045dd29a0a5ca65e64e83e0b5373 · 3b15f68e19c28a76d175f61943a8c23224afce93 to < 7347bd55fdc61db467400439a038a38ff69bc041 · 3b15f68e19c28a76d175f61943a8c23224afce93 to < 5dfb45a44264484dd6cdb82c8e9bdefd4d091842 · 3b15f68e19c28a76d175f61943a8c23224afce93 to < 8a2486fbd2fb552a89adbfe7bd4e4437f9bdb1f7 · 3b15f68e19c28a76d175f61943a8c23224afce93 to < 563dfdc969c1bf63e4ace17a53aaaedd59595a01 · 3b15f68e19c28a76d175f61943a8c23224afce93 to < 855012e5e1bb64b7f7e50422c02b2ebdcd872657 · 3b15f68e19c28a76d175f61943a8c23224afce93 to < b6f62366bc014a3a20fa0a3c42e51cadd198fb41 · 3b15f68e19c28a76d175f61943a8c23224afce93 to < c657eb609197e289b054bc2c4e86a0fc32dd7ebe · Other versions: unaffected | Affected | Not stated | Linux |
| Linux | — | Linux5.1 (affected) · 0 to < 5.1 (unaffected · semver) · 5.10.275 through 5.10.* (unaffected · semver) · 5.15.226 through 5.15.* (unaffected · semver) · 6.1.193 through 6.1.* (unaffected · semver) · 6.6.163 through 6.6.* (unaffected · semver) · 6.12.117 through 6.12.* (unaffected · semver) · 6.18.63 through 6.18.* (unaffected · semver) · 7.3.4 through 7.3.* (unaffected · semver) · 7.4-rc1 and later (unaffected · original_commit_for_fix) · Other versions: affected | Version-specific | Not stated | Linux |
| Amazon Linux | AL2 | Release evaluation | Not Affected | Not required | Amazon Linux assessment |
| Amazon Linux | AL2023 | Release evaluation | Not Affected | Not required | Amazon Linux assessment |
Description
In the Linux kernel, the following vulnerability has been resolved: media: vicodec: fix NULL deref on oversized frame job_ready() only honours the is_header_valid() verdict when ctx->comp_has_frame is set, and comp_has_frame is only set once comp_size reaches the full frame size. Since the copy is clamped to ctx->comp_max_size, a header advertising a larger size leaves comp_size stuck at comp_max_size, so comp_has_frame stays false and the failed validation is discarded. Control then falls into the resolution change branch, which calls update_capture_data_from_header(). That function re-derives info via info_from_header(), assigns it to q_dst->info and dereferences it as q_dst->info->sizeimage_mult, with no NULL check of its own. is_header_valid() does check that same info_from_header() result -- if (!info) return false which is precisely the false verdict job_ready() discarded above. info_from_header() returns NULL whenever the header flags resolve to no supported pixel format. Drop the comp_has_frame conjunct so an invalid header always bails out. The resolution change path is unaffected, as it is entered with a valid header. Oversized frames are then rejected by device_process(), which already returns -EINVAL when comp_frame_size exceeds comp_max_size.
Related advisories
Vendor advisories explicitly linked to this CVE.
No linked advisories were found for this CVE.
Assessment
CVSS risk assessment and additional context for this vulnerability.
- CVSS version
- 3.1
- Base score
- 7.8 / 10
- Severity
- high
- Provider
- Linux · cna
- Vector string
- CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
- Scenarios
- en: AV:L - The crafted fwht_cframe_hdr arrives in a buffer queued with VIDIOC_QBUF on the vicodec stateful-decoder /dev/videoN OUTPUT queue, and job_ready() runs from v4l2_m2m_try_schedule() inside that ioctl. FWHT is a test-only format that no network service feeds into vicodec, so this is local only. AC:L - The attacker writes the header: a size field above comp_max_size keeps comp_size short of the frame size, so comp_has_frame stays false and job_ready() ignores the failed is_header_valid() check every time. No race or memory-layout dependence; the ioctl sequence is deterministic. PR:L - vicodec_open() and the m2m QBUF/STREAMON/REQBUFS ioctls check no capabilities. Any local user who can open the decoder node (video group or logind uaccess ACL) can trigger it once the vicodec test module has been loaded. UI:N - The attacking process opens the decoder node, queues its own crafted FWHT stream and starts streaming itself; no other user has to do anything. S:U - The crash or memory corruption stays inside the kernel's own security authority; no VM, IOMMU or sandbox boundary is crossed. C:H - The ignored check is also the only MIN/MAX width and height check, so update_capture_data_from_header() copies unchecked dimensions into q_dst. After the capture restart, vicodec_start_streaming() sizes ref_frame with 32-bit multiplications that overflow, while decode_plane() loops over the full dimensions and reads ref_frame out of bounds. I:H - With buffers undersized by that overflow, fwht_decode_frame()/decode_plane() write attacker-chosen pixel blocks past the vmalloc'd capture plane, an out-of-bounds kernel write. The NULL q_dst->info deref the commit names is only the simplest outcome of the ignored check. A:H - A header whose flags match no pixel format makes info_from_header() return NULL, and update_capture_data_from_header() dereferences q_dst->info->sizeimage_mult. The resulting oops happens with the m2m job_spinlock held and IRQs off, and any user with access to the node can repeat it.
Publisher product statements
Version ranges and default statuses as reported by each provider.
| Vendor | Product | Version status | Source |
|---|---|---|---|
| Linux | Linux | 3b15f68e19c28a76d175f61943a8c23224afce93 to < ed06bca3414b045dd29a0a5ca65e64e83e0b5373 (affected · git)3b15f68e19c28a76d175f61943a8c23224afce93 to < 7347bd55fdc61db467400439a038a38ff69bc041 (affected · git)3b15f68e19c28a76d175f61943a8c23224afce93 to < 5dfb45a44264484dd6cdb82c8e9bdefd4d091842 (affected · git)3b15f68e19c28a76d175f61943a8c23224afce93 to < 8a2486fbd2fb552a89adbfe7bd4e4437f9bdb1f7 (affected · git)3b15f68e19c28a76d175f61943a8c23224afce93 to < 563dfdc969c1bf63e4ace17a53aaaedd59595a01 (affected · git)3b15f68e19c28a76d175f61943a8c23224afce93 to < 855012e5e1bb64b7f7e50422c02b2ebdcd872657 (affected · git)3b15f68e19c28a76d175f61943a8c23224afce93 to < b6f62366bc014a3a20fa0a3c42e51cadd198fb41 (affected · git)3b15f68e19c28a76d175f61943a8c23224afce93 to < c657eb609197e289b054bc2c4e86a0fc32dd7ebe (affected · git)Default: unaffected | Linux · cna |
| Linux | Linux | 5.1 (affected)0 to < 5.1 (unaffected · semver)5.10.275 through 5.10.* (unaffected · semver)5.15.226 through 5.15.* (unaffected · semver)6.1.193 through 6.1.* (unaffected · semver)6.6.163 through 6.6.* (unaffected · semver)6.12.117 through 6.12.* (unaffected · semver)6.18.63 through 6.18.* (unaffected · semver)7.3.4 through 7.3.* (unaffected · semver)7.4-rc1 and later (unaffected · original_commit_for_fix)Default: affected | Linux · cna |
Weaknesses
0No weakness assertions.
References
8- https://git.kernel.org/stable/c/563dfdc969c1bf63e4ace17a53aaaedd59595a01
- https://git.kernel.org/stable/c/5dfb45a44264484dd6cdb82c8e9bdefd4d091842
- https://git.kernel.org/stable/c/7347bd55fdc61db467400439a038a38ff69bc041
- https://git.kernel.org/stable/c/855012e5e1bb64b7f7e50422c02b2ebdcd872657
- https://git.kernel.org/stable/c/8a2486fbd2fb552a89adbfe7bd4e4437f9bdb1f7
- https://git.kernel.org/stable/c/b6f62366bc014a3a20fa0a3c42e51cadd198fb41
- https://git.kernel.org/stable/c/c657eb609197e289b054bc2c4e86a0fc32dd7ebe
- https://git.kernel.org/stable/c/ed06bca3414b045dd29a0a5ca65e64e83e0b5373
Provider assertions
1Linux · cna
media: vicodec: fix NULL deref on oversized frame
Provenance
- Schema
- 5.2
- Searchable
- yes
- Content hash
- e5acdd87287b4da750392a32feaa7fce814ba0e891606d275acdc4bfb9052bb8
- Ingested
- 01 Dec 2026, 05:47:22 UTC
- Source record
- Official CVE record