Re: WARNING in iov_iter_pipe

From: Matthew Bobrowski
Date: Mon Nov 11 2019 - 03:16:40 EST


On Fri, Nov 08, 2019 at 11:31:48AM +0100, Jan Kara wrote:
> On Thu 07-11-19 10:54:10, syzbot wrote:
> > syzbot found the following crash on:
> >
> > HEAD commit: c68c5373 Add linux-next specific files for 20191107
> > git tree: linux-next
> > console output: https://syzkaller.appspot.com/x/log.txt?x=13d6bcfce00000
> > kernel config: https://syzkaller.appspot.com/x/.config?x=742545dcdea21726
> > dashboard link: https://syzkaller.appspot.com/bug?extid=991400e8eba7e00a26e1
> > compiler: gcc (GCC) 9.0.0 20181231 (experimental)
> > syz repro: https://syzkaller.appspot.com/x/repro.syz?x=1529829ae00000
> > C reproducer: https://syzkaller.appspot.com/x/repro.c?x=16a55c0ce00000
> >
> > The bug was bisected to:
> >
> > commit b1b4705d54abedfd69dcdf42779c521aa1e0fbd3
> > Author: Matthew Bobrowski <mbobrowski@xxxxxxxxxxxxxx>
> > Date: Tue Nov 5 12:01:37 2019 +0000
> >
> > ext4: introduce direct I/O read using iomap infrastructure
>
> Hum, interesting and from the first looks the problem looks real.
> Deciphered reproducer is:
>
> int fd0 = open("./file0", O_RDWR | O_CREAT | O_EXCL | O_DIRECT, 0);
> int fd1 = open("./file0, O_RDONLY);
> write(fd0, "some_data...", 512);
> sendfile(fd0, fd1, NULL, 0x7fffffa7);
> -> this is interesting as it will result in reading data from 'file0' at
> offset X with buffered read and writing them with direct write to
> offset X+512. So this way we'll grow the file up to those ~2GB in
> 512-byte chunks.
> - not sure if we ever get there but the remainder of the reproducer is:
> fd2 = open("./file0", O_RDWR | O_CREAT | O_NOATIME | O_SYNC, 0);
> sendfile(fd2, fd0, NULL, 0xffffffff)
> -> doesn't seem too interesting as fd0 is at EOF so this shouldn't do
> anything.
>
> Matthew, can you have a look?

Sorry Jan, I've been crazy busy lately and I'm out at training this
week. Let me take a look at this and see whether I can determine
what's happening here.

/M