Re: [syzbot] [syzbot] [jfs?] KASAN: slab-out-of-bounds Write in diWrite

From: syzbot
Date: Thu May 16 2024 - 22:03:50 EST


For archival purposes, forwarding an incoming command email to
linux-kernel@xxxxxxxxxxxxxxx.

***

Subject: [syzbot] [jfs?] KASAN: slab-out-of-bounds Write in diWrite
Author: lizhi.xu@xxxxxxxxxxxxx

#syz test https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git ed30a4a51bb1

diff --git a/fs/jfs/jfs_imap.c b/fs/jfs/jfs_imap.c
index 2ec35889ad24..d9b302938ed2 100644
--- a/fs/jfs/jfs_imap.c
+++ b/fs/jfs/jfs_imap.c
@@ -747,6 +747,8 @@ int diWrite(tid_t tid, struct inode *ip)
xp = (dtpage_t *) & dp->di_dtroot;
lv = ilinelock->lv;
for (n = 0; n < ilinelock->index; n++, lv++) {
+ printk("lv: %p offset:%d %s\n", lv, lv->offset, __func__);
+ if (lv->offset < DTPAGEMAXSLOT)
memcpy(&xp->slot[lv->offset], &p->slot[lv->offset],
lv->length << L2DTSLOTSIZE);
}