public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: syzbot <syzbot+9c3e0cdfbfe351b0bc0e@syzkaller.appspotmail.com>
To: linux-kernel@vger.kernel.org
Subject: Re: [syzbot] [syzbot] [btrfs?] general protection fault in btrfs_root_node
Date: Tue, 03 Sep 2024 18:38:59 -0700	[thread overview]
Message-ID: <000000000000f2ca920621413c5f@google.com> (raw)
In-Reply-To: <0000000000001b6052062139be1c@google.com>

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

***

Subject: [syzbot] [btrfs?] general protection fault in btrfs_root_node
Author: ghanshyam1898@gmail.com

Added a check for the nullability of the extent_root variable.

I am not sure what error code I should return when the variable is
null. Can someone help me with this? Thank you very much.

#syz test

diff --git a/fs/btrfs/ref-verify.c b/fs/btrfs/ref-verify.c
index 9522a8b79d22..e613420cb079 100644
--- a/fs/btrfs/ref-verify.c
+++ b/fs/btrfs/ref-verify.c
@@ -1002,6 +1002,9 @@ int btrfs_build_ref_tree(struct btrfs_fs_info *fs_info)
  return -ENOMEM;

  extent_root = btrfs_extent_root(fs_info, 0);
+ if (!extent_root)
+ return -EBADF;
+
  eb = btrfs_read_lock_root_node(extent_root);
  level = btrfs_header_level(eb);
  path->nodes[level] = eb;

  reply	other threads:[~2024-09-04  1:38 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-03 16:42 [syzbot] [btrfs?] general protection fault in btrfs_root_node syzbot
2024-09-04  1:38 ` syzbot [this message]
2024-09-04  1:43 ` [syzbot] " syzbot
2024-09-04  2:12 ` syzbot
2024-11-12 10:47 ` 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=000000000000f2ca920621413c5f@google.com \
    --to=syzbot+9c3e0cdfbfe351b0bc0e@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