]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commit
staging: erofs: avoid endless loop of invalid lookback distance 0
authorGao Xiang <gaoxiang25@huawei.com>
Wed, 9 Oct 2019 10:05:53 +0000 (18:05 +0800)
committerKhalid Elmously <khalid.elmously@canonical.com>
Fri, 18 Oct 2019 08:26:42 +0000 (04:26 -0400)
commitb1b1715d3fb6e38abe42f6806942bafb10ae73dd
treefca7ac85eca51594ca039ac5e84001a8dd95a7e1
parent17a50d73641801c5160bb01a00012ad4d8ea3820
staging: erofs: avoid endless loop of invalid lookback distance 0

BugLink: https://bugs.launchpad.net/bugs/1848039
commit 598bb8913d015150b7734b55443c0e53e7189fc7 upstream.

As reported by erofs-utils fuzzer, Lookback distance should
be a positive number, so it should be actually looked back
rather than spinning.

Fixes: 02827e1796b3 ("staging: erofs: add erofs_map_blocks_iter")
Cc: <stable@vger.kernel.org> # 4.19+
Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Link: https://lore.kernel.org/r/20190819103426.87579-7-gaoxiang25@huawei.com
[ Gao Xiang: Since earlier kernels don't define EFSCORRUPTED,
             let's use EIO instead. ]
Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
drivers/staging/erofs/zmap.c