CVE-2026-45885 power: supply: cpcap-battery: Fix use-after-free in power_supply_changed()

High 7.8 Published Updated

A race condition in the cpcap-battery driver allows a use-after-free, potentially causing system crashes or memory corruption.

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-45885?

CVE-2026-45885 is a high-severity use after free vulnerability in Linux kernel, published on 27 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:

power: supply: cpcap-battery: Fix use-after-free in power_supply_changed()

Using the `devm_` variant for requesting IRQ _before_ the `devm_` variant for allocating/registering the `power_supply` handle, means that the `power_supply` handle will be deallocated/unregistered _before_ the interrupt handler (since `devm_` naturally deallocates in reverse allocation order). This means that during removal, there is a race condition where an interrupt can fire just _after_ the `power_supply` handle has been freed, *but* just _before_ the corresponding unregistration of the IRQ handler has run.

This will lead to the IRQ handler calling `power_supply_changed()` with a freed `power_supply` handle. Which usually crashes the system or otherwise silently corrupts the memory...

Note that there is a similar situation which can also happen during `probe()`; the possibility of an interrupt firing _before_ registering the `power_supply` handle. This would then lead to the nasty situation of using the `power_supply` handle *uninitialized* in `power_supply_changed()`.

Fix this racy use-after-free by making sure the IRQ is requested _after_ the registration of the `power_supply` handle.

Weakness: CWE-416

Which versions are affected by CVE-2026-45885?

It affects 1 product.

Products include Linux kernel.

How do I fix CVE-2026-45885?

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-45885 being exploited?

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

All Linux kernel vulnerabilities

Sources

Also known as BELL-CVE-2026-45885, DEBIAN-CVE-2026-45885, GHSA-pxv4-rwxf-m755, ROOT-OS-DEBIAN-11-CVE-2026-45885, ROOT-OS-UBUNTU-2204-CVE-2026-45885, ROOT-OS-UBUNTU-2404-CVE-2026-45885 and 1 more.

Is CVE-2026-45885 in your software?

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

Check your SBOMs for free