Skip to contentSkip to conversation

CVE-2025-40302: media: videobuf2: forbid remove_bufs when legacy fileio is active

DISCUSSION Greg Kroah-Hartman 1 participant 1 message Dec 8, 2025

lore
Share & tools
lore
#0 lore raw

From: Greg Kroah-Hartman <[email protected]>

Description
===========

In the Linux kernel, the following vulnerability has been resolved:

media: videobuf2: forbid remove_bufs when legacy fileio is active

vb2_ioctl_remove_bufs() call manipulates queue internal buffer list, potentially overwriting some pointers used by the legacy fileio access mode. Forbid that ioctl when fileio is active to protect internal queue state between subsequent read/write calls.

The Linux kernel CVE team has assigned CVE-2025-40302 to this issue.

Affected and fixed versions
===========================

	Issue introduced in 6.10 with commit a3293a85381ec9680aa2929547fbc76c5d87a1b2 and fixed in 6.12.58 with commit a6a493b985bfffac097a4e1be09f98b27729dca8
	Issue introduced in 6.10 with commit a3293a85381ec9680aa2929547fbc76c5d87a1b2 and fixed in 6.17.8 with commit e819b34df0a7030a15c968d619fa8a3ed2455c7a
	Issue introduced in 6.10 with commit a3293a85381ec9680aa2929547fbc76c5d87a1b2 and fixed in 6.18 with commit 27afd6e066cfd80ddbe22a4a11b99174ac89cced

Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community.

Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at

	https://cve.org/CVERecord/?id=CVE-2025-40302

will be updated if fixes are backported, please check that for the most up to date information about this issue.

Affected files
==============

The file(s) affected by this issue are:
drivers/media/common/videobuf2/videobuf2-v4l2.c

Mitigation
==========

The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits:

	https://git.kernel.org/stable/c/a6a493b985bfffac097a4e1be09f98b27729dca8
	https://git.kernel.org/stable/c/e819b34df0a7030a15c968d619fa8a3ed2455c7a
	https://git.kernel.org/stable/c/27afd6e066cfd80ddbe22a4a11b99174ac89cced