Vulnerability · Published Jul 4, 2025 · Assigned by Linux
CVE-2025-38218f2fs: fix to do sanity check on sit_bitmap_size
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 8% 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 do sanity check on sit_bitmap_size w/ below testcase, resize will generate a corrupted image which contains inconsistent metadata, so when mounting such image, it will trigger kernel panic: touch img truncate -s $((512*1024*1024*1024)) img mkfs.f2fs -f img $((256*1024*1024)) resize.f2fs -s -i img -t $((1024*1024*1024)) mount img /mnt/f2fs ------------[ cut here ]------------ kernel BUG at fs/f2fs/segment.h:863! Oops: invalid opcode: 0000 [#1] SMP PTI CPU: 11 UID: 0 PID: 3922 Comm: mount Not tainted 6.15.0-rc1+ #191 PREEMPT(voluntary) Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 RIP: 0010:f2fs_ra_meta_pages+0x47c/0x490 Call Trace: f2fs_build_segment_manager+0x11c3/0x2600 f2fs_fill_super+0xe97/0x2840 mount_bdev+0xf4/0x140 legacy_get_tree+0x2b/0x50 vfs_get_tree+0x29/0xd0 path_mount+0x487/0xaf0 __x64_sys_mount+0x116/0x150 do_syscall_64+0x82/0x190 entry_SYSCALL_64_after_hwframe+0x76/0x7e RIP: 0033:0x7fdbfde1bcfe The reaseon is: sit_i->bitmap_size is 192, so size of sit bitmap is 192*8=1536, at maximum there are 1536 sit blocks, however MAIN_SEGS is 261893, so that sit_blk_cnt is 4762, build_sit_entries() -> current_sit_addr() tries to access out-of-boundary in sit_bitmap at offset from [1536, 4762), once sit_bitmap and sit_bitmap_mirror is not the same, it will trigger f2fs_bug_on(). Let's add sanity check in f2fs_sanity_check_ckpt() to avoid panic.
Affected packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian:12 | linux | 6.1.147-1 | DEBIAN-CVE-2025-38218 |
| Debian:13 | linux | 6.12.35-1 | DEBIAN-CVE-2025-38218 |
| Debian:14 | linux | 6.12.35-1 | DEBIAN-CVE-2025-38218 |
| Ubuntu:22.04:LTS | linux | 5.15.0-156.166 | UBUNTU-CVE-2025-38218 |
| Ubuntu:24.04:LTS | linux | 6.8.0-100.100 | UBUNTU-CVE-2025-38218 |
| Ubuntu:22.04:LTS | linux-allwinner-5.19 | no fix listed | UBUNTU-CVE-2025-38218 |
| Ubuntu:22.04:LTS | linux-aws | 5.15.0-1092.99 | UBUNTU-CVE-2025-38218 |
| Ubuntu:24.04:LTS | linux-aws | 6.8.0-1046.49 | UBUNTU-CVE-2025-38218 |
| Ubuntu:22.04:LTS | linux-aws-5.19 | no fix listed | UBUNTU-CVE-2025-38218 |
| Ubuntu:24.04:LTS | linux-aws-6.14 | 6.14.0-1015.15~24.04.1 | UBUNTU-CVE-2025-38218 |
| Ubuntu:24.04:LTS | linux-aws-6.14 | 6.14.0-1015.15~24.04.1 | USN-7833-3 |
| Ubuntu:22.04:LTS | linux-aws-6.2 | no fix listed | UBUNTU-CVE-2025-38218 |
| Ubuntu:22.04:LTS | linux-aws-6.5 | no fix listed | UBUNTU-CVE-2025-38218 |
| Ubuntu:22.04:LTS | linux-aws-6.8 | 6.8.0-1046.49~22.04.1 | UBUNTU-CVE-2025-38218 |
| Ubuntu:22.04:LTS | linux-azure | 5.15.0-1096.105 | UBUNTU-CVE-2025-38218 |
| Ubuntu:24.04:LTS | linux-azure | 6.8.0-1046.52 | UBUNTU-CVE-2025-38218 |
| Ubuntu:22.04:LTS | linux-azure-5.19 | no fix listed | UBUNTU-CVE-2025-38218 |
| Ubuntu:24.04:LTS | linux-azure-6.11 | no fix listed | UBUNTU-CVE-2025-38218 |
| Ubuntu:24.04:LTS | linux-azure-6.14 | 6.14.0-1014.14~24.04.1 | UBUNTU-CVE-2025-38218 |
| Ubuntu:24.04:LTS | linux-azure-6.14 | 6.14.0-1014.14~24.04.1 | USN-7834-1 |
| Ubuntu:22.04:LTS | linux-azure-6.2 | no fix listed | UBUNTU-CVE-2025-38218 |
| Ubuntu:22.04:LTS | linux-azure-6.5 | no fix listed | UBUNTU-CVE-2025-38218 |
| Ubuntu:22.04:LTS | linux-azure-6.8 | 6.8.0-1051.57~22.04.1 | UBUNTU-CVE-2025-38218 |
| Ubuntu:22.04:LTS | linux-azure-fde | 5.15.0-1096.105.1 | UBUNTU-CVE-2025-38218 |
| Ubuntu:24.04:LTS | linux-azure-fde | 6.8.0-1046.53 | UBUNTU-CVE-2025-38218 |
| Ubuntu:25.10 | linux-azure-fde | no fix listed | UBUNTU-CVE-2025-38218 |
| Ubuntu:22.04:LTS | linux-azure-fde-5.19 | no fix listed | UBUNTU-CVE-2025-38218 |
| Ubuntu:22.04:LTS | linux-azure-fde-6.2 | no fix listed | UBUNTU-CVE-2025-38218 |
| Ubuntu:22.04:LTS | linux-azure-fde-6.8 | 6.8.0-1046.53~22.04.1 | UBUNTU-CVE-2025-38218 |
| Ubuntu:24.04:LTS | linux-azure-nvidia | no fix listed | UBUNTU-CVE-2025-38218 |
| Ubuntu:24.04:LTS | linux-azure-nvidia-6.14 | 6.14.0-1007.7 | UBUNTU-CVE-2025-38218 |
| Ubuntu:24.04:LTS | linux-azure-nvidia-6.14 | 6.14.0-1007.7 | USN-7834-1 |
| Ubuntu:22.04:LTS | linux-gcp | 5.15.0-1092.101 | UBUNTU-CVE-2025-38218 |
| Ubuntu:24.04:LTS | linux-gcp | 6.8.0-1047.50 | UBUNTU-CVE-2025-38218 |
| Ubuntu:22.04:LTS | linux-gcp-5.19 | no fix listed | UBUNTU-CVE-2025-38218 |
| Ubuntu:24.04:LTS | linux-gcp-6.11 | no fix listed | UBUNTU-CVE-2025-38218 |
| Ubuntu:24.04:LTS | linux-gcp-6.14 | 6.14.0-1018.19~24.04.1 | UBUNTU-CVE-2025-38218 |
| Ubuntu:24.04:LTS | linux-gcp-6.14 | 6.14.0-1018.19~24.04.1 | USN-7833-4 |
| Ubuntu:22.04:LTS | linux-gcp-6.2 | no fix listed | UBUNTU-CVE-2025-38218 |
| Ubuntu:22.04:LTS | linux-gcp-6.5 | no fix listed | UBUNTU-CVE-2025-38218 |
| Ubuntu:22.04:LTS | linux-gcp-6.8 | 6.8.0-1047.50~22.04.2 | UBUNTU-CVE-2025-38218 |
| Ubuntu:22.04:LTS | linux-gke | 5.15.0-1089.95 | UBUNTU-CVE-2025-38218 |
| Ubuntu:24.04:LTS | linux-gke | 6.8.0-1043.48 | UBUNTU-CVE-2025-38218 |
| Ubuntu:22.04:LTS | linux-gkeop | 5.15.0-1075.83 | UBUNTU-CVE-2025-38218 |
| Ubuntu:24.04:LTS | linux-gkeop | 6.8.0-1030.33 | UBUNTU-CVE-2025-38218 |
| Ubuntu:22.04:LTS | linux-hwe-5.19 | no fix listed | UBUNTU-CVE-2025-38218 |
| Ubuntu:24.04:LTS | linux-hwe-6.11 | no fix listed | UBUNTU-CVE-2025-38218 |
| Ubuntu:24.04:LTS | linux-hwe-6.14 | 6.14.0-34.34~24.04.1 | USN-7856-1 |
| Ubuntu:22.04:LTS | linux-hwe-6.2 | no fix listed | UBUNTU-CVE-2025-38218 |
| Ubuntu:22.04:LTS | linux-hwe-6.5 | no fix listed | UBUNTU-CVE-2025-38218 |
| Ubuntu:22.04:LTS | linux-hwe-6.8 | 6.8.0-100.100~22.04.1 | UBUNTU-CVE-2025-38218 |
| Ubuntu:22.04:LTS | linux-ibm | 5.15.0-1086.89 | UBUNTU-CVE-2025-38218 |
| Ubuntu:24.04:LTS | linux-ibm | 6.8.0-1044.44 | UBUNTU-CVE-2025-38218 |
| Ubuntu:22.04:LTS | linux-ibm-6.8 | 6.8.0-1044.44~22.04.1 | UBUNTU-CVE-2025-38218 |
| Ubuntu:24.04:LTS | linux-intel | no fix listed | UBUNTU-CVE-2025-38218 |
| Ubuntu:22.04:LTS | linux-intel-iot-realtime | no fix listed | UBUNTU-CVE-2025-38218 |
| Ubuntu:22.04:LTS | linux-intel-iotg | 5.15.0-1087.93 | UBUNTU-CVE-2025-38218 |
| Ubuntu:22.04:LTS | linux-kvm | 5.15.0-1088.93 | UBUNTU-CVE-2025-38218 |
| Ubuntu:22.04:LTS | linux-lowlatency | 5.15.0-156.166 | UBUNTU-CVE-2025-38218 |
| Ubuntu:24.04:LTS | linux-lowlatency | 6.8.0-100.100.1 | UBUNTU-CVE-2025-38218 |
| Ubuntu:22.04:LTS | linux-lowlatency-hwe-5.19 | no fix listed | UBUNTU-CVE-2025-38218 |
| Ubuntu:24.04:LTS | linux-lowlatency-hwe-6.11 | no fix listed | UBUNTU-CVE-2025-38218 |
| Ubuntu:22.04:LTS | linux-lowlatency-hwe-6.2 | no fix listed | UBUNTU-CVE-2025-38218 |
| Ubuntu:22.04:LTS | linux-lowlatency-hwe-6.5 | no fix listed | UBUNTU-CVE-2025-38218 |
| Ubuntu:22.04:LTS | linux-lowlatency-hwe-6.8 | 6.8.0-100.100.1~22.04.1 | UBUNTU-CVE-2025-38218 |
| Ubuntu:22.04:LTS | linux-nvidia | 5.15.0-1087.88 | UBUNTU-CVE-2025-38218 |
| Ubuntu:24.04:LTS | linux-nvidia | 6.8.0-1046.49 | UBUNTU-CVE-2025-38218 |
| Ubuntu:24.04:LTS | linux-nvidia-6.11 | no fix listed | UBUNTU-CVE-2025-38218 |
| Ubuntu:22.04:LTS | linux-nvidia-6.2 | no fix listed | UBUNTU-CVE-2025-38218 |
| Ubuntu:22.04:LTS | linux-nvidia-6.5 | no fix listed | UBUNTU-CVE-2025-38218 |
| Ubuntu:22.04:LTS | linux-nvidia-6.8 | 6.8.0-1046.49~22.04.1 | UBUNTU-CVE-2025-38218 |
| Ubuntu:24.04:LTS | linux-nvidia-lowlatency | 6.8.0-1046.49.1 | UBUNTU-CVE-2025-38218 |
| Ubuntu:22.04:LTS | linux-nvidia-tegra | 5.15.0-1045.45 | UBUNTU-CVE-2025-38218 |
| Ubuntu:24.04:LTS | linux-nvidia-tegra | 6.8.0-1020.20 | UBUNTU-CVE-2025-38218 |
| Ubuntu:22.04:LTS | linux-nvidia-tegra-igx | 5.15.0-1034.34 | UBUNTU-CVE-2025-38218 |
| Ubuntu:22.04:LTS | linux-oem-5.17 | no fix listed | UBUNTU-CVE-2025-38218 |
| Ubuntu:22.04:LTS | linux-oem-6.0 | no fix listed | UBUNTU-CVE-2025-38218 |
| Ubuntu:22.04:LTS | linux-oem-6.1 | no fix listed | UBUNTU-CVE-2025-38218 |
| Ubuntu:24.04:LTS | linux-oem-6.11 | no fix listed | UBUNTU-CVE-2025-38218 |
| Ubuntu:24.04:LTS | linux-oem-6.14 | 6.14.0-1014.14 | USN-7833-1 |
| Ubuntu:24.04:LTS | linux-oem-6.14 | 6.14.0-1014.14 | UBUNTU-CVE-2025-38218 |
| Ubuntu:22.04:LTS | linux-oem-6.5 | no fix listed | UBUNTU-CVE-2025-38218 |
| Ubuntu:24.04:LTS | linux-oem-6.8 | no fix listed | UBUNTU-CVE-2025-38218 |
| Ubuntu:22.04:LTS | linux-oracle | 5.15.0-1090.96 | UBUNTU-CVE-2025-38218 |
| Ubuntu:24.04:LTS | linux-oracle | 6.8.0-1043.44 | UBUNTU-CVE-2025-38218 |
| Ubuntu:24.04:LTS | linux-oracle-6.14 | 6.14.0-1015.15~24.04.1 | USN-7833-1 |
| Ubuntu:24.04:LTS | linux-oracle-6.14 | 6.14.0-1015.15~24.04.1 | UBUNTU-CVE-2025-38218 |
| Ubuntu:22.04:LTS | linux-oracle-6.5 | no fix listed | UBUNTU-CVE-2025-38218 |
| Ubuntu:22.04:LTS | linux-oracle-6.8 | 6.8.0-1043.44~22.04.1 | UBUNTU-CVE-2025-38218 |
| Ubuntu:22.04:LTS | linux-raspi | 5.15.0-1086.89 | UBUNTU-CVE-2025-38218 |
| Ubuntu:24.04:LTS | linux-raspi | 6.8.0-1047.51 | UBUNTU-CVE-2025-38218 |
| Ubuntu:24.04:LTS | linux-raspi-realtime | no fix listed | UBUNTU-CVE-2025-38218 |
| Ubuntu:22.04:LTS | linux-realtime | no fix listed | UBUNTU-CVE-2025-38218 |
| Ubuntu:24.04:LTS | linux-realtime | no fix listed | UBUNTU-CVE-2025-38218 |
| Ubuntu:22.04:LTS | linux-riscv | no fix listed | UBUNTU-CVE-2025-38218 |
| Ubuntu:24.04:LTS | linux-riscv | no fix listed | UBUNTU-CVE-2025-38218 |
| Ubuntu:22.04:LTS | linux-riscv-5.19 | no fix listed | UBUNTU-CVE-2025-38218 |
| Ubuntu:24.04:LTS | linux-riscv-6.14 | 6.14.0-34.34.1~24.04.1 | UBUNTU-CVE-2025-38218 |
| Ubuntu:22.04:LTS | linux-riscv-6.5 | no fix listed | UBUNTU-CVE-2025-38218 |
| Ubuntu:22.04:LTS | linux-riscv-6.8 | 6.8.0-100.100~22.04.1 | UBUNTU-CVE-2025-38218 |
| Ubuntu:22.04:LTS | linux-starfive-5.19 | no fix listed | UBUNTU-CVE-2025-38218 |
| Ubuntu:22.04:LTS | linux-starfive-6.2 | no fix listed | UBUNTU-CVE-2025-38218 |
| Ubuntu:22.04:LTS | linux-starfive-6.5 | no fix listed | UBUNTU-CVE-2025-38218 |
| Ubuntu:24.04:LTS | linux-xilinx | 6.8.0-1023.24 | UBUNTU-CVE-2025-38218 |
| Ubuntu:22.04:LTS | linux-xilinx-zynqmp | 5.15.0-1056.60 | UBUNTU-CVE-2025-38218 |
Affected products (as reported)
| Vendor | Product | Versions |
|---|---|---|
| Linux | Linux | 98e4da8ca301e062d79ae168c67e56f3c3de3ce4 – before 82f51bff393e4c12cf4de553120ca831cfa4ef1998e4da8ca301e062d79ae168c67e56f3c3de3ce4 – before 38ef48a8afef8df646b6f6ae7abb872f18b533c198e4da8ca301e062d79ae168c67e56f3c3de3ce4 – before ad862f71016ba38039df1c96ed55c0a4314cc18398e4da8ca301e062d79ae168c67e56f3c3de3ce4 – before 79ef8a6c4ec53d327580fd7d2b522cf4f1d05b0c98e4da8ca301e062d79ae168c67e56f3c3de3ce4 – before ee1b421c469876544e297ec1090574bd7610024798e4da8ca301e062d79ae168c67e56f3c3de3ce4 – before 3e5ac62a56a24f4d88ce8ffd7bc452428b23586898e4da8ca301e062d79ae168c67e56f3c3de3ce4 – before 5db0d252c64e91ba1929c70112352e85dc5751e7 |
| Linux | Linux | 3.8 |
References
- https://git.kernel.org/stable/c/82f51bff393e4c12cf4de553120ca831cfa4ef19
- https://git.kernel.org/stable/c/38ef48a8afef8df646b6f6ae7abb872f18b533c1
- https://git.kernel.org/stable/c/ad862f71016ba38039df1c96ed55c0a4314cc183
- https://git.kernel.org/stable/c/79ef8a6c4ec53d327580fd7d2b522cf4f1d05b0c
- https://git.kernel.org/stable/c/ee1b421c469876544e297ec1090574bd76100247
- https://git.kernel.org/stable/c/3e5ac62a56a24f4d88ce8ffd7bc452428b235868
- https://git.kernel.org/stable/c/5db0d252c64e91ba1929c70112352e85dc5751e7
- https://lists.debian.org/debian-lts-announce/2025/10/msg00008.html
- https://lists.debian.org/debian-lts-announce/2025/10/msg00007.html