]> asedeno.scripts.mit.edu Git - linux.git/commit
f2fs: add a condition to detect overflow in f2fs_ioc_gc_range()
authorSahitya Tummala <stummala@codeaurora.org>
Tue, 17 Sep 2019 04:49:23 +0000 (10:19 +0530)
committerJaegeuk Kim <jaegeuk@kernel.org>
Tue, 17 Sep 2019 20:56:15 +0000 (13:56 -0700)
commitfbbf779989d2ef9a51daaa4e53c0b2ecc8c55c4e
tree2f12ef343c175b800765c41ba913dc430059e50f
parent8223ecc456d079ef9b7a1fed237134cf62e9e870
f2fs: add a condition to detect overflow in f2fs_ioc_gc_range()

end = range.start + range.len;

If the range.start/range.len is a very large value, then end can overflow
in this operation. It results into a crash in get_valid_blocks() when
accessing the invalid range.start segno.

This issue is reported in ioctl fuzz testing.

Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/file.c