Re: [PATCH] ext4: Fix offset overflow on 32-bit archs in ext4_iomap_begin()

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

 



On Tue, Feb 20, 2018 at 06:23:07PM +0100, Jan Kara wrote:
> From: Jiri Slaby <jslaby@xxxxxxx>
> 
> 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.
> 
> Fixes: 545052e9e35a ("ext4: Switch to iomap for SEEK_HOLE / SEEK_DATA")
> Signed-off-by: Jiri Slaby <jslaby@xxxxxxx>
> Signed-off-by: Jan Kara <jack@xxxxxxx>

Thanks, applied.

					- Ted



[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