CVE-2021-47599

btrfs: use latest_dev in btrfs_show_devname

MEDIUM
4.7
CVSS Score
Published: June 19, 2024 at 02:54 PM UTC
Updated: June 17, 2026 at 04:17 AM UTC
1 product affected across 1 vendorLinux Kernel

Using Linux by Linux?

Get instant alerts when new vulnerabilities affect Linux - before attackers find them.

Real-time alertsTrack your software stackFree plan available
Severity
MEDIUM4.7
Exploit prediction
EPSS 0.1%
SSVC
No known exploit

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

Our own answer: ranges merged, affected separated from platform-only, with confidence and review flags.

v ≥ 4.19.141v ≥ 5.4.60v ≥ 5.7.17v ≥ 5.8.3v < 5.15.114.19.141 ≤ v < 4.205.4.60 ≤ v < 5.55.7.17 ≤ v < 5.85.8.3 ≤ v < 5.95.9 ≤ v < 5.15.115.9 ≤ v < 5.161c986b7e8c1bf8fabbc294036b003286cc3a8c7e3d3452920cacc3a46444ecca26af5d181410ff194.19.1414faf55b03823e96c44dc4e364520000ed3b12fdb5.4.605.7.175.8.35.9ca21728e18d34fd5f449bb0581160e0eaee498a6fa511954694cbea4d0cb59c81c8670276920c08c
Vendor states this is fixed in 6605fd2f394bba0a0059df2b6cfc87b0b6d393a2 (fixed)
Vendor states this is fixed in e342c2558016ead462f376b6c6c2ac5efc17f3b1 (fixed)
Affected range stops below 4.20, so it looks safe — our inference, not a vendor statement
Vendor states this is fixed in 5.15.11 (unaffected)
Vendor states this is fixed in 5.16 (unaffected)
Affected range stops below 5.5, so it looks safe — our inference, not a vendor statement
Affected range stops below 5.8, so it looks safe — our inference, not a vendor statement
Vendor states this is fixed in 5.9 (unaffected)

Remediation

No guide yet

No remediation guidance has been written for this CVE yet. What the record does show:

References (2)

Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/6605fd2f394bba0a0059df2b6cfc87b0b6d393a2
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/e342c2558016ead462f376b6c6c2ac5efc17f3b1

SSVC — Action Prioritization

SSVCNo known exploitNot automatablePartial impact

SSVC signals action urgency (what to patch first), separate from CVSS which measures severity.

CVSS

Attack Vector
LOCAL
Complexity
HIGH
Privileges
LOW
User Interaction
NONE
Scope
UNCHANGED
Confidentiality
NONE
Integrity
NONE
Availability
HIGH
Vector?

Quick Info

StatusMODIFIED
CWE
CWE-362

Get alerted

Stop reading CVE feeds looking for your own stack

Track the products you run and VulnTracker tells you when a new CVE affects them — with what is known about fixing it, and nothing about the rest.

Free plan, no card