]> git.baikalelectronics.ru Git - kernel.git/commit
erofs: fix order >= MAX_ORDER warning due to crafted negative i_size
authorGao Xiang <hsiangkao@linux.alibaba.com>
Fri, 9 Sep 2022 02:39:48 +0000 (10:39 +0800)
committerGao Xiang <hsiangkao@linux.alibaba.com>
Mon, 19 Sep 2022 23:59:32 +0000 (07:59 +0800)
commit5951e887e2d84e222b10f40606cd545c82d1ebf9
tree657be8bb59e31a87bdbe5abbcfedd78c0c8c6eff
parent6b608845df329724a323dfecf18882dddd8d9e95
erofs: fix order >= MAX_ORDER warning due to crafted negative i_size

As syzbot reported [1], the root cause is that i_size field is a
signed type, and negative i_size is also less than EROFS_BLKSIZ.
As a consequence, it's handled as fast symlink unexpectedly.

Let's fall back to the generic path to deal with such unusual i_size.

[1] https://lore.kernel.org/r/000000000000ac8efa05e7feaa1f@google.com

Reported-by: syzbot+f966c13b1b4fc0403b19@syzkaller.appspotmail.com
Fixes: dea6397c7a4f ("staging: erofs: add inode operations")
Reviewed-by: Yue Hu <huyue2@coolpad.com>
Link: https://lore.kernel.org/r/20220909023948.28925-1-hsiangkao@linux.alibaba.com
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
fs/erofs/inode.c