Message ID | 1382660626-30222-2-git-send-email-tyhicks@canonical.com |
---|---|
State | New |
Headers | show |
On 10/24/2013 05:23 PM, Tyler Hicks wrote: > From: Colin Ian King <colin.king@canonical.com> > > BugLink: https://launchpad.net/bugs/1243636 > > Shifting page->index on 32 bit systems was overflowing, causing > data corruption of > 4GB files. Fix this by casting it first. > > 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> > (cherry picked from commit 43b7c6c6a4e3916edd186ceb61be0c67d1e0969e > from the next branch of kernel/git/tyhicks/ecryptfs.git) > --- > fs/ecryptfs/crypto.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/fs/ecryptfs/crypto.c b/fs/ecryptfs/crypto.c > index d107576..40db688 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); > } > > /** >
On Thu, Oct 24, 2013 at 05:23:46PM -0700, Tyler Hicks wrote: > From: Colin Ian King <colin.king@canonical.com> > > BugLink: https://launchpad.net/bugs/1243636 > > Shifting page->index on 32 bit systems was overflowing, causing > data corruption of > 4GB files. Fix this by casting it first. > > 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> > (cherry picked from commit 43b7c6c6a4e3916edd186ceb61be0c67d1e0969e > from the next branch of kernel/git/tyhicks/ecryptfs.git) > --- > fs/ecryptfs/crypto.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/fs/ecryptfs/crypto.c b/fs/ecryptfs/crypto.c > index d107576..40db688 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); > } > > /** > -- > 1.8.3.2 > > > -- > kernel-team mailing list > kernel-team@lists.ubuntu.com > https://lists.ubuntu.com/mailman/listinfo/kernel-team Cheers, -- Luis
diff --git a/fs/ecryptfs/crypto.c b/fs/ecryptfs/crypto.c index d107576..40db688 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); } /**