Commit 43b7c6c6 authored by Colin Ian King's avatar Colin Ian King Committed by Tyler Hicks

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/1243636Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
Reported-by: default avatarLars Duesing <lars.duesing@camelotsweb.de>
Cc: stable@vger.kernel.org # v3.11+
Signed-off-by: default avatarTyler Hicks <tyhicks@canonical.com>
parent 3edc8376
...@@ -408,7 +408,7 @@ static loff_t lower_offset_for_page(struct ecryptfs_crypt_stat *crypt_stat, ...@@ -408,7 +408,7 @@ static loff_t lower_offset_for_page(struct ecryptfs_crypt_stat *crypt_stat,
struct page *page) struct page *page)
{ {
return ecryptfs_lower_header_size(crypt_stat) + return ecryptfs_lower_header_size(crypt_stat) +
(page->index << PAGE_CACHE_SHIFT); ((loff_t)page->index << PAGE_CACHE_SHIFT);
} }
/** /**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment