Skip to main content

CVE-2021-47637: Vulnerability in Linux Linux

High
VulnerabilityCVE-2021-47637cvecve-2021-47637
Published: Wed Feb 26 2025 (02/26/2025, 01:54:10 UTC)
Source: CVE
Vendor/Project: Linux
Product: Linux

Description

In the Linux kernel, the following vulnerability has been resolved: ubifs: Fix deadlock in concurrent rename whiteout and inode writeback Following hung tasks: [ 77.028764] task:kworker/u8:4 state:D stack: 0 pid: 132 [ 77.028820] Call Trace: [ 77.029027] schedule+0x8c/0x1b0 [ 77.029067] mutex_lock+0x50/0x60 [ 77.029074] ubifs_write_inode+0x68/0x1f0 [ubifs] [ 77.029117] __writeback_single_inode+0x43c/0x570 [ 77.029128] writeback_sb_inodes+0x259/0x740 [ 77.029148] wb_writeback+0x107/0x4d0 [ 77.029163] wb_workfn+0x162/0x7b0 [ 92.390442] task:aa state:D stack: 0 pid: 1506 [ 92.390448] Call Trace: [ 92.390458] schedule+0x8c/0x1b0 [ 92.390461] wb_wait_for_completion+0x82/0xd0 [ 92.390469] __writeback_inodes_sb_nr+0xb2/0x110 [ 92.390472] writeback_inodes_sb_nr+0x14/0x20 [ 92.390476] ubifs_budget_space+0x705/0xdd0 [ubifs] [ 92.390503] do_rename.cold+0x7f/0x187 [ubifs] [ 92.390549] ubifs_rename+0x8b/0x180 [ubifs] [ 92.390571] vfs_rename+0xdb2/0x1170 [ 92.390580] do_renameat2+0x554/0x770 , are caused by concurrent rename whiteout and inode writeback processes: rename_whiteout(Thread 1) wb_workfn(Thread2) ubifs_rename do_rename lock_4_inodes (Hold ui_mutex) ubifs_budget_space make_free_space shrink_liability __writeback_inodes_sb_nr bdi_split_work_to_wbs (Queue new wb work) wb_do_writeback(wb work) __writeback_single_inode ubifs_write_inode LOCK(ui_mutex) ↑ wb_wait_for_completion (Wait wb work) <-- deadlock! Reproducer (Detail program in [Link]): 1. SYS_renameat2("/mp/dir/file", "/mp/dir/whiteout", RENAME_WHITEOUT) 2. Consume out of space before kernel(mdelay) doing budget for whiteout Fix it by doing whiteout space budget before locking ubifs inodes. BTW, it also fixes wrong goto tag 'out_release' in whiteout budget error handling path(It should at least recover dir i_size and unlock 4 ubifs inodes).

AI-Powered Analysis

AILast updated: 06/30/2025, 15:41:23 UTC

Technical Analysis

CVE-2021-47637 is a concurrency-related vulnerability in the Linux kernel's UBIFS (UBI File System) implementation. The flaw arises from a deadlock condition triggered by concurrent execution of rename whiteout operations and inode writeback processes. Specifically, the deadlock occurs when the kernel attempts to perform a rename operation with the RENAME_WHITEOUT flag, which is used to mark files as deleted in overlay or union filesystems, while simultaneously handling inode writeback tasks that flush modified inodes to persistent storage. The root cause is a locking order inversion involving the UI mutex (a mutex protecting UBIFS inode structures) and the writeback work queue. During the rename whiteout, the kernel locks multiple inodes and budgets space for the whiteout operation. Meanwhile, the writeback worker thread attempts to write back inodes and acquire the same mutex, leading to a circular wait and deadlock. The vulnerability can cause kernel tasks to hang indefinitely, resulting in system unresponsiveness or degraded performance. The fix involves reordering operations to perform whiteout space budgeting before locking UBIFS inodes, preventing the deadlock scenario. Additionally, the patch corrects error handling paths to ensure proper inode unlocking and directory size recovery. This vulnerability affects Linux kernel versions containing the specified commit hashes prior to the fix and is relevant to systems using the UBIFS filesystem, commonly deployed on flash storage devices in embedded systems and IoT devices. No known exploits are reported in the wild, and no CVSS score has been assigned yet.

Potential Impact

For European organizations, the impact of CVE-2021-47637 depends largely on the deployment of Linux systems utilizing the UBIFS filesystem, which is prevalent in embedded devices, industrial control systems, and IoT infrastructure. Organizations operating critical infrastructure, manufacturing plants, or telecommunications equipment that rely on embedded Linux devices with UBIFS may experience system hangs or degraded availability due to deadlocks triggered by this vulnerability. This can lead to operational disruptions, potential data loss if systems become unresponsive during critical write operations, and increased maintenance costs. While the vulnerability does not directly enable privilege escalation or data leakage, the denial-of-service-like effect can impact service continuity. Given the increasing adoption of Linux-based embedded systems in European industries, especially in sectors like automotive, energy, and manufacturing, the risk is non-negligible. However, general-purpose Linux servers and desktops that do not use UBIFS are not affected. The absence of known exploits reduces immediate risk, but unpatched systems remain vulnerable to accidental or malicious triggering of the deadlock, potentially by local users or automated processes.

Mitigation Recommendations

1. Apply the official Linux kernel patches that fix CVE-2021-47637 as soon as they become available from trusted sources or Linux distribution vendors. 2. Identify and inventory all devices and systems running Linux kernels with UBIFS support, focusing on embedded and IoT devices within the organization. 3. For embedded devices where kernel upgrades are challenging, consider firmware updates or vendor-provided patches that address this issue. 4. Implement monitoring for kernel task hangs or system unresponsiveness that could indicate deadlock conditions, enabling rapid detection and remediation. 5. Limit or control the use of rename whiteout operations on affected systems, if feasible, to reduce the likelihood of triggering the deadlock. 6. Employ robust backup and recovery procedures for embedded devices to minimize downtime in case of system hangs. 7. Engage with device vendors to confirm patch availability and deployment plans for affected hardware. 8. Where possible, isolate critical embedded systems from untrusted networks to reduce the risk of remote triggering of the vulnerability.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
Linux
Date Reserved
2025-02-26T01:48:21.519Z
Cisa Enriched
false
Cvss Version
null
State
PUBLISHED

Threat ID: 682d9834c4522896dcbe9625

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

Last enriched: 6/30/2025, 3:41:23 PM

Last updated: 8/2/2025, 10:07:59 PM

Views: 15

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