From: Christoph Hellwig Date: Sun, 2 Oct 2016 22:46:04 +0000 (+1100) Subject: ext2: fix possible integer truncation in ext2_iomap_begin X-Git-Tag: v5.15~12664^2~72^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d5bfccdf38d094f2b15fae8b361d7bd47f2509d6;p=platform%2Fkernel%2Flinux-starfive.git ext2: fix possible integer truncation in ext2_iomap_begin For 32-bit architectures we need to cast first_block to u64 before shifting it left. Signed-off-by: Christoph Hellwig Reported-by: Jan Kara Reviewed-by: Dave Chinner Signed-off-by: Dave Chinner --- diff --git a/fs/ext2/inode.c b/fs/ext2/inode.c index aae5f61..c7dbb46 100644 --- a/fs/ext2/inode.c +++ b/fs/ext2/inode.c @@ -806,7 +806,7 @@ static int ext2_iomap_begin(struct inode *inode, loff_t offset, loff_t length, iomap->flags = 0; iomap->bdev = inode->i_sb->s_bdev; - iomap->offset = first_block << blkbits; + iomap->offset = (u64)first_block << blkbits; if (ret == 0) { iomap->type = IOMAP_HOLE;