Message ID | 20230406111627.1916759-1-tudor.ambarus@linaro.org |
---|---|
State | New |
Headers | show |
Series | [RESEND] ext4: fix use-after-free Read in ext4_find_extent for bigalloc + inline | expand |
On Thu, 06 Apr 2023 11:16:27 +0000, Tudor Ambarus wrote: > Syzbot found the following issue: > loop0: detected capacity change from 0 to 2048 > EXT4-fs (loop0): mounted filesystem 00000000-0000-0000-0000-000000000000 without journal. Quota mode: none. > ================================================================== > BUG: KASAN: use-after-free in ext4_ext_binsearch_idx fs/ext4/extents.c:768 [inline] > BUG: KASAN: use-after-free in ext4_find_extent+0x76e/0xd90 fs/ext4/extents.c:931 > Read of size 4 at addr ffff888073644750 by task syz-executor420/5067 > > [...] Applied, thanks! [1/1] ext4: fix use-after-free Read in ext4_find_extent for bigalloc + inline commit: 835659598c67907b98cd2aa57bb951dfaf675c69 Best regards,
diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c index 3559ea6b0781..74251eebf831 100644 --- a/fs/ext4/extents.c +++ b/fs/ext4/extents.c @@ -5802,7 +5802,8 @@ int ext4_clu_mapped(struct inode *inode, ext4_lblk_t lclu) * mapped - no physical clusters have been allocated, and the * file has no extents */ - if (ext4_test_inode_state(inode, EXT4_STATE_MAY_INLINE_DATA)) + if (ext4_test_inode_state(inode, EXT4_STATE_MAY_INLINE_DATA) || + ext4_has_inline_data(inode)) return 0; /* search for the extent closest to the first block in the cluster */