# CVE-2021-47599: btrfs: use latest\_dev in btrfs\_show\_devname

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

- **Severity:** MEDIUM 4.7
- **CVSS:** 4.7 (v3.1, NVD) `CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: High; 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.19% (percentile 5, 2026-11-26)
- **CWE:** CWE-362
- **Published:** 2024-06-19T14:54:00.272Z
- **Modified:** 2026-06-17T04:17:52.707Z

## Who should check

- Anyone running Linux \>= 4faf55b03823e96c44dc4e364520000ed3b12fdb, \< e342c2558016ead462f376b6c6c2ac5efc17f3b1; \>= 4faf55b03823e96c44dc4e364520000ed3b12fdb, \< 6605fd2f394bba0a0059df2b6cfc87b0b6d393a2; fa511954694cbea4d0cb59c81c8670276920c08c; 3d3452920cacc3a46444ecca26af5d181410ff19; ca21728e18d34fd5f449bb0581160e0eaee498a6; 1c986b7e8c1bf8fabbc294036b003286cc3a8c7e; \>= 4.19.141, \< 4.20; \>= 5.4.60, \< 5.5; \>= 5.7.17, \< 5.8; \>= 5.8.3, \< 5.9
- Anyone running Linux 5.9

## Description

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

btrfs: use latest\_dev in btrfs\_show\_devname

The test case btrfs/238 reports the warning below:

 WARNING: CPU: 3 PID: 481 at fs/btrfs/super.c:2509 btrfs\_show\_devname+0x104/0x1e8 \[btrfs\]
 CPU: 2 PID: 1 Comm: systemd Tainted: G        W  O 5.14.0-rc1-custom \#72
 Hardware name: QEMU QEMU Virtual Machine, BIOS 0.0.0 02/06/2015
 Call trace:
   btrfs\_show\_devname+0x108/0x1b4 \[btrfs\]
   show\_mountinfo+0x234/0x2c4
   m\_show+0x28/0x34
   seq\_read\_iter+0x12c/0x3c4
   vfs\_read+0x29c/0x2c8
   ksys\_read+0x80/0xec
   \_\_arm64\_sys\_read+0x28/0x34
   invoke\_syscall+0x50/0xf8
   do\_el0\_svc+0x88/0x138
   el0\_svc+0x2c/0x8c
   el0t\_64\_sync\_handler+0x84/0xe4
   el0t\_64\_sync+0x198/0x19c

Reason:
While btrfs\_prepare\_sprout() moves the fs\_devices::devices into
fs\_devices::seed\_list, the btrfs\_show\_devname() searches for the devices
and found none, leading to the warning as in above.

Fix:
latest\_dev is updated according to the changes to the device list.
That means we could use the latest\_dev-\>name to show the device name in
/proc/self/mounts, the pointer will be always valid as it's assigned
before the device is deleted from the list in remove or replace.
The RCU protection is sufficient as the device structure is freed after
synchronization.

## Affected and fixed versions

- Linux: \>= 4faf55b03823e96c44dc4e364520000ed3b12fdb, \< e342c2558016ead462f376b6c6c2ac5efc17f3b1; \>= 4faf55b03823e96c44dc4e364520000ed3b12fdb, \< 6605fd2f394bba0a0059df2b6cfc87b0b6d393a2; fa511954694cbea4d0cb59c81c8670276920c08c; 3d3452920cacc3a46444ecca26af5d181410ff19; ca21728e18d34fd5f449bb0581160e0eaee498a6; 1c986b7e8c1bf8fabbc294036b003286cc3a8c7e; \>= 4.19.141, \< 4.20; \>= 5.4.60, \< 5.5; \>= 5.7.17, \< 5.8; \>= 5.8.3, \< 5.9 (cvelist)
- Linux: 5.9 (cvelist)

## Mitigation

- Upgrade Linux to 5.9 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-47599. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2021-47599.md
Affected: Linux >= 4faf55b03823e96c44dc4e364520000ed3b12fdb, < e342c2558016ead462f376b6c6c2ac5efc17f3b1; >= 4faf55b03823e96c44dc4e364520000ed3b12fdb, < 6605fd2f394bba0a0059df2b6cfc87b0b6d393a2; fa511954694cbea4d0cb59c81c8670276920c08c; 3d3452920cacc3a46444ecca26af5d181410ff19; ca21728e18d34fd5f449bb0581160e0…
Fixed in: Linux 6605fd2f394bba0a0059df2b6cfc87b0b6d393a2, Linux 4.20, Linux 5.5, Linux 5.8, Linux 5.9

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

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

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

Medium: CVSS 4.7 (v3.1, scored by NVD). Not remotely exploitable (local or adjacent access needed). The attack needs conditions outside the attacker's control, which makes it harder.

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

Linux \>= 4faf55b03823e96c44dc4e364520000ed3b12fdb, \< e342c2558016ead462f376b6c6c2ac5efc17f3b1; \>= 4faf55b03823e96c44dc4e364520000ed3b12fdb, \< 6605fd2f394bba0a0059df2b6cfc87b0b6d393a2; fa511954694cbea4d0cb59c81c8670276920c08c; 3d3452920cacc3a46444ecca26af5d181410ff19; ca21728e18d34fd5f449bb0581160e0eaee498a6; 1c986b7e8c1bf8fabbc294036b003286cc3a8c7e; \>= 4.19.141, \< 4.20; \>= 5.4.60, \< 5.5; \>= 5.7.17, \< 5.8; \>= 5.8.3, \< 5.9; Linux 5.9.

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

Yes. Fixed in Linux 6605fd2f394bba0a0059df2b6cfc87b0b6d393a2, Linux 4.20, Linux 5.5, Linux 5.8, Linux 5.9. Upgrade Linux to 5.9 or later.

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

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/e342c2558016ead462f376b6c6c2ac5efc17f3b1>
- patch: <https://git.kernel.org/stable/c/6605fd2f394bba0a0059df2b6cfc87b0b6d393a2>

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

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