From: Qu Wenruo <quwenruo.btrfs@gmx.com>
To: Lizhi Xu <lizhi.xu@windriver.com>,
syzbot+3030e17bd57a73d39bd7@syzkaller.appspotmail.com
Cc: clm@fb.com, dsterba@suse.com, josef@toxicpanda.com,
linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org,
syzkaller-bugs@googlegroups.com
Subject: Re: [syzbot] [btrfs?] general protection fault in btrfs_search_slot
Date: Fri, 25 Oct 2024 14:49:48 +1030 [thread overview]
Message-ID: <7f0a7b2d-369c-42ae-9054-7436bc98f7c1@gmx.com> (raw)
In-Reply-To: <20241025022348.1255662-1-lizhi.xu@windriver.com>
在 2024/10/25 12:53, Lizhi Xu 写道:
> use the input logical can't find the extent root, so add sanity check for
> extent root before search slot.
>
> #syz test
>
> diff --git a/fs/btrfs/backref.c b/fs/btrfs/backref.c
> index f8e1d5b2c512..87eaf5dd2d5d 100644
> --- a/fs/btrfs/backref.c
> +++ b/fs/btrfs/backref.c
> @@ -2213,6 +2213,9 @@ int extent_from_logical(struct btrfs_fs_info *fs_info, u64 logical,
> key.objectid = logical;
> key.offset = (u64)-1;
>
> + if (!extent_root)
> + return -ENOENT;
Considering we have a lot of such btrfs_search_slot() without checking
if the csum/extent root is NULL, can we move the check into
btrfs_search_slot()?
Thanks,
Qu
> +
> ret = btrfs_search_slot(NULL, extent_root, &key, path, 0, 0);
> if (ret < 0)
> return ret;
>
next prev parent reply other threads:[~2024-10-25 4:20 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-24 3:50 syzbot
2024-10-25 2:23 ` Lizhi Xu
2024-10-25 2:44 ` syzbot
2024-10-25 4:19 ` Qu Wenruo [this message]
2024-10-25 4:38 ` [syzbot] [bcachefs?] KASAN: slab-use-after-free Read in bch2_reconstruct_alloc Lizhi Xu
2024-10-25 4:44 ` Qu Wenruo
2024-10-25 4:59 ` [syzbot] [btrfs?] general protection fault in btrfs_search_slot syzbot
2024-10-25 4:55 ` [PATCH] btrfs: add a sanity check for btrfs root Lizhi Xu
2024-10-25 9:53 ` Qu Wenruo
2024-10-25 18:03 ` David Sterba
2024-10-25 21:03 ` Qu Wenruo
2024-10-25 22:22 ` David Sterba
2024-11-03 21:44 ` [syzbot] [btrfs?] general protection fault in btrfs_search_slot 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=7f0a7b2d-369c-42ae-9054-7436bc98f7c1@gmx.com \
--to=quwenruo.btrfs@gmx.com \
--cc=clm@fb.com \
--cc=dsterba@suse.com \
--cc=josef@toxicpanda.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lizhi.xu@windriver.com \
--cc=syzbot+3030e17bd57a73d39bd7@syzkaller.appspotmail.com \
--cc=syzkaller-bugs@googlegroups.com \
/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
all inboxes | Powered by JetHome®