[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180329154123.GC4804@magnolia>
Date: Thu, 29 Mar 2018 08:41:23 -0700
From: "Darrick J. Wong" <darrick.wong@...cle.com>
To: Jan Kara <jack@...e.cz>
Cc: Eryu Guan <guaneryu@...il.com>, Ted Tso <tytso@....edu>,
linux-ext4@...r.kernel.org, Jiri Slaby <jslaby@...e.cz>
Subject: Re: [PATCH] ext4: Fix offset overflow on 32-bit archs in
ext4_iomap_begin()
On Thu, Mar 29, 2018 at 03:31:23PM +0200, Jan Kara wrote:
> On Fri 23-03-18 09:27:47, Eryu Guan wrote:
> > On Tue, Feb 20, 2018 at 06:23:07PM +0100, Jan Kara wrote:
> > > From: Jiri Slaby <jslaby@...e.cz>
> > >
> > > ext4_iomap_begin() has a bug where offset returned in the iomap
> > > structure will be truncated to unsigned long size. On 64-bit
> > > architectures this is fine but on 32-bit architectures obviously not.
> > > Not many places actually use the offset stored in the iomap structure
> > > but one of visible failures is in SEEK_HOLE / SEEK_DATA implementation.
> > > If we create a file like:
> > >
> > > dd if=/dev/urandom of=file bs=1k seek=8m count=1
> > >
> > > then
> > >
> > > lseek64("file", 0x100000000ULL, SEEK_DATA)
> > >
> > > wrongly returns 0x100000000 on unfixed kernel while it should return
> > > 0x200000000. Avoid the overflow by proper type cast.
> >
> > It looks like a good candidate for a regression test in fstests :)
>
> Actually, one of SEEK_HOLE/SEEK_DATA tests in fstests will fail because of
> this bug (I've checked that). Just not many people run fstests in fully
> 32-bit environments.
Which fstest?
--D
> Honza
> --
> Jan Kara <jack@...e.com>
> SUSE Labs, CR
Powered by blists - more mailing lists