History

Merge tag 'erofs-for-7.1-rc7-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs

Pull erofs fixes from Gao Xiang: - Fix a UAF of sbi->sync_decompress when compressed I/Os race with unmount - Fix a regression introduced this development cycle that incorrectly rejects multiple-algorithm images * tag 'erofs-for-7.1-rc7-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs: erofs: fix EFSCORRUPTED on multi-algorithm images in z_erofs_map_sanity_check() erofs: fix use-after-free on sbi->sync_decompress

Linus Torvalds committed 5 months ago

Commit 2b389a52 parents e4a9638 27f2d082 files · +4 −4Browse files

Unified · Split

2 files
  1. fs/erofs/zdata.c +3 −3
  2. fs/erofs/zmap.c +1 −1
fs/erofs/zdata.c+3−3
@@ -1455,6 +1455,9 @@ static void z_erofs_decompress_kickoff(struct z_erofs_decompressqueue *io, · 1454 unmodified lines
14551455 if (atomic_add_return(bios, &io->pending_bios))
14561456 return;
14571457 if (z_erofs_in_atomic()) {
1458+ /* See `sync_decompress` in sysfs-fs-erofs for more details */
1459+ if (sbi->sync_decompress == EROFS_SYNC_DECOMPRESS_AUTO)
1460+ sbi->sync_decompress = EROFS_SYNC_DECOMPRESS_FORCE_ON;
14581461 #ifdef CONFIG_EROFS_FS_PCPU_KTHREAD
14591462 struct kthread_worker *worker;
14601463
@@ -1471,9 +1474,6 @@ static void z_erofs_decompress_kickoff(struct z_erofs_decompressqueue *io, · 10 unmodified lines
14711474 #else
14721475 queue_work(z_erofs_workqueue, &io->u.work);
14731476 #endif
1474− /* See `sync_decompress` in sysfs-fs-erofs for more details */
1475− if (sbi->sync_decompress == EROFS_SYNC_DECOMPRESS_AUTO)
1476− sbi->sync_decompress = EROFS_SYNC_DECOMPRESS_FORCE_ON;
14771477 return;
14781478 }
14791479 gfp_flag = memalloc_noio_save();
fs/erofs/zmap.c+1−1
@@ -716,7 +716,7 @@ static int z_erofs_map_sanity_check(struct inode *inode, · 715 unmodified lines
716716 }
717717
718718 if (map->m_algorithmformat < Z_EROFS_COMPRESSION_MAX) {
719− if (sbi->available_compr_algs ^ BIT(map->m_algorithmformat)) {
719+ if (!(sbi->available_compr_algs & BIT(map->m_algorithmformat))) {
720720 erofs_err(inode->i_sb, "inconsistent algorithmtype %u for nid %llu",
721721 map->m_algorithmformat, EROFS_I(inode)->nid);
722722 return -EFSCORRUPTED;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t