# CVE-2025-68772: f2fs: fix to avoid updating compression context during writeback

- Priority: **Routine**
- Reason: Not severe (CVSS 5.7, local access); no exploitation reported by the 5 checked sources
- Next step: Fix in the normal cadence
- Status: published
- Published: 2026-01-13 · Modified: 2026-05-11
- Aliases: UBUNTU-CVE-2025-68772, DEBIAN-CVE-2025-68772
- Record: https://cvemate.com/vulnerability/CVE-2025-68772 · JSON: https://cvemate.com/vulnerability/CVE-2025-68772/json

## Description

```text
In the Linux kernel, the following vulnerability has been resolved:

f2fs: fix to avoid updating compression context during writeback

Bai, Shuangpeng <sjb7183@psu.edu> reported a bug as below:

Oops: divide error: 0000 [#1] SMP KASAN PTI
CPU: 0 UID: 0 PID: 11441 Comm: syz.0.46 Not tainted 6.17.0 #1 PREEMPT(full)
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.15.0-1 04/01/2014
RIP: 0010:f2fs_all_cluster_page_ready+0x106/0x550 fs/f2fs/compress.c:857
Call Trace:
 <TASK>
 f2fs_write_cache_pages fs/f2fs/data.c:3078 [inline]
 __f2fs_write_data_pages fs/f2fs/data.c:3290 [inline]
 f2fs_write_data_pages+0x1c19/0x3600 fs/f2fs/data.c:3317
 do_writepages+0x38e/0x640 mm/page-writeback.c:2634
 filemap_fdatawrite_wbc mm/filemap.c:386 [inline]
 __filemap_fdatawrite_range mm/filemap.c:419 [inline]
 file_write_and_wait_range+0x2ba/0x3e0 mm/filemap.c:794
 f2fs_do_sync_file+0x6e6/0x1b00 fs/f2fs/file.c:294
 generic_write_sync include/linux/fs.h:3043 [inline]
 f2fs_file_write_iter+0x76e/0x2700 fs/f2fs/file.c:5259
 new_sync_write fs/read_write.c:593 [inline]
 vfs_write+0x7e9/0xe00 fs/read_write.c:686
 ksys_write+0x19d/0x2d0 fs/read_write.c:738
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xf7/0x470 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

The bug was triggered w/ below race condition:

fsync				setattr			ioctl
- f2fs_do_sync_file
 - file_write_and_wait_range
  - f2fs_write_cache_pages
  : inode is non-compressed
  : cc.cluster_size =
    F2FS_I(inode)->i_cluster_size = 0
   - tag_pages_for_writeback
				- f2fs_setattr
				 - truncate_setsize
				 - f2fs_truncate
							- f2fs_fileattr_set
							 - f2fs_setflags_common
							  - set_compress_context
							  : F2FS_I(inode)->i_cluster_size = 4
							  : set_inode_flag(inode, FI_COMPRESSED_FILE)
   - f2fs_compressed_file
   : return true
   - f2fs_all_cluster_page_ready
   : "pgidx % cc->cluster_size" trigger dividing 0 issue

Let's change as below to fix this issue:
- introduce a new atomic type variable .writeback in structure f2fs_inode_info
to track the number of threads which calling f2fs_write_cache_pages().
- use .i_sem lock to protect .writeback update.
- check .writeback before update compression context in f2fs_setflags_common()
to avoid race w/ ->writepages.
```

## Signals

- CVSS: 5.7 medium (v4.0, OSV · Ubuntu) CVSS:4.0/AV:L/AC:L/AT:P/PR:L/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N
- EPSS: 0.199%, percentile 10.25%, as of 2026-12-04
- Known exploited (KEV): CISA not listed, ENISA not listed, CIRCL not listed
- Ransomware use: none recorded
- Public exploits: 0

## Affected (first 20 of 148)

- debian linux (Debian): \< 6.1.162-1 \| \< 6.12.69-1 \| \< 6.18.3-1
- ubuntu linux (Ubuntu): All versions (No fix recorded) \| \< 6.8.0-110.110 \| \< 6.17.0-22.22
- ubuntu linux-allwinner-5.19 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws (Ubuntu): All versions (No fix recorded) \| \< 6.8.0-1052.55 \| \< 6.17.0-1012.12
- ubuntu linux-aws-5.0 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.11 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.13 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.15 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.19 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.3 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-5.8 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-6.14 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-6.17 (Ubuntu): \< 6.17.0-1012.12~24.04.1
- ubuntu linux-aws-6.2 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-6.5 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws-6.8 (Ubuntu): \< 6.8.0-1052.55~22.04.1
- ubuntu linux-aws-fips (Ubuntu): All versions (No fix recorded) \| \< 6.8.0-1052.55+fips1
- ubuntu linux-azure (Ubuntu): All versions (No fix recorded) \| \< 6.8.0-1054.60 \| \< 6.17.0-1013.13
- ubuntu linux-azure-5.11 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-azure-5.13 (Ubuntu): All versions (No fix recorded)

## References (first 20 of 30)

- <https://git.kernel.org/stable/c/ad26bfbc085c939b5dca77ff8c14798c06d151c4>
- <https://git.kernel.org/stable/c/bcd0086ee5a2e88c1224ff2ec1e4a43c83efe5a0>
- <https://git.kernel.org/stable/c/0bf1a02494c7eb5bd43445de4c83c8592e02c4bf>
- <https://git.kernel.org/stable/c/0df713a9c082a474c8b0bcf670edc8e98461d5a0>
- <https://git.kernel.org/stable/c/10b591e7fb7cdc8c1e53e9c000dc0ef7069aaa76>
- <https://ubuntu.com/security/CVE-2025-68772>
- <https://www.cve.org/CVERecord?id=CVE-2025-68772>
- <https://git.kernel.org/linus/10b591e7fb7cdc8c1e53e9c000dc0ef7069aaa76>
- <https://ubuntu.com/security/notices/USN-8177-1>
- <https://ubuntu.com/security/notices/USN-8179-1>
- <https://ubuntu.com/security/notices/USN-8177-2>
- <https://ubuntu.com/security/notices/USN-8183-1>
- <https://ubuntu.com/security/notices/USN-8184-1>
- <https://ubuntu.com/security/notices/USN-8179-2>
- <https://ubuntu.com/security/notices/USN-8185-1>
- <https://ubuntu.com/security/notices/USN-8183-2>
- <https://ubuntu.com/security/notices/USN-8179-3>
- <https://ubuntu.com/security/notices/USN-8203-1>
- <https://ubuntu.com/security/notices/USN-8204-1>
- <https://ubuntu.com/security/notices/USN-8185-2>

---

Data as of 2026-12-05T04:02:55.761Z. The priority label is CveMate's own model from public evidence, not an official rating, and it knows nothing about your assets. How labels are decided: https://cvemate.com/faq#priority
