Vulnerability · Published Jun 19, 2024 · Assigned by Linux

CVE-2021-47599btrfs: use latest_dev in btrfs_show_devname

Medium 4.7

In plain English

A medium-severity security flaw in Linux from Linux. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 0.1% (higher than 4% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.

Severity (CVSS NVD)4.7Medium
Exploit odds (30 days)0.1%top 96.1% of all CVEs
Exploited in the wildNo reportsCISA SSVC: none
Attack toolingNoneno public tooling known

Official 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 packages & fixed versions

EcosystemPackageFixed inAdvisory
Debian:12linux5.15.15-1DEBIAN-CVE-2021-47599
Debian:13linux5.15.15-1DEBIAN-CVE-2021-47599
Debian:14linux5.15.15-1DEBIAN-CVE-2021-47599
Ubuntu:22.04:LTSlinux-allwinner-5.19no fix listedUBUNTU-CVE-2021-47599
Ubuntu:22.04:LTSlinux-aws-5.19no fix listedUBUNTU-CVE-2021-47599
Ubuntu:22.04:LTSlinux-aws-6.2no fix listedUBUNTU-CVE-2021-47599
Ubuntu:22.04:LTSlinux-aws-6.5no fix listedUBUNTU-CVE-2021-47599
Ubuntu:22.04:LTSlinux-azure-5.19no fix listedUBUNTU-CVE-2021-47599
Ubuntu:22.04:LTSlinux-azure-6.2no fix listedUBUNTU-CVE-2021-47599
Ubuntu:22.04:LTSlinux-azure-6.5no fix listedUBUNTU-CVE-2021-47599
Ubuntu:22.04:LTSlinux-azure-fdeno fix listedUBUNTU-CVE-2021-47599
Ubuntu:22.04:LTSlinux-azure-fde-5.19no fix listedUBUNTU-CVE-2021-47599
Ubuntu:22.04:LTSlinux-azure-fde-6.2no fix listedUBUNTU-CVE-2021-47599
Ubuntu:22.04:LTSlinux-gcp-5.19no fix listedUBUNTU-CVE-2021-47599
Ubuntu:22.04:LTSlinux-gcp-6.2no fix listedUBUNTU-CVE-2021-47599
Ubuntu:22.04:LTSlinux-gcp-6.5no fix listedUBUNTU-CVE-2021-47599
Ubuntu:22.04:LTSlinux-hwe-5.19no fix listedUBUNTU-CVE-2021-47599
Ubuntu:22.04:LTSlinux-hwe-6.2no fix listedUBUNTU-CVE-2021-47599
Ubuntu:22.04:LTSlinux-hwe-6.5no fix listedUBUNTU-CVE-2021-47599
Ubuntu:22.04:LTSlinux-intel-iot-realtimeno fix listedUBUNTU-CVE-2021-47599
Ubuntu:22.04:LTSlinux-lowlatency-hwe-5.19no fix listedUBUNTU-CVE-2021-47599
Ubuntu:22.04:LTSlinux-lowlatency-hwe-6.2no fix listedUBUNTU-CVE-2021-47599
Ubuntu:22.04:LTSlinux-lowlatency-hwe-6.5no fix listedUBUNTU-CVE-2021-47599
Ubuntu:22.04:LTSlinux-nvidia-6.2no fix listedUBUNTU-CVE-2021-47599
Ubuntu:22.04:LTSlinux-nvidia-6.5no fix listedUBUNTU-CVE-2021-47599
Ubuntu:22.04:LTSlinux-oem-5.17no fix listedUBUNTU-CVE-2021-47599
Ubuntu:22.04:LTSlinux-oem-6.0no fix listedUBUNTU-CVE-2021-47599
Ubuntu:22.04:LTSlinux-oem-6.1no fix listedUBUNTU-CVE-2021-47599
Ubuntu:22.04:LTSlinux-oem-6.5no fix listedUBUNTU-CVE-2021-47599
Ubuntu:22.04:LTSlinux-oracle-6.5no fix listedUBUNTU-CVE-2021-47599
Ubuntu:24.04:LTSlinux-raspi-realtimeno fix listedUBUNTU-CVE-2021-47599
Ubuntu:22.04:LTSlinux-realtimeno fix listedUBUNTU-CVE-2021-47599
Ubuntu:22.04:LTSlinux-riscvno fix listedUBUNTU-CVE-2021-47599
Ubuntu:22.04:LTSlinux-riscv-5.19no fix listedUBUNTU-CVE-2021-47599
Ubuntu:22.04:LTSlinux-riscv-6.5no fix listedUBUNTU-CVE-2021-47599
Ubuntu:22.04:LTSlinux-starfive-5.19no fix listedUBUNTU-CVE-2021-47599
Ubuntu:22.04:LTSlinux-starfive-6.2no fix listedUBUNTU-CVE-2021-47599
Ubuntu:22.04:LTSlinux-starfive-6.5no fix listedUBUNTU-CVE-2021-47599

Affected products (as reported)

VendorProductVersions
Linux Linux 4faf55b03823e96c44dc4e364520000ed3b12fdb – before e342c2558016ead462f376b6c6c2ac5efc17f3b14faf55b03823e96c44dc4e364520000ed3b12fdb – before 6605fd2f394bba0a0059df2b6cfc87b0b6d393a2fa511954694cbea4d0cb59c81c8670276920c08c3d3452920cacc3a46444ecca26af5d181410ff19ca21728e18d34fd5f449bb0581160e0eaee498a61c986b7e8c1bf8fabbc294036b003286cc3a8c7e4.19.141 – before 4.205.4.60 – before 5.5
Linux Linux 5.9

References