In the Linux kernel, the following vulnerability has been resolved:
btrfs: add a sanity check for btrfs root in btrfssearchslot()
Syzbot reports a null-ptr-deref in btrfssearchslot().
The reproducer is using rescue=ibadroots, and the extent tree root is corrupted thus the extent tree is NULL.
When scrub tries to search the extent tree to gather the needed extent info, btrfssearchslot() doesn't check if the target root is NULL or not, resulting the null-ptr-deref.
Add sanity check for btrfs root before using it in btrfssearchslot().