{"id":"CVE-2026-139041","summary":"media: vicodec: make encoder CAPTURE dimensions read-only","details":"In the Linux kernel, the following vulnerability has been resolved:\n\nmedia: vicodec: make encoder CAPTURE dimensions read-only\n\nSetting the encoder's compressed CAPTURE format to a smaller resolution\nthan the raw OUTPUT format makes the encoder write past the end of the\nCAPTURE buffer.\n\nFor a stateful encoder the CAPTURE width and height are not\nclient-settable; Documentation/userspace-api/media/v4l/dev-encoder.rst\nspecifies them as \"ignored (read-only)\" on VIDIOC_S_FMT. vicodec only\nimplements half of that: vidioc_s_fmt_vid_out() derives the CAPTURE coded\nsize and sizeimage from the OUTPUT format, but S_FMT on the CAPTURE queue\noverwrites them. The encoder then takes its geometry from the OUTPUT\nqueue alone, and v4l2_fwht_encode() gets no destination length.\n\nOverwrite the requested width and height with the OUTPUT queue's coded\ndimensions in vidioc_try_fmt_vid_cap(), making them read-only as the\ninterface requires.","modified":"2026-12-01T21:02:36.058884092Z","published":"2026-11-30T13:27:19.257Z","database_specific":{"cna_assigner":"Linux","osv_generated_from":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/139xxx/CVE-2026-139041.json"},"references":[{"type":"WEB","url":"https://git.kernel.org/stable/c/2373c6da34cd39ba58b3c1cf87cd32752bfa1612"},{"type":"WEB","url":"https://git.kernel.org/stable/c/2532e9d2f8ccb330a9c924b1ee34c5629240d352"},{"type":"WEB","url":"https://git.kernel.org/stable/c/30fbc161c40c28f46f780f4222dbc8966d85af7c"},{"type":"WEB","url":"https://git.kernel.org/stable/c/3ba760923c0846e3ea2ab811d19d2ca29bf5b118"},{"type":"WEB","url":"https://git.kernel.org/stable/c/69ae6d7be0d67ecdedbea49a658d284cb6035495"},{"type":"WEB","url":"https://git.kernel.org/stable/c/72b9c63beb0151c917bdc538daaefb636f442b17"},{"type":"WEB","url":"https://git.kernel.org/stable/c/ae0ced91c40cbe86a5f5fc196f02df6d85aee77d"},{"type":"WEB","url":"https://git.kernel.org/stable/c/f4bb5d4f446b6ae00a954003a0d9b7797a1b4197"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/139xxx/CVE-2026-139041.json"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-139041"},{"type":"PACKAGE","url":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"}],"affected":[{"ranges":[{"type":"GIT","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","events":[{"introduced":"efec9c815e5da15fe671fe7b3a0ea5575067b4b5"},{"fixed":"69ae6d7be0d67ecdedbea49a658d284cb6035495"},{"fixed":"30fbc161c40c28f46f780f4222dbc8966d85af7c"},{"fixed":"2373c6da34cd39ba58b3c1cf87cd32752bfa1612"},{"fixed":"ae0ced91c40cbe86a5f5fc196f02df6d85aee77d"},{"fixed":"3ba760923c0846e3ea2ab811d19d2ca29bf5b118"},{"fixed":"72b9c63beb0151c917bdc538daaefb636f442b17"},{"fixed":"f4bb5d4f446b6ae00a954003a0d9b7797a1b4197"},{"fixed":"2532e9d2f8ccb330a9c924b1ee34c5629240d352"}]}],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-139041.json"}},{"package":{"name":"Kernel","ecosystem":"Linux"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"5.3.0"},{"fixed":"5.10.275"}]},{"type":"ECOSYSTEM","events":[{"introduced":"5.11.0"},{"fixed":"5.15.226"}]},{"type":"ECOSYSTEM","events":[{"introduced":"5.16.0"},{"fixed":"6.1.193"}]},{"type":"ECOSYSTEM","events":[{"introduced":"6.2.0"},{"fixed":"6.6.163"}]},{"type":"ECOSYSTEM","events":[{"introduced":"6.7.0"},{"fixed":"6.12.117"}]},{"type":"ECOSYSTEM","events":[{"introduced":"6.13.0"},{"fixed":"6.18.63"}]},{"type":"ECOSYSTEM","events":[{"introduced":"6.19.0"},{"fixed":"7.3.4"}]}],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-139041.json"}}],"schema_version":"1.9.2"}