]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
f2fs: fix potential overflow
authorChao Yu <yuchao0@huawei.com>
Thu, 7 Nov 2019 09:29:00 +0000 (17:29 +0800)
committerKhalid Elmously <khalid.elmously@canonical.com>
Fri, 14 Feb 2020 05:29:37 +0000 (00:29 -0500)
commitdbd8d40a7e007b436690df27b914a2e7346279f2
tree241edd9227d9911d353cf97cf85177ba8c2dbe6f
parentfbf09d8601215b518f44b5eb9cd4eb4f840fb07e
f2fs: fix potential overflow

BugLink: https://bugs.launchpad.net/bugs/1861934
commit 1f0d5c911b64165c9754139a26c8c2fad352c132 upstream.

We expect 64-bit calculation result from below statement, however
in 32-bit machine, looped left shift operation on pgoff_t type
variable may cause overflow issue, fix it by forcing type cast.

page->index << PAGE_SHIFT;

Fixes: 26de9b117130 ("f2fs: avoid unnecessary updating inode during fsync")
Fixes: 0a2aa8fbb969 ("f2fs: refactor __exchange_data_block for speed up")
Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
fs/f2fs/data.c
fs/f2fs/file.c