Vulnerability · Published Dec 27, 2024 · Assigned by Linux
CVE-2024-53218f2fs: fix race in concurrent f2fs_stop_gc_thread
High 7.8
In plain English
A high-severity use-after-free 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.2% (higher than 13% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.
Official description
In the Linux kernel, the following vulnerability has been resolved: f2fs: fix race in concurrent f2fs_stop_gc_thread In my test case, concurrent calls to f2fs shutdown report the following stack trace: Oops: general protection fault, probably for non-canonical address 0xc6cfff63bb5513fc: 0000 [#1] PREEMPT SMP PTI CPU: 0 UID: 0 PID: 678 Comm: f2fs_rep_shutdo Not tainted 6.12.0-rc5-next-20241029-g6fb2fa9805c5-dirty #85 Call Trace: <TASK> ? show_regs+0x8b/0xa0 ? __die_body+0x26/0xa0 ? die_addr+0x54/0x90 ? exc_general_protection+0x24b/0x5c0 ? asm_exc_general_protection+0x26/0x30 ? kthread_stop+0x46/0x390 f2fs_stop_gc_thread+0x6c/0x110 f2fs_do_shutdown+0x309/0x3a0 f2fs_ioc_shutdown+0x150/0x1c0 __f2fs_ioctl+0xffd/0x2ac0 f2fs_ioctl+0x76/0xe0 vfs_ioctl+0x23/0x60 __x64_sys_ioctl+0xce/0xf0 x64_sys_call+0x2b1b/0x4540 do_syscall_64+0xa7/0x240 entry_SYSCALL_64_after_hwframe+0x76/0x7e The root cause is a race condition in f2fs_stop_gc_thread() called from different f2fs shutdown paths: [CPU0] [CPU1] ---------------------- ----------------------- f2fs_stop_gc_thread f2fs_stop_gc_thread gc_th = sbi->gc_thread gc_th = sbi->gc_thread kfree(gc_th) sbi->gc_thread = NULL < gc_th != NULL > kthread_stop(gc_th->f2fs_gc_task) //UAF The commit c7f114d864ac ("f2fs: fix to avoid use-after-free in f2fs_stop_gc_thread()") attempted to fix this issue by using a read semaphore to prevent races between shutdown and remount threads, but it fails to prevent all race conditions. Fix it by converting to write lock of s_umount in f2fs_do_shutdown().
Affected packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian:12 | linux | no fix listed | DEBIAN-CVE-2024-53218 |
| Debian:13 | linux | 6.12.3-1 | DEBIAN-CVE-2024-53218 |
| Debian:14 | linux | 6.12.3-1 | DEBIAN-CVE-2024-53218 |
| Ubuntu:22.04:LTS | linux | 5.15.0-164.174 | UBUNTU-CVE-2024-53218 |
| Ubuntu:22.04:LTS | linux | 5.15.0-164.174 | USN-7928-1 |
| Ubuntu:24.04:LTS | linux | 6.8.0-58.60 | UBUNTU-CVE-2024-53218 |
| Ubuntu:22.04:LTS | linux-allwinner-5.19 | no fix listed | UBUNTU-CVE-2024-53218 |
| Ubuntu:22.04:LTS | linux-aws | 5.15.0-1098.105 | UBUNTU-CVE-2024-53218 |
| Ubuntu:22.04:LTS | linux-aws | 5.15.0-1098.105 | USN-7928-1 |
| Ubuntu:24.04:LTS | linux-aws | 6.8.0-1027.29 | UBUNTU-CVE-2024-53218 |
| Ubuntu:22.04:LTS | linux-aws-5.19 | no fix listed | UBUNTU-CVE-2024-53218 |
| Ubuntu:22.04:LTS | linux-aws-6.2 | no fix listed | UBUNTU-CVE-2024-53218 |
| Ubuntu:22.04:LTS | linux-aws-6.5 | no fix listed | UBUNTU-CVE-2024-53218 |
| Ubuntu:22.04:LTS | linux-aws-6.8 | 6.8.0-1027.29~22.04.1 | UBUNTU-CVE-2024-53218 |
| Ubuntu:22.04:LTS | linux-azure | 5.15.0-1102.111 | USN-7928-1 |
| Ubuntu:22.04:LTS | linux-azure | 5.15.0-1102.111 | UBUNTU-CVE-2024-53218 |
| Ubuntu:24.04:LTS | linux-azure | 6.8.0-1027.32 | UBUNTU-CVE-2024-53218 |
| Ubuntu:22.04:LTS | linux-azure-5.19 | no fix listed | UBUNTU-CVE-2024-53218 |
| Ubuntu:24.04:LTS | linux-azure-6.11 | 6.11.0-1012.12~24.04.1 | UBUNTU-CVE-2024-53218 |
| Ubuntu:22.04:LTS | linux-azure-6.2 | no fix listed | UBUNTU-CVE-2024-53218 |
| Ubuntu:22.04:LTS | linux-azure-6.5 | no fix listed | UBUNTU-CVE-2024-53218 |
| Ubuntu:22.04:LTS | linux-azure-6.8 | 6.8.0-1027.32~22.04.1 | UBUNTU-CVE-2024-53218 |
| Ubuntu:22.04:LTS | linux-azure-fde | 5.15.0-1102.111.1 | UBUNTU-CVE-2024-53218 |
| Ubuntu:22.04:LTS | linux-azure-fde-5.19 | no fix listed | UBUNTU-CVE-2024-53218 |
| Ubuntu:22.04:LTS | linux-azure-fde-6.2 | no fix listed | UBUNTU-CVE-2024-53218 |
| Ubuntu:24.04:LTS | linux-azure-nvidia | 6.8.0-1014.15 | UBUNTU-CVE-2024-53218 |
| Ubuntu:22.04:LTS | linux-gcp | 5.15.0-1098.107 | UBUNTU-CVE-2024-53218 |
| Ubuntu:22.04:LTS | linux-gcp | 5.15.0-1098.107 | USN-7928-1 |
| Ubuntu:24.04:LTS | linux-gcp | 6.8.0-1028.30 | UBUNTU-CVE-2024-53218 |
| Ubuntu:22.04:LTS | linux-gcp-5.19 | no fix listed | UBUNTU-CVE-2024-53218 |
| Ubuntu:24.04:LTS | linux-gcp-6.11 | 6.11.0-1011.11~24.04.1 | UBUNTU-CVE-2024-53218 |
| Ubuntu:22.04:LTS | linux-gcp-6.2 | no fix listed | UBUNTU-CVE-2024-53218 |
| Ubuntu:22.04:LTS | linux-gcp-6.5 | no fix listed | UBUNTU-CVE-2024-53218 |
| Ubuntu:22.04:LTS | linux-gcp-6.8 | 6.8.0-1028.30~22.04.1 | UBUNTU-CVE-2024-53218 |
| Ubuntu:22.04:LTS | linux-gke | 5.15.0-1094.100 | UBUNTU-CVE-2024-53218 |
| Ubuntu:22.04:LTS | linux-gke | 5.15.0-1094.100 | USN-7928-1 |
| Ubuntu:24.04:LTS | linux-gke | 6.8.0-1023.27 | UBUNTU-CVE-2024-53218 |
| Ubuntu:22.04:LTS | linux-gkeop | 5.15.0-1081.89 | UBUNTU-CVE-2024-53218 |
| Ubuntu:22.04:LTS | linux-gkeop | 5.15.0-1081.89 | USN-7928-1 |
| Ubuntu:24.04:LTS | linux-gkeop | 6.8.0-1010.12 | UBUNTU-CVE-2024-53218 |
| Ubuntu:22.04:LTS | linux-hwe-5.19 | no fix listed | UBUNTU-CVE-2024-53218 |
| Ubuntu:22.04:LTS | linux-hwe-6.2 | no fix listed | UBUNTU-CVE-2024-53218 |
| Ubuntu:22.04:LTS | linux-hwe-6.5 | no fix listed | UBUNTU-CVE-2024-53218 |
| Ubuntu:22.04:LTS | linux-hwe-6.8 | 6.8.0-58.60~22.04.1 | UBUNTU-CVE-2024-53218 |
| Ubuntu:22.04:LTS | linux-ibm | 5.15.0-1092.95 | USN-7928-1 |
| Ubuntu:22.04:LTS | linux-ibm | 5.15.0-1092.95 | UBUNTU-CVE-2024-53218 |
| Ubuntu:24.04:LTS | linux-ibm | 6.8.0-1024.24 | UBUNTU-CVE-2024-53218 |
| Ubuntu:22.04:LTS | linux-ibm-6.8 | 6.8.0-1024.24~22.04.1 | UBUNTU-CVE-2024-53218 |
| Ubuntu:22.04:LTS | linux-intel-iot-realtime | no fix listed | UBUNTU-CVE-2024-53218 |
| Ubuntu:22.04:LTS | linux-intel-iotg | 5.15.0-1093.99 | UBUNTU-CVE-2024-53218 |
| Ubuntu:22.04:LTS | linux-intel-iotg | 5.15.0-1093.99 | USN-7928-1 |
| Ubuntu:22.04:LTS | linux-kvm | 5.15.0-1090.95 | UBUNTU-CVE-2024-53218 |
| Ubuntu:22.04:LTS | linux-kvm | 5.15.0-1090.95 | USN-7928-5 |
| Ubuntu:22.04:LTS | linux-lowlatency | 5.15.0-164.174 | UBUNTU-CVE-2024-53218 |
| Ubuntu:22.04:LTS | linux-lowlatency | 5.15.0-164.174 | USN-7928-1 |
| Ubuntu:24.04:LTS | linux-lowlatency | 6.8.0-58.60.1 | UBUNTU-CVE-2024-53218 |
| Ubuntu:22.04:LTS | linux-lowlatency-hwe-5.19 | no fix listed | UBUNTU-CVE-2024-53218 |
| Ubuntu:22.04:LTS | linux-lowlatency-hwe-6.2 | no fix listed | UBUNTU-CVE-2024-53218 |
| Ubuntu:22.04:LTS | linux-lowlatency-hwe-6.5 | no fix listed | UBUNTU-CVE-2024-53218 |
| Ubuntu:22.04:LTS | linux-lowlatency-hwe-6.8 | 6.8.0-58.60.1~22.04.1 | UBUNTU-CVE-2024-53218 |
| Ubuntu:22.04:LTS | linux-nvidia | 5.15.0-1093.94 | UBUNTU-CVE-2024-53218 |
| Ubuntu:22.04:LTS | linux-nvidia | 5.15.0-1093.94 | USN-7928-1 |
| Ubuntu:24.04:LTS | linux-nvidia | 6.8.0-1026.29 | UBUNTU-CVE-2024-53218 |
| Ubuntu:24.04:LTS | linux-nvidia-6.11 | 6.11.0-1007.7 | UBUNTU-CVE-2024-53218 |
| Ubuntu:22.04:LTS | linux-nvidia-6.2 | no fix listed | UBUNTU-CVE-2024-53218 |
| Ubuntu:22.04:LTS | linux-nvidia-6.5 | no fix listed | UBUNTU-CVE-2024-53218 |
| Ubuntu:22.04:LTS | linux-nvidia-6.8 | 6.8.0-1026.29~22.04.1 | UBUNTU-CVE-2024-53218 |
| Ubuntu:24.04:LTS | linux-nvidia-lowlatency | 6.8.0-1026.29.1 | UBUNTU-CVE-2024-53218 |
| Ubuntu:22.04:LTS | linux-nvidia-tegra | 5.15.0-1050.50 | UBUNTU-CVE-2024-53218 |
| Ubuntu:22.04:LTS | linux-nvidia-tegra | 5.15.0-1050.50 | USN-7928-1 |
| Ubuntu:24.04:LTS | linux-nvidia-tegra | 6.8.0-1008.8 | UBUNTU-CVE-2024-53218 |
| Ubuntu:22.04:LTS | linux-nvidia-tegra-igx | 5.15.0-1039.39 | UBUNTU-CVE-2024-53218 |
| Ubuntu:22.04:LTS | linux-nvidia-tegra-igx | 5.15.0-1039.39 | USN-7928-1 |
| Ubuntu:22.04:LTS | linux-oem-5.17 | no fix listed | UBUNTU-CVE-2024-53218 |
| Ubuntu:22.04:LTS | linux-oem-6.0 | no fix listed | UBUNTU-CVE-2024-53218 |
| Ubuntu:22.04:LTS | linux-oem-6.1 | no fix listed | UBUNTU-CVE-2024-53218 |
| Ubuntu:24.04:LTS | linux-oem-6.11 | 6.11.0-1015.15 | UBUNTU-CVE-2024-53218 |
| Ubuntu:22.04:LTS | linux-oem-6.5 | no fix listed | UBUNTU-CVE-2024-53218 |
| Ubuntu:24.04:LTS | linux-oem-6.8 | 6.8.0-1026.26 | UBUNTU-CVE-2024-53218 |
| Ubuntu:22.04:LTS | linux-oracle | 5.15.0-1095.101 | USN-7928-1 |
| Ubuntu:22.04:LTS | linux-oracle | 5.15.0-1095.101 | UBUNTU-CVE-2024-53218 |
| Ubuntu:24.04:LTS | linux-oracle | 6.8.0-1024.25 | UBUNTU-CVE-2024-53218 |
| Ubuntu:22.04:LTS | linux-oracle-6.5 | no fix listed | UBUNTU-CVE-2024-53218 |
| Ubuntu:22.04:LTS | linux-oracle-6.8 | 6.8.0-1024.25~22.04.1 | UBUNTU-CVE-2024-53218 |
| Ubuntu:22.04:LTS | linux-raspi | 5.15.0-1092.95 | USN-7928-4 |
| Ubuntu:22.04:LTS | linux-raspi | 5.15.0-1092.95 | UBUNTU-CVE-2024-53218 |
| Ubuntu:24.04:LTS | linux-raspi | 6.8.0-1028.32 | UBUNTU-CVE-2024-53218 |
| Ubuntu:24.04:LTS | linux-raspi-realtime | no fix listed | UBUNTU-CVE-2024-53218 |
| Ubuntu:22.04:LTS | linux-realtime | no fix listed | UBUNTU-CVE-2024-53218 |
| Ubuntu:24.04:LTS | linux-realtime | no fix listed | UBUNTU-CVE-2024-53218 |
| Ubuntu:22.04:LTS | linux-riscv | no fix listed | UBUNTU-CVE-2024-53218 |
| Ubuntu:24.04:LTS | linux-riscv | 6.8.0-58.60.1 | UBUNTU-CVE-2024-53218 |
| Ubuntu:22.04:LTS | linux-riscv-5.19 | no fix listed | UBUNTU-CVE-2024-53218 |
| Ubuntu:22.04:LTS | linux-riscv-6.5 | no fix listed | UBUNTU-CVE-2024-53218 |
| Ubuntu:22.04:LTS | linux-riscv-6.8 | 6.8.0-58.60.1~22.04.1 | UBUNTU-CVE-2024-53218 |
| Ubuntu:22.04:LTS | linux-starfive-5.19 | no fix listed | UBUNTU-CVE-2024-53218 |
| Ubuntu:22.04:LTS | linux-starfive-6.2 | no fix listed | UBUNTU-CVE-2024-53218 |
| Ubuntu:22.04:LTS | linux-starfive-6.5 | no fix listed | UBUNTU-CVE-2024-53218 |
| Ubuntu:24.04:LTS | linux-xilinx | 6.8.0-1017.18 | UBUNTU-CVE-2024-53218 |
| Ubuntu:22.04:LTS | linux-xilinx-zynqmp | 5.15.0-1062.66 | USN-7928-1 |
| Ubuntu:22.04:LTS | linux-xilinx-zynqmp | 5.15.0-1062.66 | UBUNTU-CVE-2024-53218 |
Affected products (as reported)
| Vendor | Product | Versions |
|---|---|---|
| Linux | Linux | 7950e9ac638e84518fbdd5c930939ad46a1068c5 – before 794fa8792d4eacac191f1cbcc2e81b7369e4662a7950e9ac638e84518fbdd5c930939ad46a1068c5 – before 60457ed6c67625c87861f96912b4179dc22938967950e9ac638e84518fbdd5c930939ad46a1068c5 – before c631207897a9b3d41167ceca58e07f8f94720e427950e9ac638e84518fbdd5c930939ad46a1068c5 – before 7b0033dbc48340a1c1c3f12448ba17d6587ca092 |
| Linux | Linux | 4.16 |
Weakness: CWE-416 · Vector: CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H