CVE-2021-47351 in Linuxinfo

Summary

by MITRE • 05/21/2024

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

ubifs: Fix races between xattr_{set|get} and listxattr operations

UBIFS may occur some problems with concurrent xattr_{set|get} and
listxattr operations, such as assertion failure, memory corruption, stale xattr value[1].

Fix it by importing a new rw-lock in @ubifs_inode to serilize write operations on xattr, concurrent read operations are still effective, just like ext4.

[1] https://lore.kernel.org/linux-mtd/[email protected]

Be aware that VulDB is the high quality source for vulnerability data.

Analysis

by VulDB Data Team • 08/07/2026

The vulnerability CVE-2021-47351 addresses a critical race condition within the UBIFS (Unsorted Block Images File System) implementation in the Linux kernel. This flaw specifically affects concurrent operations involving extended attributes, which are metadata entries that provide additional information about files and directories beyond standard file attributes. The issue manifests when simultaneous execution of xattr_set, xattr_get, and listxattr operations occurs, creating potential for system instability and data corruption. The race condition arises from insufficient synchronization mechanisms within the UBIFS filesystem implementation, particularly in how it handles extended attribute operations on inode structures.

The technical root cause of this vulnerability lies in the lack of proper serialization for write operations on extended attributes within the UBIFS filesystem. When multiple processes attempt to modify or access extended attributes concurrently, the absence of adequate locking mechanisms leads to inconsistent state management. The vulnerability allows for assertion failures that can cause kernel panics, memory corruption that may result in system crashes, and stale extended attribute values that provide incorrect metadata to applications. This type of race condition falls under CWE-362, which specifically addresses Race Conditions, and represents a classic example of improper synchronization in concurrent programming contexts. The flaw demonstrates poor resource management where shared data structures are accessed without proper mutual exclusion protocols.

The operational impact of this vulnerability extends beyond simple system crashes to potentially compromise data integrity and system availability. When concurrent extended attribute operations occur, the filesystem may return corrupted or stale data to applications, leading to incorrect behavior in security-sensitive contexts where extended attributes are used for access control lists, file permissions, or other security-related metadata. Attackers could potentially exploit this race condition to gain unauthorized access to files or manipulate extended attribute values, creating persistent security vulnerabilities. The vulnerability affects systems running Linux kernel versions where UBIFS is actively used, particularly embedded systems, network-attached storage devices, and other environments where UBIFS serves as the primary filesystem. From an ATT&CK perspective, this vulnerability relates to T1547.001 (Registry Run Keys / Startup Folder) and T1068 (Exploitation for Privilege Escalation) as it could enable attackers to manipulate filesystem metadata and potentially escalate privileges through compromised extended attribute handling.

The fix implemented for CVE-2021-47351 involves introducing a new read-write lock mechanism within the ubifs_inode structure to properly serialize write operations on extended attributes while maintaining concurrent read capabilities. This approach mirrors the design pattern used in ext4 filesystem implementation, where read operations can proceed concurrently while write operations are properly synchronized. The solution ensures that when multiple processes attempt to modify extended attributes simultaneously, only one write operation proceeds at a time, preventing data corruption and maintaining filesystem consistency. The rw-lock implementation allows for multiple readers to access extended attribute data concurrently, which improves performance while ensuring data integrity. This fix addresses the fundamental synchronization issue without significantly impacting system performance for legitimate read-heavy workloads. The mitigation strategy aligns with best practices for concurrent programming and follows established kernel development patterns for handling shared resource access in filesystem implementations.

Reservation

05/21/2024

Disclosure

05/21/2024

Moderation

accepted

CPE

ready

EPSS

0.00245

KEV

no

Activities

very low

Sources

Interested in the pricing of exploits?

See the underground prices here!