summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGao Xiang <hsiangkao@redhat.com>2021-01-20 09:30:16 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-03-07 12:20:42 +0100
commitedaa0a0aab6e63b2ea7747f14daa68808ea4f36b (patch)
tree0a6b889070a39cde52015358a464d51bf4fee530
parent706068d0811a6bce6e324d1a1c11fcd4d0047c60 (diff)
erofs: fix shift-out-of-bounds of blkszbits
commit bde545295b710bdd13a0fcd4b9fddd2383eeeb3a upstream. syzbot generated a crafted bitszbits which can be shifted out-of-bounds[1]. So directly print unsupported blkszbits instead of blksize. [1] https://lore.kernel.org/r/000000000000c72ddd05b9444d2f@google.com Link: https://lore.kernel.org/r/20210120013016.14071-1-hsiangkao@aol.com Reported-by: syzbot+c68f467cd7c45860e8d4@syzkaller.appspotmail.com Reviewed-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Gao Xiang <hsiangkao@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--fs/erofs/super.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/erofs/super.c b/fs/erofs/super.c
index 0e369494f2f2..22e059b4f745 100644
--- a/fs/erofs/super.c
+++ b/fs/erofs/super.c
@@ -124,8 +124,8 @@ static int erofs_read_superblock(struct super_block *sb)
blkszbits = dsb->blkszbits;
/* 9(512 bytes) + LOG_SECTORS_PER_BLOCK == LOG_BLOCK_SIZE */
if (blkszbits != LOG_BLOCK_SIZE) {
- erofs_err(sb, "blksize %u isn't supported on this platform",
- 1 << blkszbits);
+ erofs_err(sb, "blkszbits %u isn't supported on this platform",
+ blkszbits);
goto out;
}