CVE-2025-21943: gpio: aggregator: protect driver attr handlers against module unload

Published Apr 1, 2025
·
Updated

In the Linux kernel, the following vulnerability has been resolved:

gpio: aggregator: protect driver attr handlers against module unload

Both newdevicestore and deletedevicestore touch module global resources (e.g. gpioaggregatorlock). To prevent race conditions with module unload, a reference needs to be held.

Add trymoduleget() in these handlers.

For newdevicestore, this eliminates what appears to be the most dangerous scenario: if an id is allocated from gpioaggregatoridr but platformdeviceregister has not yet been called or completed, a concurrent module unload could fail to unregister/delete the device, leaving behind a dangling platform device/GPIO forwarder. This can result in various issues. The following simple reproducer demonstrates these problems:

#!/bin/bash while :; do # note: whether 'gpiochip0 0' exists or not does not matter. echo 'gpiochip0 0' > /sys/bus/platform/drivers/gpio-aggregator/newdevice done & while :; do modprobe gpio-aggregator modprobe -r gpio-aggregator done & wait

Starting with the following warning, several kinds of warnings will appear and the system may become unstable:

------------[ cut here ]------------ listdel corruption, ffff888103e2e980->next is LISTPOISON1 (dead000000000100) WARNING: CPU: 1 PID: 1327 at lib/listdebug.c:56 listdelentryvalidorreport+0xa3/0x120 [...] RIP: 0010:listdelentryvalidorreport+0xa3/0x120 [...] Call Trace: <TASK> ? listdelentryvalidorreport+0xa3/0x120 ? warn.cold+0x93/0xf2 ? listdelentryvalidorreport+0xa3/0x120 ? reportbug+0xe6/0x170 ? irqworkqueuelocal+0x39/0xe0 ? handlebug+0x58/0x90 ? excinvalidop+0x13/0x60 ? asmexcinvalidop+0x16/0x20 ? listdelentryvalidorreport+0xa3/0x120 gpiodremovelookuptable+0x22/0x60 newdevicestore+0x315/0x350 [gpioaggregator] kernfsfopwriteiter+0x137/0x1f0 vfswrite+0x262/0x430 ksyswrite+0x60/0xd0 dosyscall64+0x6c/0x180 entrySYSCALL64afterhwframe+0x76/0x7e [...] </TASK> ---[ end trace 0000000000000000 ]---

Affected Software

13 affected componentsFixes available
Linux Linux kernel
Linux Linux kernel>=5.8<5.10.235
Linux Linux kernel>=5.11<5.15.179
Linux Linux kernel>=5.16<6.1.131
Linux Linux kernel>=6.2<6.6.83
Linux Linux kernel>=6.7<6.12.19
Linux Linux kernel>=6.13<6.13.7
Linux Linux kernel=6.14-rc1
Linux Linux kernel=6.14-rc2
Linux Linux kernel=6.14-rc3
Linux Linux kernel=6.14-rc4
Linux Linux kernel=6.14-rc5
debian/linux
6.1.176-16.1.190-16.12.107-16.12.115-27.2.12-17.2.15-1

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Configuration

    Add try_module_get() to both the new_device_store and delete_device_store handlers to protect their access to module-global state against module unload.

    gpio-aggregator module reference protection = try_module_get()

Event History

Apr 1, 2025
CVE Published
via MITRE·03:41 PM
Data Sourced
via MITRE·03:41 PM
Description
Data Sourced
via NVD·04:15 PM
RemedyDescriptionSeverityWeaknessAffected Software

Parent advisories

This vulnerability appears in the following advisories.

Peer vulnerabilities

Found alongside the following vulnerabilities.

Frequently Asked Questions

1

What is the severity of CVE-2025-21943?

The severity of CVE-2025-21943 has not been officially assigned, but it addresses a potential race condition in the Linux kernel.

2

How do I fix CVE-2025-21943?

To mitigate CVE-2025-21943, you should update your Linux kernel to the latest version that includes the patches for this vulnerability.

3

What systems are affected by CVE-2025-21943?

CVE-2025-21943 affects the Linux kernel, specifically versions vulnerable to the described race condition in the gpio aggregator.

4

What impact does CVE-2025-21943 have on system security?

CVE-2025-21943 can potentially lead to race conditions that might allow unauthorized access or exploitation by unprivileged users.

5

Is there a known exploit for CVE-2025-21943?

As of now, there are no public exploits specifically targeting CVE-2025-21943, but it is advisable to apply the patch promptly.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203