From: Colin Ian King Date: Thu, 24 Oct 2013 14:08:07 +0000 (+0000) Subject: eCryptfs: fix 32 bit corruption issue X-Git-Tag: v3.11.8~61 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5ca6a948fb97c27ae9f352c254063f7fe342d30c;p=thirdparty%2Fkernel%2Fstable.git 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 Reported-by: Lars Duesing Signed-off-by: Tyler Hicks Signed-off-by: Greg Kroah-Hartman --- diff --git a/fs/ecryptfs/crypto.c b/fs/ecryptfs/crypto.c index d10757635b9c9..40db6880cdd63 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); } /**