summaryrefslogtreecommitdiffstats
path: root/fs/ntfs
diff options
context:
space:
mode:
authorAnton Altaparmakov <aia21@cantab.net>2005-11-24 13:41:33 +0000
committerAnton Altaparmakov <aia21@cantab.net>2005-11-24 13:41:33 +0000
commit3c6af7fa787f21f8873a050568ed892312899eb5 (patch)
tree39f8df4d83f0f60ab9a1581a4ff2588ae870b5a8 /fs/ntfs
parent33bc227e4e48ddadcf2eacb381c19df338f0a6c8 (diff)
downloadop-kernel-dev-3c6af7fa787f21f8873a050568ed892312899eb5.zip
op-kernel-dev-3c6af7fa787f21f8873a050568ed892312899eb5.tar.gz
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>
Diffstat (limited to 'fs/ntfs')
-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 7275338..c73c886 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);
OpenPOWER on IntegriCloud