From: Dave Chinner <david@fromorbit.com>
To: Ritesh Harjani <riteshh@linux.ibm.com>
Cc: syzbot <syzbot+a8e049cd3abd342936b6@syzkaller.appspotmail.com>,
djwong@kernel.org, fgheet255t@gmail.com, hch@infradead.org,
linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-xfs@vger.kernel.org,
syzkaller-bugs@googlegroups.com
Subject: Re: [syzbot] WARNING in iomap_iter
Date: Mon, 14 Feb 2022 13:58:49 +1100 [thread overview]
Message-ID: <20220214025849.GP59729@dread.disaster.area> (raw)
In-Reply-To: <20220213143410.qdqxlixuzgtq56yl@riteshh-domain>
On Sun, Feb 13, 2022 at 08:04:10PM +0530, Ritesh Harjani wrote:
> On 22/02/12 12:41PM, syzbot wrote:
> > syzbot has found a reproducer for the following issue on:
> >
> > HEAD commit: 83e396641110 Merge tag 'soc-fixes-5.17-1' of git://git.ker..
> > git tree: upstream
> > console output: https://syzkaller.appspot.com/x/log.txt?x=11fe01a4700000
> > kernel config: https://syzkaller.appspot.com/x/.config?x=88e0a6a3dbf057cf
> > dashboard link: https://syzkaller.appspot.com/bug?extid=a8e049cd3abd342936b6
> > compiler: Debian clang version 11.0.1-2, GNU ld (GNU Binutils for Debian) 2.35.2
> > syz repro: https://syzkaller.appspot.com/x/repro.syz?x=14f8cad2700000
> > C reproducer: https://syzkaller.appspot.com/x/repro.c?x=132c16ba700000
>
> FYI - I could reproduce with above C reproduer on my setup 5.17-rc3.
> I was also able to hit it with XFS <below stack shows that>
>
> So here is some initial analysis on this one. I haven't completely debugged it
> though. I am just putting my observations here for others too.
>
> It seems iomap_dio_rw is getting called with a negative iocb->ki_pos value.
> (I haven't yet looked into when can this happen. Is it due to negative loop
> device mapping range offset or something?)
>
> i.e.
> (gdb) p iocb->ki_pos
> $101 = -2147483648
> (gdb) p /x iocb->ki_pos
> $102 = 0xffffffff80000000
> (gdb)
>
> This when passed to ->iomap_begin() sometimes is resulting into iomap->offset
> which is a positive value and hence hitting below warn_on_once in
> iomap_iter_done().
>
> WARN_ON_ONCE(iter->iomap.offset > iter->pos)
>
> 1. So I think the question here is what does it mean when xfs/ext4_file_read_iter()
> is called with negative iocb->ki_pos value?
> 2. Also when can iocb->ki_pos be negative?
Sounds like a bug in the loop driver, not a problem with the iomap
DIO code. The IO path normally checks the position via
rw_verify_area() high up in the IO path, so by the time iocb->ki_pos
gets to filesystems and low level IO routines it's supposed to have
already been checked against overflows. Looks to me like the loop
driver is not checking the back end file position it calculates for
overflows...
Cheers,
Dave.
--
Dave Chinner
david@fromorbit.com
next prev parent reply other threads:[~2022-02-14 3:27 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-08 23:46 [syzbot] WARNING in iomap_iter syzbot
2021-11-09 7:20 ` Christoph Hellwig
2022-02-12 20:41 ` syzbot
2022-02-13 14:34 ` Ritesh Harjani
2022-02-14 2:58 ` Dave Chinner [this message]
2022-08-18 11:00 ` Siddh Raman Pant
2022-08-18 11:11 ` Siddh Raman Pant
2022-08-18 14:50 ` Matthew Wilcox
2022-08-18 15:21 ` Siddh Raman Pant
2022-08-21 6:29 ` hch
2022-08-21 11:27 ` Siddh Raman Pant
2022-08-21 11:48 ` Siddh Raman Pant
2022-08-21 20:59 ` syzbot
2022-08-22 14:45 ` Matthew Wilcox
2022-08-22 14:49 ` Siddh Raman Pant
2022-08-22 14:52 ` Matthew Wilcox
2022-08-22 15:02 ` Siddh Raman Pant
2022-08-23 15:21 ` Siddh Raman Pant
2022-08-23 15:28 ` Matthew Wilcox
2022-08-23 15:35 ` Siddh Raman Pant
2022-08-23 15:42 ` Matthew Wilcox
2022-08-23 15:54 ` syzbot
2022-08-23 15:38 ` syzbot
2022-08-18 19:30 ` syzbot
2022-08-18 19:09 ` syzbot
2022-11-14 11:50 ` Siddh Raman Pant
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220214025849.GP59729@dread.disaster.area \
--to=david@fromorbit.com \
--cc=djwong@kernel.org \
--cc=fgheet255t@gmail.com \
--cc=hch@infradead.org \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-xfs@vger.kernel.org \
--cc=riteshh@linux.ibm.com \
--cc=syzbot+a8e049cd3abd342936b6@syzkaller.appspotmail.com \
--cc=syzkaller-bugs@googlegroups.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox