Skip to main content

CVE-2021-47212: Vulnerability in Linux Linux

Medium
VulnerabilityCVE-2021-47212cvecve-2021-47212
Published: Wed Apr 10 2024 (04/10/2024, 19:01:53 UTC)
Source: CVE
Vendor/Project: Linux
Product: Linux

Description

In the Linux kernel, the following vulnerability has been resolved: net/mlx5: Update error handler for UCTX and UMEM In the fast unload flow, the device state is set to internal error, which indicates that the driver started the destroy process. In this case, when a destroy command is being executed, it should return MLX5_CMD_STAT_OK. Fix MLX5_CMD_OP_DESTROY_UCTX and MLX5_CMD_OP_DESTROY_UMEM to return OK instead of EIO. This fixes a call trace in the umem release process - [ 2633.536695] Call Trace: [ 2633.537518] ib_uverbs_remove_one+0xc3/0x140 [ib_uverbs] [ 2633.538596] remove_client_context+0x8b/0xd0 [ib_core] [ 2633.539641] disable_device+0x8c/0x130 [ib_core] [ 2633.540615] __ib_unregister_device+0x35/0xa0 [ib_core] [ 2633.541640] ib_unregister_device+0x21/0x30 [ib_core] [ 2633.542663] __mlx5_ib_remove+0x38/0x90 [mlx5_ib] [ 2633.543640] auxiliary_bus_remove+0x1e/0x30 [auxiliary] [ 2633.544661] device_release_driver_internal+0x103/0x1f0 [ 2633.545679] bus_remove_device+0xf7/0x170 [ 2633.546640] device_del+0x181/0x410 [ 2633.547606] mlx5_rescan_drivers_locked.part.10+0x63/0x160 [mlx5_core] [ 2633.548777] mlx5_unregister_device+0x27/0x40 [mlx5_core] [ 2633.549841] mlx5_uninit_one+0x21/0xc0 [mlx5_core] [ 2633.550864] remove_one+0x69/0xe0 [mlx5_core] [ 2633.551819] pci_device_remove+0x3b/0xc0 [ 2633.552731] device_release_driver_internal+0x103/0x1f0 [ 2633.553746] unbind_store+0xf6/0x130 [ 2633.554657] kernfs_fop_write+0x116/0x190 [ 2633.555567] vfs_write+0xa5/0x1a0 [ 2633.556407] ksys_write+0x4f/0xb0 [ 2633.557233] do_syscall_64+0x5b/0x1a0 [ 2633.558071] entry_SYSCALL_64_after_hwframe+0x65/0xca [ 2633.559018] RIP: 0033:0x7f9977132648 [ 2633.559821] Code: 89 02 48 c7 c0 ff ff ff ff eb b3 0f 1f 80 00 00 00 00 f3 0f 1e fa 48 8d 05 55 6f 2d 00 8b 00 85 c0 75 17 b8 01 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 58 c3 0f 1f 80 00 00 00 00 41 54 49 89 d4 55 [ 2633.562332] RSP: 002b:00007fffb1a83888 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 [ 2633.563472] RAX: ffffffffffffffda RBX: 000000000000000c RCX: 00007f9977132648 [ 2633.564541] RDX: 000000000000000c RSI: 000055b90546e230 RDI: 0000000000000001 [ 2633.565596] RBP: 000055b90546e230 R08: 00007f9977406860 R09: 00007f9977a54740 [ 2633.566653] R10: 0000000000000000 R11: 0000000000000246 R12: 00007f99774056e0 [ 2633.567692] R13: 000000000000000c R14: 00007f9977400880 R15: 000000000000000c [ 2633.568725] ---[ end trace 10b4fe52945e544d ]---

AI-Powered Analysis

AILast updated: 06/26/2025, 16:50:57 UTC

Technical Analysis

CVE-2021-47212 is a vulnerability identified in the Linux kernel specifically affecting the Mellanox mlx5 driver components related to Infiniband and RDMA (Remote Direct Memory Access) functionalities. The vulnerability arises from improper handling of device state during the fast unload flow of mlx5 devices. When the device enters an internal error state indicating the driver has initiated the destroy process, the commands MLX5_CMD_OP_DESTROY_UCTX and MLX5_CMD_OP_DESTROY_UMEM incorrectly return an EIO (Input/Output error) status instead of MLX5_CMD_STAT_OK. This improper error handling leads to a call trace and potential instability during the umem release process, as evidenced by kernel call traces involving ib_uverbs, ib_core, mlx5_ib, and mlx5_core modules. The issue is rooted in the error handler logic for UCTX (user context) and UMEM (user memory) destruction commands within the mlx5 driver. Although no direct exploit in the wild has been reported, the flaw could cause kernel crashes or denial of service conditions when unloading mlx5 devices, impacting systems relying on Mellanox hardware for high-performance networking. The patch corrects the command return values to properly signal successful destroy operations, preventing the erroneous error propagation and associated kernel tracebacks. This vulnerability affects Linux kernel versions containing the specified commit hashes and is relevant for environments utilizing Mellanox mlx5 drivers for RDMA and Infiniband communications.

Potential Impact

For European organizations, particularly those in sectors relying on high-performance computing, data centers, cloud infrastructure, and telecommunications, this vulnerability could lead to system instability or denial of service when mlx5 devices are unloaded or reset. Organizations using Mellanox hardware for RDMA acceleration in critical applications such as financial trading platforms, research institutions, or large-scale data processing may experience unexpected kernel crashes or service interruptions. While the vulnerability does not appear to allow privilege escalation or remote code execution, the resulting instability could disrupt operations, cause downtime, and impact service availability. Given the widespread use of Linux in enterprise and cloud environments across Europe, any disruption in kernel-level device handling could have cascading effects on dependent services and applications. However, the impact is limited to systems using the affected mlx5 drivers and hardware, so organizations without Mellanox devices or RDMA deployments are not at risk.

Mitigation Recommendations

European organizations should ensure that their Linux kernel installations are updated to versions containing the fix for CVE-2021-47212. Specifically, kernel updates that correct the mlx5 driver error handling for UCTX and UMEM destroy commands must be applied promptly. System administrators should audit their environments to identify hosts using Mellanox mlx5 devices and prioritize patching these systems. Additionally, organizations should implement monitoring for kernel error logs and call traces related to mlx5 modules to detect any anomalous unload or device removal events. Where feasible, testing kernel updates in staging environments before production deployment can prevent unexpected regressions. For environments with high availability requirements, consider deploying redundant systems or failover mechanisms to mitigate potential downtime caused by device unload issues. Finally, coordinate with hardware vendors and Linux distribution maintainers to receive timely security updates and advisories related to mlx5 drivers.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
Linux
Date Reserved
2024-04-10T18:59:19.527Z
Cisa Enriched
true
Cvss Version
null
State
PUBLISHED

Threat ID: 682d9835c4522896dcbea09a

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

Last enriched: 6/26/2025, 4:50:57 PM

Last updated: 8/19/2025, 1:57:18 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