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
1455 if (atomic_add_return(bios, &io->pending_bios))1455 if (atomic_add_return(bios, &io->pending_bios))
1456 return;1456 return;
1457 if (z_erofs_in_atomic()) {1457 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;
1458#ifdef CONFIG_EROFS_FS_PCPU_KTHREAD1461#ifdef CONFIG_EROFS_FS_PCPU_KTHREAD
1459 struct kthread_worker *worker;1462 struct kthread_worker *worker;
1460 1463
@@ -1471,9 +1474,6 @@ static void z_erofs_decompress_kickoff(struct z_erofs_decompressqueue *io, · 10 unmodified lines
1471#else1474#else
1472 queue_work(z_erofs_workqueue, &io->u.work);1475 queue_work(z_erofs_workqueue, &io->u.work);
1473#endif1476#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;
1477 return;1477 return;
1478 }1478 }
1479 gfp_flag = memalloc_noio_save();1479 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
716 }716 }
717 717
718 if (map->m_algorithmformat < Z_EROFS_COMPRESSION_MAX) {718 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))) {
720 erofs_err(inode->i_sb, "inconsistent algorithmtype %u for nid %llu",720 erofs_err(inode->i_sb, "inconsistent algorithmtype %u for nid %llu",
721 map->m_algorithmformat, EROFS_I(inode)->nid);721 map->m_algorithmformat, EROFS_I(inode)->nid);
722 return -EFSCORRUPTED;722 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