CVE-2026-43181 gpio: sysfs: fix chip removal with GPIOs exported over sysfs

Medium 5.5 Published Updated

A use-after-free vulnerability in the Linux kernel GPIO subsystem allows attackers to cause a denial of service or potentially execute code by unbinding a GPIO controller while sysfs exports are active.

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-2026-43181?

CVE-2026-43181 is a medium-severity use after free vulnerability in Linux kernel, published on 6 May 2026. 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: sysfs: fix chip removal with GPIOs exported over sysfs

Currently if we export a GPIO over sysfs and unbind the parent GPIO controller, the exported attribute will remain under /sys/class/gpio because once we remove the parent device, we can no longer associate the descriptor with it in gpiod_unexport() and never drop the final reference.

Rework the teardown code: provide an unlocked variant of gpiod_unexport() and remove all exported GPIOs with the sysfs_lock taken before unregistering the parent device itself. This is done to prevent any new exports happening before we unregister the device completely.

Which versions are affected by CVE-2026-43181?

It affects 1 product.

Products include Linux kernel.

How do I fix CVE-2026-43181?

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-2026-43181 being exploited?

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

All Linux kernel vulnerabilities

Sources

Also known as BELL-CVE-2026-43181, DEBIAN-CVE-2026-43181, GHSA-gvr9-3x96-5w99, UBUNTU-CVE-2026-43181.

Is CVE-2026-43181 in your software?

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

Check your SBOMs for free