diff options
author | Anton Altaparmakov <aia21@cantab.net> | 2005-11-24 14:41:33 +0100 |
---|---|---|
committer | Anton Altaparmakov <aia21@cantab.net> | 2005-11-24 14:41:33 +0100 |
commit | 3c6af7fa787f21f8873a050568ed892312899eb5 (patch) | |
tree | 39f8df4d83f0f60ab9a1581a4ff2588ae870b5a8 /fs/ntfs | |
parent | Merge branch 'drm-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/air... (diff) | |
download | linux-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>
Diffstat (limited to 'fs/ntfs')
-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); |