CVE-2026-31702 json
f2fs: fix use-after-free of sbi in f2fs_compress_write_end_io()
published 2026-05-01 6 mo ago modified 2026-06-17 4 mo ago also EUVD-2026-26511
- cvss
- 7.8
- version 3.1, NVD
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- 0.1%
- EPSS 0.1% chance of exploitation in 30 days, percentile 1%
- public exploits
- 0
- none known
Summary
In the Linux kernel, the following vulnerability has been resolved:
f2fs: fix use-after-free of sbi in f2fs_compress_write_end_io()
In f2fs_compress_write_end_io(), dec_page_count(sbi, type) can bring the F2FS_WB_CP_DATA counter to zero, unblocking f2fs_wait_on_all_pages() in f2fs_put_super() on a concurrent unmount CPU. The unmount path then proceeds to call f2fs_destroy_page_array_cache(sbi), which destroys sbi->page_array_slab via kmem_cache_destroy(), and eventually kfree(sbi). Meanwhile, the bio completion callback is still executing: when it reaches page_array_free(sbi, ...), it dereferences sbi->page_array_slab — a destroyed slab cache — to call kmem_cache_free(), causing a use-after-free.
This is the same class of bug as CVE-2026-23234 (which fixed the equivalent race in f2fs_write_end_io() in data.c), but in the compressed writeback completion path that was not covered by that fix.
Fix this by moving dec_page_count() to after page_array_free(), so that all sbi accesses complete before the counter decrement that can unblock unmount. For non-last folios (where atomic_dec_return on cic->pending_pages is nonzero), dec_page_count is called immediately before returning — page_array_free is not reached on this path, so there is no post-decrement sbi access. For the last folio, page_array_free runs while the F2FS_WB_CP_DATA counter is still nonzero (this folio has not yet decremented it), keeping sbi alive, and dec_page_count runs as the final operation.
Patch / fix
- Linux Linux 6.1.175, 6.6.136, 6.12.84, 6.18.25, 7.0.2, 7.1
- linux Debian 12 6.1.176-1
- linux Debian 13 6.12.85-1
- linux Debian 14 7.0.3-1
debian advisories DEBIAN-CVE-2026-31702
- linux Ubuntu 24.04 LTS 6.8.0-136.136
- linux Ubuntu 26.04 LTS 7.0.0-27.27
- linux-aws Ubuntu 24.04 LTS 6.8.0-1061.64
- linux-aws Ubuntu 26.04 LTS 7.0.0-1008.8
- linux-gcp Ubuntu 24.04 LTS 6.8.0-1064.72
- linux-gcp Ubuntu 26.04 LTS 7.0.0-1007.7
- linux-gke Ubuntu 24.04 LTS 6.8.0-1059.67
- linux-ibm Ubuntu 24.04 LTS 6.8.0-1061.62
ubuntu advisories UBUNTU-CVE-2026-31702
Ubuntu security data © Canonical Ltd., from https://github.com/canonical/ubuntu-security-notices via OSV; changed: normalised to fixed package versions per release. CC BY-SA 4.0
- kernel-source openSUSE Tumbleweed 7.0.7-1.1
opensuse advisories openSUSE-SU-2026:10793-1
- git.kernel.org/stable/c/57bc678f36ac03281e877c6b84877b43f964143f commit
- git.kernel.org/stable/c/ef57cd3329b40c739b9a2e1a8a21ecc4171c6280 commit
- git.kernel.org/stable/c/f5154cf3ce1c8193f0c1891d3769f62740cfe6fe commit
- git.kernel.org/stable/c/c76cf339b87975ae5b2c06d2d774d5667d25a12a commit
- git.kernel.org/stable/c/2c97dcb6147c8f7f25c629b93be1e69617de5d4a commit
- git.kernel.org/stable/c/39d4ee19c1e7d753dd655aebee632271b171f43a commit
Vendor advisories
What the vendors themselves say about their products: affected, fixed or not affected, and what to do.
red hat product security vex CVE-2026-31702 updated
kernel: f2fs: fix use-after-free of sbi in f2fs_compress_write_end_io()
-
Red Hat Enterprise Linux 6 perf, kernel, python-perf, kernel-kdump, kernel-firmware, kernel-bootwrapper, +1 more Red Hat Enterprise Linux 7 perf, kernel, bpftool, kernel-rt, python-perf, kernel-kdump, +8 more Red Hat Enterprise Linux 8 perf, kernel, bpftool, kernel-rt, kernel-core, kernel-tools, +29 more Red Hat Enterprise Linux 9 rv, perf, rtla, kernel, bpftool, libperf, +83 more Red Hat Enterprise Linux 10 kernelnot affected: vulnerable code not present
Red Hat CSAF VEX © Red Hat, Inc., from https://security.access.redhat.com/data/csaf/v2/vex/; changed: reduced to product statuses and remediations. CC BY 4.0 · csaf
Exploit prediction
0.12% chance of exploitation in the next 30 days, higher than 1% of all scored CVEs (FIRST EPSS, 2026-11-08).
CVSS scores
| assigned by | version | score | vector |
|---|---|---|---|
| NVD | 3.1 | 7.8 | CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H |
Affected products
- Linux Linux
Classification
- Weakness
-
- CWE-416 Use After Free
- Technology feeds
References
- git.kernel.org /stable/c/57bc678f36ac03281e877c6b84877b43f964143f
-
git.kernel.org
/stable/c/ef57cd3329b40c739b9a2e1a8a21ecc4171c6280
patch
-
git.kernel.org
/stable/c/f5154cf3ce1c8193f0c1891d3769f62740cfe6fe
patch
-
git.kernel.org
/stable/c/c76cf339b87975ae5b2c06d2d774d5667d25a12a
patch
-
git.kernel.org
/stable/c/2c97dcb6147c8f7f25c629b93be1e69617de5d4a
patch
-
git.kernel.org
/stable/c/39d4ee19c1e7d753dd655aebee632271b171f43a
patch
Sources
- CVE List CVE-2026-31702
- NVD CVE-2026-31702
Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.