# CVE-2021-47212: net/mlx5: Update error handler for UCTX and UMEM

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** MEDIUM 5.5
- **CVSS:** 5.5 (v3.1, NVD) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: None; Integrity impact: None; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 0.27% (percentile 12, 2026-11-26)
- **Published:** 2024-04-10T19:01:53.270Z
- **Modified:** 2026-06-17T04:16:55.370Z

## Who should check

- Anyone running Linux \>= 6a6fabbfa3e8c656ff906ae999fb6856410fa4cd, \< a51a6da375d82aed5c8f83abd13e7d060421bd48; \>= 6a6fabbfa3e8c656ff906ae999fb6856410fa4cd, \< ba50cd9451f6c49cf0841c0a4a146ff6a2822699
- Anyone running Linux 5.2

## 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 \]---

## Affected and fixed versions

- Linux: \>= 6a6fabbfa3e8c656ff906ae999fb6856410fa4cd, \< a51a6da375d82aed5c8f83abd13e7d060421bd48; \>= 6a6fabbfa3e8c656ff906ae999fb6856410fa4cd, \< ba50cd9451f6c49cf0841c0a4a146ff6a2822699 (cvelist)
- Linux: 5.2 (cvelist)

## Mitigation

- No fix listed yet: follow the vendor advisory.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2021-47212. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2021-47212.md
Affected: Linux >= 6a6fabbfa3e8c656ff906ae999fb6856410fa4cd, < a51a6da375d82aed5c8f83abd13e7d060421bd48; >= 6a6fabbfa3e8c656ff906ae999fb6856410fa4cd, < ba50cd9451f6c49cf0841c0a4a146ff6a2822699; Linux 5.2
Fixed in: no fixed version listed yet

Steps:
1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2021-47212 being exploited?

There is no confirmed exploitation: CVE-2021-47212 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.27% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2021-47212?

Medium: CVSS 5.5 (v3.1, scored by NVD). Not remotely exploitable (local or adjacent access needed).

### Which versions are affected by CVE-2021-47212?

Linux \>= 6a6fabbfa3e8c656ff906ae999fb6856410fa4cd, \< a51a6da375d82aed5c8f83abd13e7d060421bd48; \>= 6a6fabbfa3e8c656ff906ae999fb6856410fa4cd, \< ba50cd9451f6c49cf0841c0a4a146ff6a2822699; Linux 5.2.

### Is there a fix for CVE-2021-47212?

No fixed version is listed in the sources yet. No fix listed yet: follow the vendor advisory.

### How do I check if I'm affected by CVE-2021-47212?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- patch: <https://git.kernel.org/stable/c/a51a6da375d82aed5c8f83abd13e7d060421bd48>
- patch: <https://git.kernel.org/stable/c/ba50cd9451f6c49cf0841c0a4a146ff6a2822699>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2021-47212>

HTML: <https://flawdb.com/CVE-2021-47212> · JSON: <https://flawdb.com/api/v1/entries/CVE-2021-47212>
