All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] bugfix for read_extent_tree_block
@ 2021-09-04  4:49 yangerkun
  2021-09-04  4:49 ` [PATCH 1/2] ext4: avoid recheck extent for EXT4_EX_FORCE_CACHE yangerkun
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: yangerkun @ 2021-09-04  4:49 UTC (permalink / raw)
  To: tytso, jack; +Cc: linux-ext4, yangerkun, yukuai3

Our stress testcase with io error can trigger later OOB:

    [59898.282466] BUG: KASAN: slab-out-of-bounds in ext4_find_extent+0x2e4/0x480
    ...
    [59898.287162] Call Trace:
    [59898.287575]  dump_stack+0x8b/0xb9
    [59898.288070]  print_address_description+0x73/0x280
    [59898.289903]  ext4_find_extent+0x2e4/0x480
    [59898.290553]  ext4_ext_map_blocks+0x125/0x1470
    [59898.295481]  ext4_map_blocks+0x5ee/0x940
    [59898.315984]  ext4_mpage_readpages+0x63c/0xdb0
    [59898.320231]  read_pages+0xe6/0x370
    [59898.321589]  __do_page_cache_readahead+0x233/0x2a0
    [59898.321594]  ondemand_readahead+0x157/0x450
    [59898.321598]  generic_file_read_iter+0xcb2/0x1550
    [59898.328828]  __vfs_read+0x233/0x360
    [59898.328840]  vfs_read+0xa5/0x190
    [59898.330126]  ksys_read+0xa5/0x150
    [59898.331405]  do_syscall_64+0x6d/0x1f0
    [59898.331418]  entry_SYSCALL_64_after_hwframe+0x44/0xa9

It seem that a xattr block with verified confuse read_extent_tree_block.

The detail of the patch show us how to fix it.

yangerkun (2):
  ext4: avoid recheck extent for EXT4_EX_FORCE_CACHE
  ext4: check magic even the extent block bh is verified

 fs/ext4/extents.c | 25 ++++++++++++++++++-------
 1 file changed, 18 insertions(+), 7 deletions(-)

-- 
2.31.1


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

end of thread, other threads:[~2021-10-25  1:10 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-04  4:49 [PATCH 0/2] bugfix for read_extent_tree_block yangerkun
2021-09-04  4:49 ` [PATCH 1/2] ext4: avoid recheck extent for EXT4_EX_FORCE_CACHE yangerkun
2021-10-01  9:04   ` Jan Kara
2021-09-04  4:49 ` [PATCH 2/2] ext4: check magic even the extent block bh is verified yangerkun
2021-10-01  9:18   ` Jan Kara
2021-10-01 14:09     ` Theodore Ts'o
2021-10-14  7:21       ` yangerkun
2021-10-25  1:10         ` yangerkun
2021-10-08  1:38     ` yangerkun
2021-09-24  9:32 ` [PATCH 0/2] bugfix for read_extent_tree_block yangerkun

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.