diff options
author | Colin Ian King <colin.king@canonical.com> | 2013-10-24 10:08:07 -0400 |
---|---|---|
committer | Tyler Hicks <tyhicks@canonical.com> | 2013-10-24 15:36:30 -0400 |
commit | 43b7c6c6a4e3916edd186ceb61be0c67d1e0969e (patch) | |
tree | 422f444513a00a3f6d336ec448af816e1e45180a /fs | |
parent | 3edc8376c06133e3386265a824869cad03a4efd4 (diff) |
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>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/ecryptfs/crypto.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/ecryptfs/crypto.c b/fs/ecryptfs/crypto.c index c88e355f7635..000eae2782b6 100644 --- a/fs/ecryptfs/crypto.c +++ b/fs/ecryptfs/crypto.c | |||
@@ -408,7 +408,7 @@ static loff_t lower_offset_for_page(struct ecryptfs_crypt_stat *crypt_stat, | |||
408 | struct page *page) | 408 | struct page *page) |
409 | { | 409 | { |
410 | return ecryptfs_lower_header_size(crypt_stat) + | 410 | return ecryptfs_lower_header_size(crypt_stat) + |
411 | (page->index << PAGE_CACHE_SHIFT); | 411 | ((loff_t)page->index << PAGE_CACHE_SHIFT); |
412 | } | 412 | } |
413 | 413 | ||
414 | /** | 414 | /** |