PT-2026-163053
CVE-2026-139012
·
Published
2026-11-30
·
Updated
2026-11-30
Description by
Score
N/A
Not availableNo severity ratings or metrics are available. When they are, we'll update the corresponding info on the page.
In the Linux kernel, the following vulnerability has been resolved:
f2fs: compress: fix to handle race between truncate and writeback
fsstress reports a kernel BUG in f2fs truncate partial cluster():
kernel BUG at fs/f2fs/compress.c:1238!
RIP: 0010:f2fs truncate partial cluster+0x292/0x2a0
Call Trace:
f2fs truncate+0xf6/0x210
f2fs setattr+0x6b7/0x770
notify change+0x33b/0x520
do truncate+0xc2/0xf0
vfs truncate+0x153/0x1d0
ksys truncate+0x78/0xd0
x64 sys truncate+0x16/0x20
do syscall 64+0xbe/0x540
The root cause is that Thread A (truncate) and Thread B (background
writeback or fsync) can race as follows:
Thread A Thread B
- f2fs setattr
- f2fs truncate
- f2fs truncate blocks
- f2fs truncate partial cluster
- f2fs is compressed cluster return 1 - f2fs write cache pages - f2fs write multi pages - f2fs write raw pages - f2fs write single data page dn.data blkaddr != COMPRESS ADDR (cluster converted to normal)
- f2fs prepare compress overwrite
- f2fs is compressed cluster return 0
- return 0
- f2fs bug on(sbi, err == 0): BUG!
Writeback path does not acquire i gc rwsem or filemap invalidate lock.
When a compressed cluster fails compression during writeback, it is
overwritten with raw data blocks. If Thread A checked
f2fs is compressed cluster() before the conversion, but calls
f2fs prepare compress overwrite() after the conversion,
f2fs prepare compress overwrite() returns 0 because the cluster is no
longer a compressed cluster.
To fix this, remove the f2fs bug on() and retry checking the cluster status
when f2fs prepare compress overwrite() returns 0, so that it can fall back
to f2fs do truncate blocks() to handle it as a normal cluster.
Found an issue in the description? Have something to add? Feel free to write us 👾