Skip to main content

CVE-2025-21943: Vulnerability in Linux Linux

High
VulnerabilityCVE-2025-21943cvecve-2025-21943
Published: Tue Apr 01 2025 (04/01/2025, 15:41:07 UTC)
Source: CVE
Vendor/Project: Linux
Product: Linux

Description

In the Linux kernel, the following vulnerability has been resolved: gpio: aggregator: protect driver attr handlers against module unload Both new_device_store and delete_device_store touch module global resources (e.g. gpio_aggregator_lock). To prevent race conditions with module unload, a reference needs to be held. Add try_module_get() in these handlers. For new_device_store, this eliminates what appears to be the most dangerous scenario: if an id is allocated from gpio_aggregator_idr but platform_device_register 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/new_device 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 ]------------ list_del corruption, ffff888103e2e980->next is LIST_POISON1 (dead000000000100) WARNING: CPU: 1 PID: 1327 at lib/list_debug.c:56 __list_del_entry_valid_or_report+0xa3/0x120 [...] RIP: 0010:__list_del_entry_valid_or_report+0xa3/0x120 [...] Call Trace: <TASK> ? __list_del_entry_valid_or_report+0xa3/0x120 ? __warn.cold+0x93/0xf2 ? __list_del_entry_valid_or_report+0xa3/0x120 ? report_bug+0xe6/0x170 ? __irq_work_queue_local+0x39/0xe0 ? handle_bug+0x58/0x90 ? exc_invalid_op+0x13/0x60 ? asm_exc_invalid_op+0x16/0x20 ? __list_del_entry_valid_or_report+0xa3/0x120 gpiod_remove_lookup_table+0x22/0x60 new_device_store+0x315/0x350 [gpio_aggregator] kernfs_fop_write_iter+0x137/0x1f0 vfs_write+0x262/0x430 ksys_write+0x60/0xd0 do_syscall_64+0x6c/0x180 entry_SYSCALL_64_after_hwframe+0x76/0x7e [...] </TASK> ---[ end trace 0000000000000000 ]---

AI-Powered Analysis

AILast updated: 06/30/2025, 10:57:33 UTC

Technical Analysis

CVE-2025-21943 is a vulnerability identified in the Linux kernel's gpio-aggregator driver, specifically related to the handling of driver attribute handlers during module unload operations. The vulnerability arises because the functions new_device_store and delete_device_store access global module resources such as gpio_aggregator_lock without properly holding a reference to the module, leading to potential race conditions when the module is unloaded concurrently. This race condition can cause the failure to unregister or delete platform devices correctly, resulting in dangling platform devices or GPIO forwarders. Such dangling references can lead to system instability, including memory corruption and kernel warnings, as demonstrated by the provided reproducer script that rapidly writes to the new_device attribute while concurrently loading and unloading the gpio-aggregator module. The kernel logs show list_del corruption and warnings indicating invalid list operations, which can escalate to kernel panics or undefined behavior. The fix involves adding try_module_get() calls in the affected handlers to ensure the module reference count is incremented, preventing unload during critical operations. This vulnerability affects Linux kernel versions identified by the commit hash 828546e24280f721350a7a0dcc92416e917b4382 and likely other versions containing the same code pattern. No known exploits are currently reported in the wild, and no CVSS score has been assigned yet.

Potential Impact

For European organizations, this vulnerability poses a risk primarily to systems running Linux kernels with the affected gpio-aggregator driver, which is common in embedded systems, industrial control systems, IoT devices, and servers using GPIO for hardware interfacing. Exploitation could lead to system instability, crashes, or denial of service due to kernel memory corruption or race conditions during module unload. This can disrupt critical infrastructure operations, manufacturing processes, or any service relying on stable Linux-based hardware control. Although exploitation requires local access and concurrent module manipulation, attackers with privileged access or the ability to execute scripts on affected systems could trigger these conditions. The impact on confidentiality and integrity is limited as the vulnerability mainly affects availability and system stability. However, in environments where uptime and reliability are critical, such as telecommunications, energy, or transportation sectors prevalent in Europe, the consequences could be significant. Additionally, the instability could be leveraged as part of a broader attack chain to escalate privileges or disrupt services.

Mitigation Recommendations

European organizations should ensure that their Linux kernel versions are updated to include the patch that adds try_module_get() calls in the gpio-aggregator driver's new_device_store and delete_device_store handlers. Since no official patch links are provided, organizations should monitor Linux kernel mailing lists and repositories for the relevant commits and apply them promptly. System administrators should audit systems for usage of the gpio-aggregator module and assess whether it is necessary; if not, consider disabling or blacklisting the module to reduce attack surface. For embedded and IoT devices, firmware updates incorporating the patched kernel should be deployed. Additionally, restricting local user access and enforcing strict privilege separation can reduce the risk of exploitation. Monitoring kernel logs for warnings related to list_del corruption or gpio-aggregator activity can help detect attempted exploitation or instability. Finally, implementing robust testing and validation of kernel modules during system updates can prevent regressions and ensure stability.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
Linux
Date Reserved
2024-12-29T08:45:45.789Z
Cisa Enriched
false
Cvss Version
null
State
PUBLISHED

Threat ID: 682d9833c4522896dcbe8c79

Added to database: 5/21/2025, 9:09:07 AM

Last enriched: 6/30/2025, 10:57:33 AM

Last updated: 8/11/2025, 12:52:49 AM

Views: 14

Actions

PRO

Updates to AI analysis are available only with a Pro account. Contact root@offseq.com for access.

Please log in to the Console to use AI analysis features.

Need enhanced features?

Contact root@offseq.com for Pro access with improved analysis and higher rate limits.

Latest Threats