Skip to content

Commit 43b7c6c

Browse files
Colin Ian Kingtyhicks
authored andcommitted
eCryptfs: fix 32 bit corruption issue
Shifting page->index on 32 bit systems was overflowing, causing data corruption of > 4GB files. Fix this by casting it first. https://launchpad.net/bugs/1243636 Signed-off-by: Colin Ian King <colin.king@canonical.com> Reported-by: Lars Duesing <lars.duesing@camelotsweb.de> Cc: stable@vger.kernel.org # v3.11+ Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
1 parent 3edc837 commit 43b7c6c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/ecryptfs/crypto.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ static loff_t lower_offset_for_page(struct ecryptfs_crypt_stat *crypt_stat,
408408
struct page *page)
409409
{
410410
return ecryptfs_lower_header_size(crypt_stat) +
411-
(page->index << PAGE_CACHE_SHIFT);
411+
((loff_t)page->index << PAGE_CACHE_SHIFT);
412412
}
413413

414414
/**

0 commit comments

Comments
 (0)