Linux kernel -stable discussions
 help / color / mirror / Atom feed
* [PATCH 6.1.y 0/2] f2fs: compress: fix UAF of f2fs_inode_info in f2fs_free_dic
@ 2026-05-12  7:50 Bin Lan
  2026-05-12  7:50 ` [PATCH 6.1.y 1/2] f2fs: compress: change the first parameter of page_array_{alloc,free} to sbi Bin Lan
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Bin Lan @ 2026-05-12  7:50 UTC (permalink / raw)
  To: gregkh, sashal, stable
  Cc: linux-kernel, lanbincn, zhiguo.niu, baocong.liu, chao, jaegeuk,
	daehojeong

Hi,

This series backports a fix, a use-after-free vulnerability
in the F2FS compressed file decompression path, to linux-6.1.y.

The fix stores the sbi pointer and compress_algorithm directly in the
dic struct at allocation time, eliminating the need to dereference the
inode during asynchronous cleanup.

Patch 1 is a preparatory cleanup that changes page_array_alloc/free to
take sbi as the first parameter instead of the inode.

Patch 2 is the actual UAF fix that adds sbi and compress_algorithm
fields to decompress_io_ctx and replaces all late inode dereferences.

Both patches apply cleanly to linux-6.1.170. No logic changes are
needed beyond replacing F2FS_I_SB(dic->inode) with dic->sbi for v6.1.

Testing:
  - Verified on a 6.1.170-yocto-standard kernel with F2FS compression
    enabled (lzo, lz4, zstd).
  - Ran stress tests exercising concurrent read+unlink races, multi-reader
    unlink, and forced inode eviction during deferred dic free.
  - All 15 test cases passed with no crashes or errors.

Zhiguo Niu (2):
  f2fs: compress: change the first parameter of page_array_{alloc,free}
    to sbi
  f2fs: compress: fix UAF of f2fs_inode_info in f2fs_free_dic

 fs/f2fs/compress.c | 76 +++++++++++++++++++++++-----------------------
 fs/f2fs/f2fs.h     |  2 ++
 2 files changed, 40 insertions(+), 38 deletions(-)

-- 
2.43.0



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-05-12 14:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-12  7:50 [PATCH 6.1.y 0/2] f2fs: compress: fix UAF of f2fs_inode_info in f2fs_free_dic Bin Lan
2026-05-12  7:50 ` [PATCH 6.1.y 1/2] f2fs: compress: change the first parameter of page_array_{alloc,free} to sbi Bin Lan
2026-05-12  7:50 ` [PATCH 6.1.y 2/2] f2fs: compress: fix UAF of f2fs_inode_info in f2fs_free_dic Bin Lan
2026-05-12 14:45 ` [PATCH 6.1.y 0/2] " Sasha Levin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox