summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnton Altaparmakov <aia21@cantab.net>2005-11-24 14:41:33 +0100
committerAnton Altaparmakov <aia21@cantab.net>2005-11-24 14:41:33 +0100
commit3c6af7fa787f21f8873a050568ed892312899eb5 (patch)
tree39f8df4d83f0f60ab9a1581a4ff2588ae870b5a8
parentMerge branch 'drm-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/air... (diff)
downloadlinux-3c6af7fa787f21f8873a050568ed892312899eb5.tar.xz
linux-3c6af7fa787f21f8873a050568ed892312899eb5.zip
NTFS: Fix a potential overflow by casting (index + 1) to s64 before doing a
left shift using PAGE_CACHE_SHIFT in fs/ntfs/file.c. Thanks to Andrew Morton pointing this out to. Signed-off-by: Anton Altaparmakov <aia21@cantab.net>
-rw-r--r--fs/ntfs/file.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/ntfs/file.c b/fs/ntfs/file.c
index 727533891813..c73c8864cbad 100644
--- a/fs/ntfs/file.c
+++ b/fs/ntfs/file.c
@@ -248,7 +248,7 @@ do_non_resident_extend:
* enough to make ntfs_writepage() work.
*/
write_lock_irqsave(&ni->size_lock, flags);
- ni->initialized_size = (index + 1) << PAGE_CACHE_SHIFT;
+ ni->initialized_size = (s64)(index + 1) << PAGE_CACHE_SHIFT;
if (ni->initialized_size > new_init_size)
ni->initialized_size = new_init_size;
write_unlock_irqrestore(&ni->size_lock, flags);