Re: WARNING in iomap_apply

From: Matthew Wilcox
Date: Sat Apr 11 2020 - 12:14:44 EST


On Sat, Apr 11, 2020 at 12:39:13AM -0700, syzbot wrote:
> The bug was bisected to:
>
> commit d3b6f23f71670007817a5d59f3fbafab2b794e8c
> Author: Ritesh Harjani <riteshh@xxxxxxxxxxxxx>
> Date: Fri Feb 28 09:26:58 2020 +0000
>
> ext4: move ext4_fiemap to use iomap framework
>
> bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=16c62a57e00000
> final crash: https://syzkaller.appspot.com/x/report.txt?x=15c62a57e00000
> console output: https://syzkaller.appspot.com/x/log.txt?x=11c62a57e00000
>
> IMPORTANT: if you fix the bug, please add the following tag to the commit:
> Reported-by: syzbot+77fa5bdb65cc39711820@xxxxxxxxxxxxxxxxxxxxxxxxx
> Fixes: d3b6f23f7167 ("ext4: move ext4_fiemap to use iomap framework")
>
> ------------[ cut here ]------------
> WARNING: CPU: 0 PID: 7023 at fs/iomap/apply.c:51 iomap_apply+0xa0c/0xcb0 fs/iomap/apply.c:51

This is:

if (WARN_ON(iomap.length == 0))
return -EIO;

and the call trace contains ext4_fiemap() so the syzbot bisection looks
correct.

> iomap_fiemap+0x184/0x2c0 fs/iomap/fiemap.c:88
> _ext4_fiemap+0x178/0x4f0 fs/ext4/extents.c:4860
> ovl_fiemap+0x13f/0x200 fs/overlayfs/inode.c:467
> ioctl_fiemap fs/ioctl.c:226 [inline]
> do_vfs_ioctl+0x8d7/0x12d0 fs/ioctl.c:715