提交 3c6af7fa 编写于 作者: A Anton Altaparmakov

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: NAnton Altaparmakov <aia21@cantab.net>
上级 33bc227e
......@@ -248,7 +248,7 @@ static int ntfs_attr_extend_initialized(ntfs_inode *ni, const s64 new_init_size,
* 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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册