Vulnerability · Published Oct 21, 2024 · Assigned by Linux
CVE-2024-47691f2fs: fix to avoid use-after-free in f2fs_stop_gc_thread()
High 7.8
In plain English
A high-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.2% (higher than 15% 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 to avoid use-after-free in f2fs_stop_gc_thread() syzbot reports a f2fs bug as below: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:114 print_report+0xe8/0x550 mm/kasan/report.c:491 kasan_report+0x143/0x180 mm/kasan/report.c:601 kasan_check_range+0x282/0x290 mm/kasan/generic.c:189 instrument_atomic_read_write include/linux/instrumented.h:96 [inline] atomic_fetch_add_relaxed include/linux/atomic/atomic-instrumented.h:252 [inline] __refcount_add include/linux/refcount.h:184 [inline] __refcount_inc include/linux/refcount.h:241 [inline] refcount_inc include/linux/refcount.h:258 [inline] get_task_struct include/linux/sched/task.h:118 [inline] kthread_stop+0xca/0x630 kernel/kthread.c:704 f2fs_stop_gc_thread+0x65/0xb0 fs/f2fs/gc.c:210 f2fs_do_shutdown+0x192/0x540 fs/f2fs/file.c:2283 f2fs_ioc_shutdown fs/f2fs/file.c:2325 [inline] __f2fs_ioctl+0x443a/0xbe60 fs/f2fs/file.c:4325 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:907 [inline] __se_sys_ioctl+0xfc/0x170 fs/ioctl.c:893 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f The root cause is below race condition, it may cause use-after-free issue in sbi->gc_th pointer. - remount - f2fs_remount - f2fs_stop_gc_thread - kfree(gc_th) - f2fs_ioc_shutdown - f2fs_do_shutdown - f2fs_stop_gc_thread - kthread_stop(gc_th->f2fs_gc_task) : sbi->gc_thread = NULL; We will call f2fs_do_shutdown() in two paths: - for f2fs_ioc_shutdown() path, we should grab sb->s_umount semaphore for fixing. - for f2fs_shutdown() path, it's safe since caller has already grabbed sb->s_umount semaphore.
Affected packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian:12 | linux | no fix listed | DEBIAN-CVE-2024-47691 |
| Debian:13 | linux | 6.11.2-1 | DEBIAN-CVE-2024-47691 |
| Debian:14 | linux | 6.11.2-1 | DEBIAN-CVE-2024-47691 |
| Ubuntu:22.04:LTS | linux | 5.15.0-164.174 | UBUNTU-CVE-2024-47691 |
| Ubuntu:22.04:LTS | linux | 5.15.0-164.174 | USN-7928-1 |
| Ubuntu:24.04:LTS | linux | 6.8.0-54.56 | USN-7301-1 |
| Ubuntu:24.04:LTS | linux | 6.8.0-54.56 | UBUNTU-CVE-2024-47691 |
| Ubuntu:22.04:LTS | linux-allwinner-5.19 | no fix listed | UBUNTU-CVE-2024-47691 |
| Ubuntu:22.04:LTS | linux-aws | 5.15.0-1098.105 | USN-7928-1 |
| Ubuntu:22.04:LTS | linux-aws | 5.15.0-1098.105 | UBUNTU-CVE-2024-47691 |
| Ubuntu:24.04:LTS | linux-aws | 6.8.0-1023.25 | USN-7311-1 |
| Ubuntu:24.04:LTS | linux-aws | 6.8.0-1023.25 | UBUNTU-CVE-2024-47691 |
| Ubuntu:22.04:LTS | linux-aws-5.19 | no fix listed | UBUNTU-CVE-2024-47691 |
| Ubuntu:22.04:LTS | linux-aws-6.2 | no fix listed | UBUNTU-CVE-2024-47691 |
| Ubuntu:22.04:LTS | linux-aws-6.5 | no fix listed | UBUNTU-CVE-2024-47691 |
| Ubuntu:22.04:LTS | linux-aws-6.8 | 6.8.0-1023.25~22.04.1 | UBUNTU-CVE-2024-47691 |
| Ubuntu:22.04:LTS | linux-aws-6.8 | 6.8.0-1023.25~22.04.1 | USN-7311-1 |
| 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-47691 |
| Ubuntu:24.04:LTS | linux-azure | 6.8.0-1025.30 | UBUNTU-CVE-2024-47691 |
| Ubuntu:24.04:LTS | linux-azure | 6.8.0-1025.30 | USN-7384-1 |
| Ubuntu:22.04:LTS | linux-azure-5.19 | no fix listed | UBUNTU-CVE-2024-47691 |
| Ubuntu:24.04:LTS | linux-azure-6.11 | 6.11.0-1012.12~24.04.1 | UBUNTU-CVE-2024-47691 |
| Ubuntu:22.04:LTS | linux-azure-6.2 | no fix listed | UBUNTU-CVE-2024-47691 |
| Ubuntu:22.04:LTS | linux-azure-6.5 | no fix listed | UBUNTU-CVE-2024-47691 |
| Ubuntu:22.04:LTS | linux-azure-6.8 | 6.8.0-1025.30~22.04.1 | USN-7384-2 |
| Ubuntu:22.04:LTS | linux-azure-6.8 | 6.8.0-1025.30~22.04.1 | UBUNTU-CVE-2024-47691 |
| Ubuntu:22.04:LTS | linux-azure-fde | 5.15.0-1102.111.1 | UBUNTU-CVE-2024-47691 |
| Ubuntu:22.04:LTS | linux-azure-fde-5.19 | no fix listed | UBUNTU-CVE-2024-47691 |
| Ubuntu:22.04:LTS | linux-azure-fde-6.2 | no fix listed | UBUNTU-CVE-2024-47691 |
| Ubuntu:24.04:LTS | linux-azure-nvidia | 6.8.0-1014.15 | UBUNTU-CVE-2024-47691 |
| Ubuntu:24.04:LTS | linux-azure-nvidia | 6.8.0-1014.15 | USN-7468-1 |
| Ubuntu:22.04:LTS | linux-gcp | 5.15.0-1098.107 | UBUNTU-CVE-2024-47691 |
| Ubuntu:22.04:LTS | linux-gcp | 5.15.0-1098.107 | USN-7928-1 |
| Ubuntu:24.04:LTS | linux-gcp | 6.8.0-1024.26 | UBUNTU-CVE-2024-47691 |
| Ubuntu:24.04:LTS | linux-gcp | 6.8.0-1024.26 | USN-7304-1 |
| Ubuntu:22.04:LTS | linux-gcp-5.19 | no fix listed | UBUNTU-CVE-2024-47691 |
| Ubuntu:24.04:LTS | linux-gcp-6.11 | 6.11.0-1011.11~24.04.1 | UBUNTU-CVE-2024-47691 |
| Ubuntu:22.04:LTS | linux-gcp-6.2 | no fix listed | UBUNTU-CVE-2024-47691 |
| Ubuntu:22.04:LTS | linux-gcp-6.5 | no fix listed | UBUNTU-CVE-2024-47691 |
| Ubuntu:22.04:LTS | linux-gcp-6.8 | 6.8.0-1024.26~22.04.1 | USN-7303-3 |
| Ubuntu:22.04:LTS | linux-gcp-6.8 | 6.8.0-1024.26~22.04.1 | UBUNTU-CVE-2024-47691 |
| Ubuntu:22.04:LTS | linux-gke | 5.15.0-1094.100 | USN-7928-1 |
| Ubuntu:22.04:LTS | linux-gke | 5.15.0-1094.100 | UBUNTU-CVE-2024-47691 |
| Ubuntu:24.04:LTS | linux-gke | 6.8.0-1019.23 | USN-7304-1 |
| Ubuntu:24.04:LTS | linux-gke | 6.8.0-1019.23 | UBUNTU-CVE-2024-47691 |
| Ubuntu:22.04:LTS | linux-gkeop | 5.15.0-1081.89 | UBUNTU-CVE-2024-47691 |
| Ubuntu:22.04:LTS | linux-gkeop | 5.15.0-1081.89 | USN-7928-1 |
| Ubuntu:24.04:LTS | linux-gkeop | 6.8.0-1006.8 | USN-7304-1 |
| Ubuntu:24.04:LTS | linux-gkeop | 6.8.0-1006.8 | UBUNTU-CVE-2024-47691 |
| Ubuntu:22.04:LTS | linux-hwe-5.19 | no fix listed | UBUNTU-CVE-2024-47691 |
| Ubuntu:22.04:LTS | linux-hwe-6.2 | no fix listed | UBUNTU-CVE-2024-47691 |
| Ubuntu:22.04:LTS | linux-hwe-6.5 | no fix listed | UBUNTU-CVE-2024-47691 |
| Ubuntu:22.04:LTS | linux-hwe-6.8 | 6.8.0-57.59~22.04.1 | USN-7403-1 |
| Ubuntu:22.04:LTS | linux-hwe-6.8 | 6.8.0-57.59~22.04.1 | UBUNTU-CVE-2024-47691 |
| Ubuntu:22.04:LTS | linux-ibm | 5.15.0-1092.95 | UBUNTU-CVE-2024-47691 |
| Ubuntu:22.04:LTS | linux-ibm | 5.15.0-1092.95 | USN-7928-1 |
| Ubuntu:24.04:LTS | linux-ibm | 6.8.0-1022.22 | USN-7385-1 |
| Ubuntu:24.04:LTS | linux-ibm | 6.8.0-1022.22 | UBUNTU-CVE-2024-47691 |
| Ubuntu:22.04:LTS | linux-ibm-6.8 | 6.8.0-1023.23~22.04.1 | UBUNTU-CVE-2024-47691 |
| Ubuntu:22.04:LTS | linux-intel-iot-realtime | no fix listed | UBUNTU-CVE-2024-47691 |
| Ubuntu:22.04:LTS | linux-intel-iotg | 5.15.0-1093.99 | USN-7928-1 |
| Ubuntu:22.04:LTS | linux-intel-iotg | 5.15.0-1093.99 | UBUNTU-CVE-2024-47691 |
| Ubuntu:22.04:LTS | linux-kvm | 5.15.0-1090.95 | USN-7928-5 |
| Ubuntu:22.04:LTS | linux-kvm | 5.15.0-1090.95 | UBUNTU-CVE-2024-47691 |
| Ubuntu:22.04:LTS | linux-lowlatency | 5.15.0-164.174 | USN-7928-1 |
| Ubuntu:22.04:LTS | linux-lowlatency | 5.15.0-164.174 | UBUNTU-CVE-2024-47691 |
| Ubuntu:24.04:LTS | linux-lowlatency | 6.8.0-54.56.1 | UBUNTU-CVE-2024-47691 |
| Ubuntu:24.04:LTS | linux-lowlatency | 6.8.0-54.56.1 | USN-7301-1 |
| Ubuntu:22.04:LTS | linux-lowlatency-hwe-5.19 | no fix listed | UBUNTU-CVE-2024-47691 |
| Ubuntu:22.04:LTS | linux-lowlatency-hwe-6.2 | no fix listed | UBUNTU-CVE-2024-47691 |
| Ubuntu:22.04:LTS | linux-lowlatency-hwe-6.5 | no fix listed | UBUNTU-CVE-2024-47691 |
| Ubuntu:22.04:LTS | linux-lowlatency-hwe-6.8 | 6.8.0-54.56.1~22.04.1 | USN-7301-1 |
| Ubuntu:22.04:LTS | linux-lowlatency-hwe-6.8 | 6.8.0-54.56.1~22.04.1 | UBUNTU-CVE-2024-47691 |
| Ubuntu:22.04:LTS | linux-nvidia | 5.15.0-1093.94 | USN-7928-1 |
| Ubuntu:22.04:LTS | linux-nvidia | 5.15.0-1093.94 | UBUNTU-CVE-2024-47691 |
| Ubuntu:24.04:LTS | linux-nvidia | 6.8.0-1022.25 | USN-7303-1 |
| Ubuntu:24.04:LTS | linux-nvidia | 6.8.0-1022.25 | UBUNTU-CVE-2024-47691 |
| Ubuntu:24.04:LTS | linux-nvidia-6.11 | 6.11.0-1007.7 | UBUNTU-CVE-2024-47691 |
| Ubuntu:22.04:LTS | linux-nvidia-6.2 | no fix listed | UBUNTU-CVE-2024-47691 |
| Ubuntu:22.04:LTS | linux-nvidia-6.5 | no fix listed | UBUNTU-CVE-2024-47691 |
| Ubuntu:22.04:LTS | linux-nvidia-6.8 | 6.8.0-1022.25~22.04.2 | UBUNTU-CVE-2024-47691 |
| Ubuntu:22.04:LTS | linux-nvidia-6.8 | 6.8.0-1022.25~22.04.2 | USN-7303-1 |
| Ubuntu:24.04:LTS | linux-nvidia-lowlatency | 6.8.0-1022.25.2 | UBUNTU-CVE-2024-47691 |
| Ubuntu:24.04:LTS | linux-nvidia-lowlatency | 6.8.0-1022.25.2 | USN-7303-1 |
| Ubuntu:22.04:LTS | linux-nvidia-tegra | 5.15.0-1050.50 | UBUNTU-CVE-2024-47691 |
| Ubuntu:22.04:LTS | linux-nvidia-tegra | 5.15.0-1050.50 | USN-7928-1 |
| Ubuntu:22.04:LTS | linux-nvidia-tegra-igx | 5.15.0-1039.39 | USN-7928-1 |
| Ubuntu:22.04:LTS | linux-nvidia-tegra-igx | 5.15.0-1039.39 | UBUNTU-CVE-2024-47691 |
| Ubuntu:22.04:LTS | linux-oem-5.17 | no fix listed | UBUNTU-CVE-2024-47691 |
| Ubuntu:22.04:LTS | linux-oem-6.0 | no fix listed | UBUNTU-CVE-2024-47691 |
| Ubuntu:22.04:LTS | linux-oem-6.1 | no fix listed | UBUNTU-CVE-2024-47691 |
| Ubuntu:24.04:LTS | linux-oem-6.11 | 6.11.0-1015.15 | UBUNTU-CVE-2024-47691 |
| Ubuntu:24.04:LTS | linux-oem-6.11 | 6.11.0-1015.15 | USN-7310-1 |
| Ubuntu:22.04:LTS | linux-oem-6.5 | no fix listed | UBUNTU-CVE-2024-47691 |
| Ubuntu:24.04:LTS | linux-oem-6.8 | 6.8.0-1024.24 | UBUNTU-CVE-2024-47691 |
| Ubuntu:24.04:LTS | linux-oem-6.8 | 6.8.0-1024.24 | USN-7386-1 |
| 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-47691 |
| Ubuntu:24.04:LTS | linux-oracle | 6.8.0-1020.21 | UBUNTU-CVE-2024-47691 |
| Ubuntu:24.04:LTS | linux-oracle | 6.8.0-1020.21 | USN-7303-2 |
| Ubuntu:22.04:LTS | linux-oracle-6.5 | no fix listed | UBUNTU-CVE-2024-47691 |
| Ubuntu:22.04:LTS | linux-oracle-6.8 | 6.8.0-1020.21~22.04.1 | UBUNTU-CVE-2024-47691 |
| Ubuntu:22.04:LTS | linux-oracle-6.8 | 6.8.0-1020.21~22.04.1 | USN-7303-2 |
| 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-47691 |
| Ubuntu:24.04:LTS | linux-raspi | 6.8.0-1019.23 | USN-7303-3 |
| Ubuntu:24.04:LTS | linux-raspi | 6.8.0-1019.23 | UBUNTU-CVE-2024-47691 |
| Ubuntu:22.04:LTS | linux-realtime | no fix listed | UBUNTU-CVE-2024-47691 |
| Ubuntu:24.04:LTS | linux-realtime | no fix listed | UBUNTU-CVE-2024-47691 |
| Ubuntu:22.04:LTS | linux-riscv | no fix listed | UBUNTU-CVE-2024-47691 |
| Ubuntu:24.04:LTS | linux-riscv | 6.8.0-53.55.1 | UBUNTU-CVE-2024-47691 |
| Ubuntu:22.04:LTS | linux-riscv-5.19 | no fix listed | UBUNTU-CVE-2024-47691 |
| Ubuntu:22.04:LTS | linux-riscv-6.5 | no fix listed | UBUNTU-CVE-2024-47691 |
| Ubuntu:22.04:LTS | linux-riscv-6.8 | 6.8.0-53.55.1~22.04.1 | UBUNTU-CVE-2024-47691 |
| Ubuntu:22.04:LTS | linux-starfive-5.19 | no fix listed | UBUNTU-CVE-2024-47691 |
| Ubuntu:22.04:LTS | linux-starfive-6.2 | no fix listed | UBUNTU-CVE-2024-47691 |
| Ubuntu:22.04:LTS | linux-starfive-6.5 | no fix listed | UBUNTU-CVE-2024-47691 |
| Ubuntu:24.04:LTS | linux-xilinx | 6.8.0-1017.18 | UBUNTU-CVE-2024-47691 |
| 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-47691 |
Affected products (as reported)
| Vendor | Product | Versions |
|---|---|---|
| Linux | Linux | 7950e9ac638e84518fbdd5c930939ad46a1068c5 – before fc18e655b62ac6bc9f12f5de0d749b4a3fe1e8127950e9ac638e84518fbdd5c930939ad46a1068c5 – before 7c339dee7eb0f8e4cadc317c595f898ef04dae307950e9ac638e84518fbdd5c930939ad46a1068c5 – before d79343cd66343709e409d96b2abb139a0a55ce347950e9ac638e84518fbdd5c930939ad46a1068c5 – before c7f114d864ac91515bb07ac271e9824a20f5ed95 |
| Linux | Linux | 4.16 |