summaryrefslogtreecommitdiffstats
path: root/fs/ecryptfs/mmap.c
diff options
context:
space:
mode:
authorMichael Halcrow <mhalcrow@us.ibm.com>2007-10-16 10:28:12 +0200
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-16 18:43:12 +0200
commitd6a13c17164fccab8aa96ca435ddacbf428335ca (patch)
tree8995bb0b5c22a97c8f6c86eff797ff2de0421ee2 /fs/ecryptfs/mmap.c
parenteCryptfs: convert mmap functions to use persistent file (diff)
downloadlinux-d6a13c17164fccab8aa96ca435ddacbf428335ca.tar.xz
linux-d6a13c17164fccab8aa96ca435ddacbf428335ca.zip
eCryptfs: fix data types
Update data types and add casts in order to avoid potential overflow issues. Signed-off-by: Michael Halcrow <mhalcrow@us.ibm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/ecryptfs/mmap.c')
-rw-r--r--fs/ecryptfs/mmap.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/ecryptfs/mmap.c b/fs/ecryptfs/mmap.c
index 9bc707df3b60..6ae0afb238d1 100644
--- a/fs/ecryptfs/mmap.c
+++ b/fs/ecryptfs/mmap.c
@@ -286,7 +286,8 @@ ecryptfs_copy_up_encrypted_with_header(struct page *page,
int rc = 0;
while (extent_num_in_page < num_extents_per_page) {
- loff_t view_extent_num = ((page->index * num_extents_per_page)
+ loff_t view_extent_num = ((((loff_t)page->index)
+ * num_extents_per_page)
+ extent_num_in_page);
if (view_extent_num < crypt_stat->num_header_extents_at_front) {
@@ -706,7 +707,7 @@ static int ecryptfs_commit_write(struct file *file, struct page *page,
"index [0x%.16x])\n", page->index);
goto out;
}
- pos = (page->index << PAGE_CACHE_SHIFT) + to;
+ pos = (((loff_t)page->index) << PAGE_CACHE_SHIFT) + to;
if (pos > i_size_read(ecryptfs_inode)) {
i_size_write(ecryptfs_inode, pos);
ecryptfs_printk(KERN_DEBUG, "Expanded file size to "