From: Ted Ts'o <tytso@mit.edu>
To: Lukas Czerner <lczerner@redhat.com>
Cc: linux-ext4@vger.kernel.org, tm@tao.ma
Subject: Re: [PATCH v3] ext4: fix possible overflow in ext4_trim_fs()
Date: Mon, 10 Oct 2011 12:47:11 -0400 [thread overview]
Message-ID: <20111010164711.GW7948@thunk.org> (raw)
In-Reply-To: <1315410777-24237-1-git-send-email-lczerner@redhat.com>
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@redhat.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
next prev parent reply other threads:[~2011-10-10 16:47 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-07 15:52 [PATCH v3] ext4: fix possible overflow in ext4_trim_fs() Lukas Czerner
2011-09-27 11:19 ` Lukas Czerner
2011-10-10 16:47 ` Ted Ts'o [this message]
2011-10-11 8:13 ` Lukas Czerner
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=20111010164711.GW7948@thunk.org \
--to=tytso@mit.edu \
--cc=lczerner@redhat.com \
--cc=linux-ext4@vger.kernel.org \
--cc=tm@tao.ma \
/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;
as well as URLs for NNTP newsgroup(s).