lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 20 Jan 2021 09:30:16 +0800
From:   Gao Xiang <hsiangkao@....com>
To:     linux-erofs@...ts.ozlabs.org
Cc:     Chao Yu <yuchao0@...wei.com>, LKML <linux-kernel@...r.kernel.org>,
        syzkaller-bugs@...glegroups.com, Gao Xiang <hsiangkao@...hat.com>,
        syzbot+c68f467cd7c45860e8d4@...kaller.appspotmail.com
Subject: [PATCH] erofs: fix shift-out-of-bounds of blkszbits

From: Gao Xiang <hsiangkao@...hat.com>

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
Reported-by: syzbot+c68f467cd7c45860e8d4@...kaller.appspotmail.com
Signed-off-by: Gao Xiang <hsiangkao@...hat.com>
---
 fs/erofs/super.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/erofs/super.c b/fs/erofs/super.c
index be10b16ea66e..d5a6b9b888a5 100644
--- 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, "blksize %u isn't supported on this platform",
-			  1 << blkszbits);
+		erofs_err(sb, "blkszbits %u isn't supported on this platform",
+			  blkszbits);
 		goto out;
 	}
 
-- 
2.24.0

Powered by blists - more mailing lists