aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorAnton Altaparmakov <aia21@cantab.net>2005-11-24 08:41:33 -0500
committerAnton Altaparmakov <aia21@cantab.net>2005-11-24 08:41:33 -0500
commit3c6af7fa787f21f8873a050568ed892312899eb5 (patch)
tree39f8df4d83f0f60ab9a1581a4ff2588ae870b5a8 /fs
parent33bc227e4e48ddadcf2eacb381c19df338f0a6c8 (diff)
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')
-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:
248 * enough to make ntfs_writepage() work. 248 * enough to make ntfs_writepage() work.
249 */ 249 */
250 write_lock_irqsave(&ni->size_lock, flags); 250 write_lock_irqsave(&ni->size_lock, flags);
251 ni->initialized_size = (index + 1) << PAGE_CACHE_SHIFT; 251 ni->initialized_size = (s64)(index + 1) << PAGE_CACHE_SHIFT;
252 if (ni->initialized_size > new_init_size) 252 if (ni->initialized_size > new_init_size)
253 ni->initialized_size = new_init_size; 253 ni->initialized_size = new_init_size;
254 write_unlock_irqrestore(&ni->size_lock, flags); 254 write_unlock_irqrestore(&ni->size_lock, flags);