[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YwOYMJrvBuoVye7R@casper.infradead.org>
Date: Mon, 22 Aug 2022 15:52:32 +0100
From: Matthew Wilcox <willy@...radead.org>
To: Siddh Raman Pant <code@...dh.me>
Cc: david <david@...morbit.com>, djwong <djwong@...nel.org>,
fgheet255t <fgheet255t@...il.com>, hch <hch@...radead.org>,
linux-ext4 <linux-ext4@...r.kernel.org>,
linux-fsdevel <linux-fsdevel@...r.kernel.org>,
linux-kernel <linux-kernel@...r.kernel.org>,
linux-xfs <linux-xfs@...r.kernel.org>,
riteshh <riteshh@...ux.ibm.com>,
syzbot+a8e049cd3abd342936b6
<syzbot+a8e049cd3abd342936b6@...kaller.appspotmail.com>,
syzkaller-bugs <syzkaller-bugs@...glegroups.com>
Subject: Re: [syzbot] WARNING in iomap_iter
On Mon, Aug 22, 2022 at 08:19:43PM +0530, Siddh Raman Pant wrote:
> On Mon, 22 Aug 2022 20:15:28 +0530 Matthew Wilcox wrote:
> > On Sun, Aug 21, 2022 at 05:18:16PM +0530, Siddh Raman Pant wrote:
> > > @@ -979,9 +979,15 @@ loop_set_status_from_info(struct loop_device *lo,
> > >
> > > lo->lo_offset = info->lo_offset;
> > > lo->lo_sizelimit = info->lo_sizelimit;
> > > + lo->lo_flags = info->lo_flags;
> > > +
> > > + /* loff_t/int vars are assigned __u64/__u32 vars (respectively) */
> > > + if (lo->lo_offset < 0 || lo->lo_sizelimit < 0 || lo->lo_flags < 0)
> > > + return -EOVERFLOW;
> >
> > Why would you check lo_flags? That really, really should be an unsigned
> > type.
>
> I agree, but the loop_device struct has (see line 54 of loop.c):
> int lo_flags;
>
> Thus, I checked for it, as we are not changing any types.
But it's not an integer. It's a bitfield. Nobody checks lo_flags for
"is it less than zero". That makes it very different from lo_offset.
Powered by blists - more mailing lists