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>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <tencent_F56949906EED6EC90C8027D0C6DFD2F84606@qq.com>
Date: Tue,  3 Dec 2024 18:22:00 +0800
From: Edward Adam Davis <eadavis@...com>
To: syzbot+7c808908291a569281a9@...kaller.appspotmail.com
Cc: axboe@...nel.dk,
	jfs-discussion@...ts.sourceforge.net,
	kristian@...usen.dk,
	linux-block@...r.kernel.org,
	linux-kernel@...r.kernel.org,
	shaggy@...nel.org,
	syzkaller-bugs@...glegroups.com
Subject: [PATCH] jfs: check agwidth before calculating the control page level

The width in dmapctl of the AG is zero, it trigger a divide error when
calculating the control page level in dbAllocAG.

To avoid this issue, add a check for agwidth in dbAllocAG.

Reported-and-tested-by: syzbot+7c808908291a569281a9@...kaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=7c808908291a569281a9
Signed-off-by: Edward Adam Davis <eadavis@...com>
---
 fs/jfs/jfs_dmap.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/fs/jfs/jfs_dmap.c b/fs/jfs/jfs_dmap.c
index f9009e4f9ffd..2377102d9c4c 100644
--- a/fs/jfs/jfs_dmap.c
+++ b/fs/jfs/jfs_dmap.c
@@ -1373,6 +1373,11 @@ dbAllocAG(struct bmap * bmp, int agno, s64 nblocks, int l2nb, s64 * results)
 		return (rc);
 	}
 
+	if (!bmp->db_agwidth) {
+		jfs_error(bmp->db_ipbmap->i_sb, "width in dmapctl of the AG is zero\n");
+		return -EIO;
+	}
+
 	/* the buffer for the dmap control page that fully describes the
 	 * allocation group.
 	 */
-- 
2.47.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ