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().
[
{
"digest": {
"threshold": 0.9,
"line_hashes": [
"275923762203616543590799744849923175234",
"110346508370878488124397630291586552300",
"208530474588683269404165421871073562109",
"162863540315669092517204559022865457516",
"188748992256941218988643201286965506343",
"296318574069563834485246672581406694256",
"191105100936979541410378425554936771464"
]
},
"signature_type": "Line",
"target": {
"file": "fs/btrfs/ctree.c"
},
"deprecated": false,
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@c71d114ef68c95da5a82ec85a721ab31f5bd905b",
"id": "CVE-2024-56774-09777f22"
},
{
"digest": {
"length": 3456.0,
"function_hash": "304149029685064956094740698460627013217"
},
"signature_type": "Function",
"target": {
"function": "btrfs_search_slot",
"file": "fs/btrfs/ctree.c"
},
"deprecated": false,
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@3ed51857a50f530ac7a1482e069dfbd1298558d4",
"id": "CVE-2024-56774-1ae1e356"
},
{
"digest": {
"length": 3441.0,
"function_hash": "182068072012648920668988895313948507736"
},
"signature_type": "Function",
"target": {
"function": "btrfs_search_slot",
"file": "fs/btrfs/ctree.c"
},
"deprecated": false,
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@757171d1369b3b47f36932d40a05a0715496dcab",
"id": "CVE-2024-56774-36c6476a"
},
{
"digest": {
"length": 3441.0,
"function_hash": "182068072012648920668988895313948507736"
},
"signature_type": "Function",
"target": {
"function": "btrfs_search_slot",
"file": "fs/btrfs/ctree.c"
},
"deprecated": false,
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@93992c3d9629b02dccf6849238559d5c24f2dece",
"id": "CVE-2024-56774-8a2bbdc1"
},
{
"digest": {
"length": 3441.0,
"function_hash": "182068072012648920668988895313948507736"
},
"signature_type": "Function",
"target": {
"function": "btrfs_search_slot",
"file": "fs/btrfs/ctree.c"
},
"deprecated": false,
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@db66fb87c21e8ae724886e6a464dcbac562a64c6",
"id": "CVE-2024-56774-910151d8"
},
{
"digest": {
"length": 3527.0,
"function_hash": "267886924274754521441661764941451519289"
},
"signature_type": "Function",
"target": {
"function": "btrfs_search_slot",
"file": "fs/btrfs/ctree.c"
},
"deprecated": false,
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@c71d114ef68c95da5a82ec85a721ab31f5bd905b",
"id": "CVE-2024-56774-af3deb5a"
},
{
"digest": {
"threshold": 0.9,
"line_hashes": [
"275923762203616543590799744849923175234",
"110346508370878488124397630291586552300",
"208530474588683269404165421871073562109",
"162863540315669092517204559022865457516",
"188748992256941218988643201286965506343",
"296318574069563834485246672581406694256",
"191105100936979541410378425554936771464"
]
},
"signature_type": "Line",
"target": {
"file": "fs/btrfs/ctree.c"
},
"deprecated": false,
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@93992c3d9629b02dccf6849238559d5c24f2dece",
"id": "CVE-2024-56774-bcd4822c"
},
{
"digest": {
"threshold": 0.9,
"line_hashes": [
"275923762203616543590799744849923175234",
"110346508370878488124397630291586552300",
"208530474588683269404165421871073562109",
"162863540315669092517204559022865457516",
"188748992256941218988643201286965506343",
"296318574069563834485246672581406694256",
"191105100936979541410378425554936771464"
]
},
"signature_type": "Line",
"target": {
"file": "fs/btrfs/ctree.c"
},
"deprecated": false,
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@757171d1369b3b47f36932d40a05a0715496dcab",
"id": "CVE-2024-56774-c96a5d4e"
},
{
"digest": {
"threshold": 0.9,
"line_hashes": [
"275923762203616543590799744849923175234",
"110346508370878488124397630291586552300",
"208530474588683269404165421871073562109",
"162863540315669092517204559022865457516",
"188748992256941218988643201286965506343",
"296318574069563834485246672581406694256",
"191105100936979541410378425554936771464"
]
},
"signature_type": "Line",
"target": {
"file": "fs/btrfs/ctree.c"
},
"deprecated": false,
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@3ed51857a50f530ac7a1482e069dfbd1298558d4",
"id": "CVE-2024-56774-d3c73250"
},
{
"digest": {
"threshold": 0.9,
"line_hashes": [
"275923762203616543590799744849923175234",
"110346508370878488124397630291586552300",
"208530474588683269404165421871073562109",
"162863540315669092517204559022865457516",
"188748992256941218988643201286965506343",
"296318574069563834485246672581406694256",
"191105100936979541410378425554936771464"
]
},
"signature_type": "Line",
"target": {
"file": "fs/btrfs/ctree.c"
},
"deprecated": false,
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@db66fb87c21e8ae724886e6a464dcbac562a64c6",
"id": "CVE-2024-56774-ee8aeedb"
}
]