[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <alpine.LFD.2.00.1110111011230.5752@dhcp-27-109.brq.redhat.com>
Date: Tue, 11 Oct 2011 10:13:01 +0200 (CEST)
From: Lukas Czerner <lczerner@...hat.com>
To: "Ted Ts'o" <tytso@....edu>
cc: Lukas Czerner <lczerner@...hat.com>, linux-ext4@...r.kernel.org,
tm@....ma
Subject: Re: [PATCH v3] ext4: fix possible overflow in ext4_trim_fs()
On Mon, 10 Oct 2011, Ted Ts'o wrote:
> On Wed, Sep 07, 2011 at 05:52:57PM +0200, Lukas Czerner wrote:
> > The overflow can happen when we are calling get_group_no_and_offset()
> > which stores the result of do_div() in 32 bit long type. However the
> > result might be bigger than that if big blocknr is passed in. This will
> > most likely happen when calling FITRIM with the default argument len =
> > ULLONG_MAX.
> >
> > Fix this by using "end" variable instead of "start+len" as it is easier
> > to get right and specifically check that the end is not beyond the end
> > of the file system, so we are sure that the result of
> > get_group_no_and_offset() will not overflow. Otherwise truncate it to
> > the size of the file system.
> >
> > Signed-off-by: Lukas Czerner <lczerner@...hat.com>
>
> Hi Lukas,
>
> Since I've merged the bigalloc patches that uses clusters instead of
> blocks for various file system parameters. I made a quick attempt to
> port your patch, and it wasn't obvious (and I don't have your testing
> framework). Could you do me a favor and forward port your patch to
> either the dev or master branch on the ext4 github repository?
>
> Thanks!!
>
> - Ted
Hi Ted,
no problem, I'll do that. Btw, the test case for it is already in
xfstests (260) so I'll mention that in the commit description as well.
Thanks!
-Lukas
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists