Re: [PATCH 3/4] libext2fs: fix block-mapped file punch

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Nov 13, 2015 at 06:10:28PM -0700, Andreas Dilger wrote:
> If ext2fs_punch() is called with "end = ~0U" (which is natural from
> a programming POV) it tries to compute "count" based on "start" and
> "end", but doesn't quite get it right.

I don't object to ext2fs_punch handling 32-bit overflows correctly if
it is being called on an indirect mapped file (where the logical block
numbers are limited to 2**32).  But it would be good if the patch
description actually said that.  Also, arguably this is still a bug in
the caller, which should use ~0ULL to mean the end of the file.

> Fix ext2fs_punch() if "end" is anywhere beyond the 2^32 block limit
> so that the 32-bit calculations don't overflow.  Pass "count=~0"
> in this case, and also handle that explicitly in ext2_punch_ind().
> Since ext2_punch_ind() is itself a public function, so it makes
> sense to fix this in both places.

Um, ext2_punch_ind() is a static function....

> @@ -119,6 +119,9 @@ static errcode_t ext2fs_punch_ind(ext2_filsys fs, struct ext2_inode *inode,

Cheers,

					- Ted
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Reiser Filesystem Development]     [Ceph FS]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite National Park]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Media]

  Powered by Linux