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

High 7.8 Published Updated

A use-after-free vulnerability in the Linux kernel's videobuf2 subsystem allows attackers to corrupt memory and potentially execute code or escalate privileges.

Exploited in the wild
Not known
Login needed
Any signed-in user
Attackable
Local or same network only
Victim action needed
Not needed
Fix
Available

What is CVE-2025-40302?

CVE-2025-40302 is a high-severity use after free vulnerability in Linux, published on 8 Dec 2025. It can only be exploited from the same machine or local network, with no action from the victim.

Official 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.

Which versions are affected by CVE-2025-40302?

How do I fix CVE-2025-40302?

Apply the vendor's patch.

Upgrade to the fixed version. These bugs are found with fuzzing and sanitisers and avoided by memory-safe languages. More about Use after free.

Is CVE-2025-40302 being exploited?

There is no known exploitation of CVE-2025-40302 in the wild and no public exploit code.

Sources

Also known as BELL-CVE-2025-40302, DEBIAN-CVE-2025-40302, GHSA-wxf8-j2xw-xgh9, ROOT-OS-DEBIAN-13-CVE-2025-40302, UBUNTU-CVE-2025-40302.

Is CVE-2025-40302 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free