# CVE-2021-47349: mwifiex: bring down link before deleting interface

> 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.23% (percentile 8, 2026-11-26)
- **CWE:** CWE-667
- **Published:** 2024-05-21T14:35:54.314Z
- **Modified:** 2026-06-17T04:17:15.750Z

## Who should check

- Anyone running Linux \>= a05829a7222e9d10c416dd2dbbf3929fe6646b89, \< a3041d39d3c14da97fa3476835aba043ba810cf0; \>= a05829a7222e9d10c416dd2dbbf3929fe6646b89, \< 35af69c7c0490fdccfc159c6a87e4d1dc070838a; \>= a05829a7222e9d10c416dd2dbbf3929fe6646b89, \< 1f9482aa8d412b4ba06ce6ab8e333fb8ca29a06e
- Anyone running Linux 5.12

## Description

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

mwifiex: bring down link before deleting interface

We can deadlock when rmmod'ing the driver or going through firmware
reset, because the cfg80211\_unregister\_wdev() has to bring down the link
for us, ... which then grab the same wiphy lock.

nl80211\_del\_interface() already handles a very similar case, with a nice
description:

        /\*
         \* We hold RTNL, so this is safe, without RTNL opencount cannot
         \* reach 0, and thus the rdev cannot be deleted.
         \*
         \* We need to do it for the dev\_close(), since that will call
         \* the netdev notifiers, and we need to acquire the mutex there
         \* but don't know if we get there from here or from some other
         \* place (e.g. "ip link set ... down").
         \*/
        mutex\_unlock(&rdev-\>wiphy.mtx);
...

Do similarly for mwifiex teardown, by ensuring we bring the link down
first.

Sample deadlock trace:

\[  247.103516\] INFO: task rmmod:2119 blocked for more than 123 seconds.
\[  247.110630\]       Not tainted 5.12.4 \#5
\[  247.115796\] "echo 0 \> /proc/sys/kernel/hung\_task\_timeout\_secs" disables this message.
\[  247.124557\] task:rmmod           state:D stack:    0 pid: 2119 ppid:  2114 flags:0x00400208
\[  247.133905\] Call trace:
\[  247.136644\]  \_\_switch\_to+0x130/0x170
\[  247.140643\]  \_\_schedule+0x714/0xa0c
\[  247.144548\]  schedule\_preempt\_disabled+0x88/0xf4
\[  247.149714\]  \_\_mutex\_lock\_common+0x43c/0x750
\[  247.154496\]  mutex\_lock\_nested+0x5c/0x68
\[  247.158884\]  cfg80211\_netdev\_notifier\_call+0x280/0x4e0 \[cfg80211\]
\[  247.165769\]  raw\_notifier\_call\_chain+0x4c/0x78
\[  247.170742\]  call\_netdevice\_notifiers\_info+0x68/0xa4
\[  247.176305\]  \_\_dev\_close\_many+0x7c/0x138
\[  247.180693\]  dev\_close\_many+0x7c/0x10c
\[  247.184893\]  unregister\_netdevice\_many+0xfc/0x654
\[  247.190158\]  unregister\_netdevice\_queue+0xb4/0xe0
\[  247.195424\]  \_cfg80211\_unregister\_wdev+0xa4/0x204 \[cfg80211\]
\[  247.201816\]  cfg80211\_unregister\_wdev+0x20/0x2c \[cfg80211\]
\[  247.208016\]  mwifiex\_del\_virtual\_intf+0xc8/0x188 \[mwifiex\]
\[  247.214174\]  mwifiex\_uninit\_sw+0x158/0x1b0 \[mwifiex\]
\[  247.219747\]  mwifiex\_remove\_card+0x38/0xa0 \[mwifiex\]
\[  247.225316\]  mwifiex\_pcie\_remove+0xd0/0xe0 \[mwifiex\_pcie\]
\[  247.231451\]  pci\_device\_remove+0x50/0xe0
\[  247.235849\]  device\_release\_driver\_internal+0x110/0x1b0
\[  247.241701\]  driver\_detach+0x5c/0x9c
\[  247.245704\]  bus\_remove\_driver+0x84/0xb8
\[  247.250095\]  driver\_unregister+0x3c/0x60
\[  247.254486\]  pci\_unregister\_driver+0x2c/0x90
\[  247.259267\]  cleanup\_module+0x18/0xcdc \[mwifiex\_pcie\]

## Affected and fixed versions

- Linux: \>= a05829a7222e9d10c416dd2dbbf3929fe6646b89, \< a3041d39d3c14da97fa3476835aba043ba810cf0; \>= a05829a7222e9d10c416dd2dbbf3929fe6646b89, \< 35af69c7c0490fdccfc159c6a87e4d1dc070838a; \>= a05829a7222e9d10c416dd2dbbf3929fe6646b89, \< 1f9482aa8d412b4ba06ce6ab8e333fb8ca29a06e (cvelist)
- Linux: 5.12 (cvelist)

## Mitigation

- Upgrade Linux to 1f9482aa8d412b4ba06ce6ab8e333fb8ca29a06e or later.

## Check your systems with an agent

Paste this into a coding agent:

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

Details: https://flawdb.com/CVE-2021-47349.md
Affected: Linux >= a05829a7222e9d10c416dd2dbbf3929fe6646b89, < a3041d39d3c14da97fa3476835aba043ba810cf0; >= a05829a7222e9d10c416dd2dbbf3929fe6646b89, < 35af69c7c0490fdccfc159c6a87e4d1dc070838a; >= a05829a7222e9d10c416dd2dbbf3929fe6646b89, < 1f9482aa8d412b4ba06ce6ab8e333fb8ca29a06e; Linux 5.12
Fixed in: Linux 35af69c7c0490fdccfc159c6a87e4d1dc070838a, Linux 1f9482aa8d412b4ba06ce6ab8e333fb8ca29a06e

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-47349 being exploited?

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

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

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

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

Linux \>= a05829a7222e9d10c416dd2dbbf3929fe6646b89, \< a3041d39d3c14da97fa3476835aba043ba810cf0; \>= a05829a7222e9d10c416dd2dbbf3929fe6646b89, \< 35af69c7c0490fdccfc159c6a87e4d1dc070838a; \>= a05829a7222e9d10c416dd2dbbf3929fe6646b89, \< 1f9482aa8d412b4ba06ce6ab8e333fb8ca29a06e; Linux 5.12.

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

Yes. Fixed in Linux 35af69c7c0490fdccfc159c6a87e4d1dc070838a, Linux 1f9482aa8d412b4ba06ce6ab8e333fb8ca29a06e. Upgrade Linux to 1f9482aa8d412b4ba06ce6ab8e333fb8ca29a06e or later.

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

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/a3041d39d3c14da97fa3476835aba043ba810cf0>
- patch: <https://git.kernel.org/stable/c/35af69c7c0490fdccfc159c6a87e4d1dc070838a>
- patch: <https://git.kernel.org/stable/c/1f9482aa8d412b4ba06ce6ab8e333fb8ca29a06e>

## 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-47349>

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