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  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20221102094348.2048443-1-liushixin2@huawei.com>
Date:   Wed, 2 Nov 2022 17:43:48 +0800
From:   Liu Shixin <liushixin2@...wei.com>
To:     Dave Kleikamp <shaggy@...nel.org>
CC:     <jfs-discussion@...ts.sourceforge.net>,
        <linux-kernel@...r.kernel.org>, Liu Shixin <liushixin2@...wei.com>
Subject: [PATCH] fs/jfs: fix assert failed in dbFindBits()

syzkaller reported a bug:

 BUG at fs/jfs/jfs_dmap.c:2984 assert(bitno < 32)

Since we increased bitno before check (mask != 0) in the loop, the value
can reach 32. Modify the assert condition to (bitno <= 32) to fix it.

Reported-by: syzbot+c6357942fbe0fce51c76@...kaller.appspotmail.com
Signed-off-by: Liu Shixin <liushixin2@...wei.com>
---
 fs/jfs/jfs_dmap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/jfs/jfs_dmap.c b/fs/jfs/jfs_dmap.c
index 6b838d3ae7c2..7bd57728edf3 100644
--- a/fs/jfs/jfs_dmap.c
+++ b/fs/jfs/jfs_dmap.c
@@ -2981,7 +2981,7 @@ static int dbFindBits(u32 word, int l2nb)
 			break;
 	}
 
-	ASSERT(bitno < 32);
+	ASSERT(bitno <= 32);
 
 	/* return the bit number.
 	 */
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ