[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <000000000000f2ca920621413c5f@google.com>
Date: Tue, 03 Sep 2024 18:38:59 -0700
From: syzbot <syzbot+9c3e0cdfbfe351b0bc0e@...kaller.appspotmail.com>
To: linux-kernel@...r.kernel.org
Subject: Re: [syzbot] [syzbot] [btrfs?] general protection fault in btrfs_root_node
For archival purposes, forwarding an incoming command email to
linux-kernel@...r.kernel.org.
***
Subject: [syzbot] [btrfs?] general protection fault in btrfs_root_node
Author: ghanshyam1898@...il.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;
Powered by blists - more mailing lists