Skip to content

Commit

Permalink
eCryptfs: fix 32 bit corruption issue
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Colin Ian King authored and tyhicks committed Oct 24, 2013
1 parent 3edc837 commit 43b7c6c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/ecryptfs/crypto.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

/**
Expand Down

0 comments on commit 43b7c6c

Please sign in to comment.