From: Jeongjun Park <aha310510@gmail.com>
To: syzbot+241c815bda521982cb49@syzkaller.appspotmail.com
Cc: linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com
Subject: Re: [syzbot] [jfs?] UBSAN: array-index-out-of-bounds in diFree
Date: Thu, 25 Apr 2024 17:56:54 +0900 [thread overview]
Message-ID: <20240425085654.10967-1-aha310510@gmail.com> (raw)
In-Reply-To: <0000000000000866ea0616cb082c@google.com>
please test array-index-out-of-bounds in diFree
#syz test git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/ master
---
fs/jfs/jfs_dmap.c | 4 +++-
fs/jfs/jfs_imap.c | 8 ++++++--
2 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/fs/jfs/jfs_dmap.c b/fs/jfs/jfs_dmap.c
index cb3cda1390ad..6681a6272ae7 100644
--- a/fs/jfs/jfs_dmap.c
+++ b/fs/jfs/jfs_dmap.c
@@ -206,6 +206,7 @@ int dbMount(struct inode *ipbmap)
bmp->db_agwidth = le32_to_cpu(dbmp_le->dn_agwidth);
bmp->db_agstart = le32_to_cpu(dbmp_le->dn_agstart);
bmp->db_agl2size = le32_to_cpu(dbmp_le->dn_agl2size);
+ printk("dmMount : %d\n",bmp->db_agl2size);
if (bmp->db_agl2size > L2MAXL2SIZE - L2MAXAG ||
bmp->db_agl2size < 0) {
err = -EINVAL;
@@ -316,6 +317,7 @@ int dbSync(struct inode *ipbmap)
dbmp_le->dn_agwidth = cpu_to_le32(bmp->db_agwidth);
dbmp_le->dn_agstart = cpu_to_le32(bmp->db_agstart);
dbmp_le->dn_agl2size = cpu_to_le32(bmp->db_agl2size);
+ printk("dbSync : %d\n",bmp->db_agl2size);
for (i = 0; i < MAXAG; i++)
dbmp_le->dn_agfree[i] = cpu_to_le64(bmp->db_agfree[i]);
dbmp_le->dn_agsize = cpu_to_le64(bmp->db_agsize);
@@ -3393,7 +3395,7 @@ int dbExtendFS(struct inode *ipbmap, s64 blkno, s64 nblocks)
bmp->db_agl2size = l2agsize;
bmp->db_agsize = 1 << l2agsize;
-
+ printk("dbExtendFS : %d\n",bmp->db_agl2size);
/* compute new number of AG */
agno = bmp->db_numag;
bmp->db_numag = newsize >> l2agsize;
diff --git a/fs/jfs/jfs_imap.c b/fs/jfs/jfs_imap.c
index 2ec35889ad24..c39f7685aa97 100644
--- a/fs/jfs/jfs_imap.c
+++ b/fs/jfs/jfs_imap.c
@@ -339,7 +339,7 @@ int diRead(struct inode *ip)
/* get the ag for the iag */
agstart = le64_to_cpu(iagp->agstart);
-
+ printk("diRead : %ld\n",agstart);
release_metapage(mp);
rel_inode = (ino & (INOSPERPAGE - 1));
@@ -881,6 +881,8 @@ int diFree(struct inode *ip)
*/
agno = BLKTOAG(JFS_IP(ip)->agstart, JFS_SBI(ip->i_sb));
+ printk("%lu %d %d",JFS_IP(ip)->agstart, JFS_SBI(ip->i_sb)->bmap->db_agl2size, agno);
+
/* Lock the AG specific inode map information
*/
AG_LOCK(imap, agno);
@@ -1298,6 +1300,7 @@ diInitInode(struct inode *ip, int iagno, int ino, int extno, struct iag * iagp)
jfs_ip->ixpxd = iagp->inoext[extno];
jfs_ip->agstart = le64_to_cpu(iagp->agstart);
jfs_ip->active_ag = -1;
+ printk("diInitInode : %lu",jfs_ip->agstart);
}
@@ -1908,6 +1911,7 @@ static int diAllocExt(struct inomap * imap, int agno, struct inode *ip)
*/
iagp->agstart =
cpu_to_le64(AGTOBLK(agno, imap->im_ipimap));
+ printk("diAllocExt : %lu\n",iagp->agstart);
} else {
/* read the iag.
*/
@@ -2898,7 +2902,7 @@ int diExtendFS(struct inode *ipimap, struct inode *ipbmap)
agstart = le64_to_cpu(iagp->agstart);
n = agstart >> mp->db_agl2size;
iagp->agstart = cpu_to_le64((s64)n << mp->db_agl2size);
-
+ printk("diExtendFs : %lu %d\n",agstart, mp->db_agl2size);
/* compute backed inodes */
numinos = (EXTSPERIAG - le32_to_cpu(iagp->nfreeexts))
<< L2INOSPEREXT;
--
2.34.1
next prev parent reply other threads:[~2024-04-25 8:56 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-23 22:25 [syzbot] [jfs?] UBSAN: array-index-out-of-bounds in diFree syzbot
2024-04-24 4:11 ` Jeongjun Park
2024-04-24 4:39 ` syzbot
2024-04-24 17:22 ` [PATCH] jfs: Fix " Jeongjun Park
2024-04-24 17:41 ` Matthew Wilcox
2024-04-25 12:44 ` Jeongjun Park
2024-04-25 12:53 ` Matthew Wilcox
2024-04-25 14:10 ` Jeongjun Park
2024-04-25 14:14 ` Dave Kleikamp
2024-04-25 14:17 ` Matthew Wilcox
2024-04-25 14:24 ` Jeongjun Park
2024-04-25 17:04 ` Matthew Wilcox
2024-04-26 1:42 ` Jeongjun Park
2024-04-26 2:34 ` Jeongjun Park
2024-04-26 3:27 ` Matthew Wilcox
2024-04-26 3:41 ` Jeongjun Park
2024-05-30 13:28 ` Jeongjun Park
2024-06-26 17:40 ` Dave Kleikamp
2024-04-25 14:24 ` Dave Kleikamp
2024-04-25 14:37 ` Jeongjun Park
2024-04-25 3:15 ` [syzbot] [jfs?] UBSAN: " Jeongjun Park
2024-04-25 4:33 ` syzbot
2024-04-25 4:59 ` Jeongjun Park
2024-04-25 5:50 ` syzbot
2024-04-25 8:56 ` Jeongjun Park [this message]
2024-04-25 9:23 ` syzbot
2024-04-25 9:04 ` Jeongjun Park
2024-04-25 9:39 ` syzbot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240425085654.10967-1-aha310510@gmail.com \
--to=aha310510@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=syzbot+241c815bda521982cb49@syzkaller.appspotmail.com \
--cc=syzkaller-bugs@googlegroups.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox