public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: syzbot <syzbot+d16facb00df3f446511c@syzkaller.appspotmail.com>
To: linux-kernel@vger.kernel.org
Subject: Re: [syzbot] Re: [syzbot] [jfs?] KASAN: slab-use-after-free Read in lmLogInit
Date: Mon, 26 Aug 2024 02:02:55 -0700	[thread overview]
Message-ID: <000000000000ff8b0d06209263b3@google.com> (raw)
In-Reply-To: <000000000000ab44fc06203f0d28@google.com>

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

***

Subject: Re: [syzbot] [jfs?] KASAN: slab-use-after-free Read in lmLogInit
Author: lizhi.xu@windriver.com

blk dev max sector is 0

#syz test: upstream df6cbc62cc9b

diff --git a/fs/jfs/jfs_logmgr.c b/fs/jfs/jfs_logmgr.c
index 9609349e92e5..14404780f38d 100644
--- a/fs/jfs/jfs_logmgr.c
+++ b/fs/jfs/jfs_logmgr.c
@@ -1163,6 +1163,15 @@ static int open_inline_log(struct super_block *sb)
 
 	set_bit(log_INLINELOG, &log->flag);
 	log->bdev_file = sb->s_bdev_file;
+	printk("sb: %p, sb t: %s, sbf: %p, bdev1: %p, sbdev: %p, %s\n",
+		sb, sb->s_type->name, sb->s_bdev_file, file_bdev(sb->s_bdev_file), sb->s_bdev, __func__);
+
+	if (!bdev_nr_sectors(file_bdev(sb->s_bdev_file))) {
+		kfree(log);
+		jfs_warn("open_inline_log: block device max sector is 0");
+		return -EINVAL;
+	}
+
 	log->base = addressPXD(&JFS_SBI(sb)->logpxd);
 	log->size = lengthPXD(&JFS_SBI(sb)->logpxd) >>
 	    (L2LOGPSIZE - sb->s_blocksize_bits);

  parent reply	other threads:[~2024-08-26  9:02 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-22  5:37 [syzbot] [jfs?] KASAN: slab-use-after-free Read in lmLogInit syzbot
2024-08-22  7:18 ` [syzbot] " syzbot
2024-08-26  9:02 ` syzbot [this message]
2025-02-13  6:17 ` 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=000000000000ff8b0d06209263b3@google.com \
    --to=syzbot+d16facb00df3f446511c@syzkaller.appspotmail.com \
    --cc=linux-kernel@vger.kernel.org \
    /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