public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: syzbot <syzbot+47ecc948aadfb2ab3efc@syzkaller.appspotmail.com>
To: linux-kernel@vger.kernel.org
Subject: Re: [syzbot] Re: [syzbot] [bcachefs?] KASAN: slab-out-of-bounds Write in bch2_dev_journal_init
Date: Sun, 18 Aug 2024 20:27:03 -0700	[thread overview]
Message-ID: <000000000000f5d890062000e13f@google.com> (raw)
In-Reply-To: <00000000000071b7c5061ff83639@google.com>

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

***

Subject: Re: [syzbot] [bcachefs?] KASAN: slab-out-of-bounds Write in bch2_dev_journal_init
Author: lizhi.xu@windriver.com

two obj are null ?

#syz test: upstream c3f2d783a459

diff --git a/fs/bcachefs/journal.c b/fs/bcachefs/journal.c
index 13669dd0e375..1219f921690a 100644
--- a/fs/bcachefs/journal.c
+++ b/fs/bcachefs/journal.c
@@ -1304,6 +1304,10 @@ int bch2_dev_journal_init(struct bch_dev *ca, struct bch_sb *sb)
 
 	ja->nr = 0;
 
+	struct printbuf buf = PRINTBUF;
+	prt_printf(&buf, "ja nr: %u, %s\n", ja->nr, journal_buckets_v2, journal_buckets, __func__);
+	printbuf_exit(&buf);
+
 	if (journal_buckets_v2) {
 		unsigned nr = bch2_sb_field_journal_v2_nr_entries(journal_buckets_v2);
 
@@ -1311,7 +1315,8 @@ int bch2_dev_journal_init(struct bch_dev *ca, struct bch_sb *sb)
 			ja->nr += le64_to_cpu(journal_buckets_v2->d[i].nr);
 	} else if (journal_buckets) {
 		ja->nr = bch2_nr_journal_buckets(journal_buckets);
-	}
+	} else
+		return -EINVAL;
 
 	ja->bucket_seq = kcalloc(ja->nr, sizeof(u64), GFP_KERNEL);
 	if (!ja->bucket_seq)

  parent reply	other threads:[~2024-08-19  3:27 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-18 17:06 [syzbot] [bcachefs?] KASAN: slab-out-of-bounds Write in bch2_dev_journal_init syzbot
2024-08-19  3:02 ` [syzbot] " syzbot
2024-08-19  3:27 ` syzbot [this message]
2024-08-19  5:37 ` syzbot
2024-08-19  6:47 ` [PATCH] bcachefs: Fix oob " Lizhi Xu
2024-08-19  7:05   ` Kent Overstreet
2024-08-20  7:11     ` [PATCH V2] bcachefs: Add journal v2 entry nr value check Lizhi Xu
2024-08-20 23:34       ` Kent Overstreet
2024-08-21  2:33         ` Lizhi Xu
2024-08-21  2:55           ` Kent Overstreet
2024-08-21  2:57           ` [PATCH V3] " Lizhi Xu
2024-08-21  3:00             ` Kent Overstreet
2024-08-21  3:10               ` Lizhi Xu
2024-08-21  3:16                 ` Kent Overstreet
2024-08-21  3:19                   ` Kent Overstreet
2024-08-21  3:30                   ` Lizhi Xu
2024-08-19 15:17   ` [PATCH] bcachefs: Fix oob in bch2_dev_journal_init kernel test robot
2024-08-19 19:45   ` kernel test robot
2024-08-22  3:03 ` [syzbot] [bcachefs?] KASAN: slab-out-of-bounds Write " Kent Overstreet

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=000000000000f5d890062000e13f@google.com \
    --to=syzbot+47ecc948aadfb2ab3efc@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