projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1aeaa0e
)
erofs: fix shift-out-of-bounds of blkszbits
author
Gao Xiang
<hsiangkao@redhat.com>
Wed, 20 Jan 2021 01:30:16 +0000
(09:30 +0800)
committer
Greg Kroah-Hartman
<gregkh@linuxfoundation.org>
Sun, 7 Mar 2021 11:34:05 +0000
(12:34 +0100)
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>
fs/erofs/super.c
patch
|
blob
|
history
diff --git
a/fs/erofs/super.c
b/fs/erofs/super.c
index
be10b16
..
d5a6b9b
100644
(file)
--- a/
fs/erofs/super.c
+++ b/
fs/erofs/super.c
@@
-158,8
+158,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, "blks
ize
%u isn't supported on this platform",
-
1 <<
blkszbits);
+ erofs_err(sb, "blks
zbits
%u isn't supported on this platform",
+ blkszbits);
goto out;
}