Skip to main content

CVE-2021-47436: Vulnerability in Linux Linux

Medium
VulnerabilityCVE-2021-47436cvecve-2021-47436
Published: Wed May 22 2024 (05/22/2024, 06:19:32 UTC)
Source: CVE
Vendor/Project: Linux
Product: Linux

Description

In the Linux kernel, the following vulnerability has been resolved: usb: musb: dsps: Fix the probe error path Commit 7c75bde329d7 ("usb: musb: musb_dsps: request_irq() after initializing musb") has inverted the calls to dsps_setup_optional_vbus_irq() and dsps_create_musb_pdev() without updating correctly the error path. dsps_create_musb_pdev() allocates and registers a new platform device which must be unregistered and freed with platform_device_unregister(), and this is missing upon dsps_setup_optional_vbus_irq() error. While on the master branch it seems not to trigger any issue, I observed a kernel crash because of a NULL pointer dereference with a v5.10.70 stable kernel where the patch mentioned above was backported. With this kernel version, -EPROBE_DEFER is returned the first time dsps_setup_optional_vbus_irq() is called which triggers the probe to error out without unregistering the platform device. Unfortunately, on the Beagle Bone Black Wireless, the platform device still living in the system is being used by the USB Ethernet gadget driver, which during the boot phase triggers the crash. My limited knowledge of the musb world prevents me to revert this commit which was sent to silence a robot warning which, as far as I understand, does not make sense. The goal of this patch was to prevent an IRQ to fire before the platform device being registered. I think this cannot ever happen due to the fact that enabling the interrupts is done by the ->enable() callback of the platform musb device, and this platform device must be already registered in order for the core or any other user to use this callback. Hence, I decided to fix the error path, which might prevent future errors on mainline kernels while also fixing older ones.

AI-Powered Analysis

AILast updated: 06/28/2025, 05:10:36 UTC

Technical Analysis

CVE-2021-47436 is a vulnerability in the Linux kernel's USB subsystem, specifically within the musb (Mentor USB) driver related to the dsps (Dual-role USB controller) component. The issue arises from an incorrect error handling path introduced by commit 7c75bde329d7, which inverted the order of calls to dsps_setup_optional_vbus_irq() and dsps_create_musb_pdev() without properly updating the error cleanup logic. The dsps_create_musb_pdev() function allocates and registers a platform device that must be unregistered and freed if an error occurs. However, in the flawed code path, this cleanup is missing when dsps_setup_optional_vbus_irq() returns an error, leading to a dangling platform device. This situation can cause a NULL pointer dereference and kernel crash, as observed on the Beagle Bone Black Wireless device running a backported v5.10.70 stable kernel. The root cause is that the platform device remains registered despite the probe failure, and the USB Ethernet gadget driver attempts to use this stale device during boot, triggering the crash. The vulnerability does not appear to be exploitable on the mainline kernel due to differences in the probe behavior but affects certain stable kernel versions with backported patches. The fix involves correcting the error path to ensure proper unregistration of the platform device on failure, preventing the kernel crash and potential system instability. This vulnerability is a logic error in kernel driver resource management rather than a direct security exploit vector but can cause denial of service through kernel crashes.

Potential Impact

For European organizations, the primary impact of CVE-2021-47436 is the risk of system instability and denial of service (DoS) on devices running affected Linux kernel versions, particularly embedded systems or specialized hardware like the Beagle Bone Black Wireless that use the musb USB controller driver. This can disrupt operations relying on USB Ethernet gadgets or other USB functionalities tied to the musb driver. While this vulnerability does not directly lead to privilege escalation or data breaches, the resulting kernel crashes can cause downtime, loss of availability, and potential disruption of critical services. Organizations using embedded Linux devices in industrial control systems, IoT deployments, or network appliances that rely on affected kernel versions may experience unexpected reboots or failures. This could impact sectors such as manufacturing, telecommunications, and critical infrastructure where embedded Linux is prevalent. The lack of known exploits in the wild reduces immediate risk, but unpatched systems remain vulnerable to accidental crashes or targeted DoS attempts by adversaries with local access.

Mitigation Recommendations

European organizations should take the following specific steps to mitigate CVE-2021-47436: 1) Identify all devices and systems running affected Linux kernel versions, especially those using the musb USB controller driver, including embedded devices and IoT hardware. 2) Apply the official Linux kernel patches that fix the error path in the musb_dsps driver as soon as they become available or upgrade to a kernel version where this issue is resolved. 3) For devices where kernel upgrades are not feasible, consider disabling or limiting the use of the musb USB Ethernet gadget functionality if it is not required, to reduce exposure. 4) Implement monitoring for kernel crashes and system instability that could indicate this issue is being triggered. 5) Engage with hardware vendors and embedded system suppliers to ensure they provide updated firmware or kernel versions addressing this vulnerability. 6) For critical infrastructure, establish redundancy and failover mechanisms to minimize impact from potential device crashes. 7) Educate system administrators about the symptoms of this vulnerability and the importance of timely patching in embedded Linux environments.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
Linux
Date Reserved
2024-05-21T14:58:30.830Z
Cisa Enriched
true
Cvss Version
null
State
PUBLISHED

Threat ID: 682d9822c4522896dcbde0df

Added to database: 5/21/2025, 9:08:50 AM

Last enriched: 6/28/2025, 5:10:36 AM

Last updated: 7/31/2025, 3:21:35 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