From: Theodore Ts'o <tytso@mit.edu>
To: Andreas Dilger <andreas.dilger@intel.com>
Cc: linux-ext4@vger.kernel.org
Subject: Re: [PATCH 1/2] libext2fs: fix block-mapped file punch
Date: Mon, 30 Nov 2015 15:28:04 -0500 [thread overview]
Message-ID: <20151130202804.GG4316@thunk.org> (raw)
In-Reply-To: <1447920799-12834-1-git-send-email-andreas.dilger@intel.com>
On Thu, Nov 19, 2015 at 01:13:18AM -0700, Andreas Dilger wrote:
> If ext2fs_punch() was called with "end = ~0ULL" to indicate truncate
> to the end of file it tried to compute "count" for ext2fs_punch_ind()
> based on "start" and "end", but incorrectly passed "count = ~0U" even
> when "start" was non-zero, causing an overflow in some cases.
>
> The calling convention for ext2fs_punch_ind() was also gratuitously
> different from ext2fs_punch() and ext2fs_punch_extent(), passing
> "count" instead of "end" as the last parameter. Fix this by passing
> it "end" like the other functions, and handle "count" internally.
>
> Add checks to ext2fs_punch_ind() if "end" is at or beyond the 2^32
> indirect block limit so the 32-bit internal variables don't overflow.
>
> Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
Thanks, applied.
- Ted
prev parent reply other threads:[~2015-11-30 20:28 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-19 8:13 [PATCH 1/2] libext2fs: fix block-mapped file punch Andreas Dilger
2015-11-19 8:13 ` [PATCH 2/2] e2fsck: fix e2fsck -fD directory truncation Andreas Dilger
2015-11-30 20:29 ` Theodore Ts'o
2015-11-30 20:28 ` Theodore Ts'o [this message]
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=20151130202804.GG4316@thunk.org \
--to=tytso@mit.edu \
--cc=andreas.dilger@intel.com \
--cc=linux-ext4@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.