diff options
author | Anton Altaparmakov <aia21@cantab.net> | 2005-11-24 13:41:33 +0000 |
---|---|---|
committer | Anton Altaparmakov <aia21@cantab.net> | 2005-11-24 13:41:33 +0000 |
commit | 3c6af7fa787f21f8873a050568ed892312899eb5 (patch) | |
tree | 39f8df4d83f0f60ab9a1581a4ff2588ae870b5a8 /fs/ntfs/file.c | |
parent | 33bc227e4e48ddadcf2eacb381c19df338f0a6c8 (diff) | |
download | lwn-3c6af7fa787f21f8873a050568ed892312899eb5.tar.gz lwn-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>
Diffstat (limited to 'fs/ntfs/file.c')
-rw-r--r-- | fs/ntfs/file.c | 2 |
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); |