summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorColin Ian King <colin.king@canonical.com>2013-10-24 14:08:07 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-11-13 12:08:08 +0900
commit5ca6a948fb97c27ae9f352c254063f7fe342d30c (patch)
tree41a1a8d59743087585d949ee695383a1c9e757d1 /fs
parentff2d90ef8a5f51c8aceb61156fd276da36eb158f (diff)
eCryptfs: fix 32 bit corruption issue
commit 43b7c6c6a4e3916edd186ceb61be0c67d1e0969e upstream. 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> Signed-off-by: Tyler Hicks <tyhicks@canonical.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/ecryptfs/crypto.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/ecryptfs/crypto.c b/fs/ecryptfs/crypto.c
index d10757635b9c..40db6880cdd6 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,
struct page *page)
{
return ecryptfs_lower_header_size(crypt_stat) +
- (page->index << PAGE_CACHE_SHIFT);
+ ((loff_t)page->index << PAGE_CACHE_SHIFT);
}
/**