CVE-2025-21661 gpio: virtuser: fix missing lookup table cleanups
A memory leak in the Linux kernel's gpio virtuser driver can lead to resource exhaustion and denial of service.
- 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-21661?
CVE-2025-21661 is a high-severity memory corruption vulnerability in Linux kernel, published on 21 Jan 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:
gpio: virtuser: fix missing lookup table cleanups
When a virtuser device is created via configfs and the probe fails due to an incorrect lookup table, the table is not removed. This prevents subsequent probe attempts from succeeding, even if the issue is corrected, unless the device is released. Additionally, cleanup is also needed in the less likely case of platform_device_register_full() failure.
Besides, a consistent memory leak in lookup_table->dev_id was spotted using kmemleak by toggling the live state between 0 and 1 with a correct lookup table.
Introduce gpio_virtuser_remove_lookup_table() as the counterpart to the existing gpio_virtuser_make_lookup_table() and call it from all necessary points to ensure proper cleanup.
Weakness: CWE-401
Which versions are affected by CVE-2025-21661?
It affects 1 product.
Products include Linux kernel.
How do I fix CVE-2025-21661?
Apply the vendor's patch.
Upgrade to the fixed version. Memory-safe languages, compiler hardening and fuzzing prevent most new cases. More about Memory corruption.
Is CVE-2025-21661 being exploited?
There is no known exploitation of CVE-2025-21661 in the wild and no public exploit code.
Other vulnerabilities in Linux kernel
Sources
Also known as BELL-CVE-2025-21661, DEBIAN-CVE-2025-21661, GHSA-h85x-rxvw-x49j, UBUNTU-CVE-2025-21661.