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.
Published: 2026-05-27
Score: n/a
EPSS: n/a
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

A race condition exists in the Linux kernel power subsystem where the power supply device allocator deallocates its handle before the interrupt line is unregistered during removal, or may use an uninitialized handle during probe. The resulting use‑after‑free causes the interrupt routine to call power_supply_changed() with a dangling reference, which typically leads to a kernel crash or silent memory corruption that can render the system non‑operational. The flaw falls under the well‑known kernel misuse category of use‑after‑free (CWE‑416).

Affected Systems

All Linux kernel releases that include the cpcap‑battery power supply driver are affected; no explicit version boundaries are provided, so any kernel where this driver follows the described allocation order is vulnerable unless superseded by the fix.

Risk and Exploitability

Based on the description, it is inferred that the attack requires a local user to trigger device removal or probe while an IRQ is pending—implying local privilege or kernel module manipulation is necessary. The CVSS score is not supplied, the EPSS is unavailable, and the vulnerability is not listed in the CISA KEV catalog. Even though the risk remains limited to systems that load the affected driver, a local privilege holder could exploit the flaw to crash the system or corrupt memory, potentially leading to further exploitation if memory corruption is leveraged.

Generated by OpenCVE AI on May 27, 2026 at 19:05 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Apply the latest Linux kernel version that includes the cpcap‑battery use‑after‑free fix.
  • Reboot the system to ensure the patched driver is loaded and the old instance is fully unloaded.
  • If the cpcap‑battery driver is not required, disable it by removing the module or preventing the device from being loaded (e.g., via systemd masking or kernel boot parameters).

Generated by OpenCVE AI on May 27, 2026 at 19:05 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Wed, 27 May 2026 19:30:00 +0000

Type Values Removed Values Added
Weaknesses CWE-416

Wed, 27 May 2026 14:15:00 +0000

Type Values Removed Values Added
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.
Title power: supply: cpcap-battery: Fix use-after-free in power_supply_changed()
First Time appeared Linux
Linux linux Kernel
CPEs cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
Vendors & Products Linux
Linux linux Kernel
References

Subscriptions

Linux Linux Kernel
cve-icon MITRE

Status: PUBLISHED

Assigner: Linux

Published:

Updated: 2026-05-27T12:16:57.246Z

Reserved: 2026-05-13T15:03:33.082Z

Link: CVE-2026-45885

cve-icon Vulnrichment

No data.

cve-icon NVD

Status : Awaiting Analysis

Published: 2026-05-27T14:17:02.417

Modified: 2026-05-27T14:48:31.480

Link: CVE-2026-45885

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-05-27T19:15:26Z

Weaknesses