btrfs: fix crash on racing fsync and size-extending write into prealloc
In the Linux kernel, the following vulnerability has been resolved: btrfs: fix crash on racing fsync and size-extending write into prealloc We have been seeing crashes on duplicate keys in btrfs_set_item_key_safe(): BTRFS critical (device vdb): slot 4 key (450 108 8192) new key (450 108 8192) ------------[ cut here ]------------ kernel BUG at fs/btrfs/ctree.c:2620! invalid opcode: 0000 [#1] PREEMPT SMP PTI CPU: 0 PID: 3139 Comm: xfs_io Kdump: loaded Not tainted 6.9.0 #6 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.3-2.fc40 04/01/2014 RIP: 0010:btrfs_set_item_key_safe+0x11f/0x290 [btrfs] With the following stack trace: #0 btrfs_set_item_key_safe (fs/btrfs/ctree.c:2620:4) #1 btrfs_drop_extents (fs/btrfs/file.c:411:4) #2 log_one_extent (fs/btrfs/tree-log.c:4732:9) #3 btrfs_log_changed_extents (fs/btrfs/tree-log.c:4955:9) #4 btrfs_log_inode (fs/btrfs/tree-log.c:6626:9) #5 btrfs_log_inode_parent (fs/btrfs/tree-log.c:7070:8) #6 btrfs_log_dentry_safe (fs/btrfs/tree-log.c:7171:8) #7 btrfs_sync_file (fs/btrfs/file.c:1933:8) #8 vfs_fsync_range (fs/sync.c:188:9) #9 vfs_fsync (fs/sync.c:202:9) #10 do_fsync (fs/sync.c:212:9) #11 __do_sys_fdatasync (fs/sync.c:225:9) #12 __se_sys_fdatasync (fs/sync.c:223:1) #13 __x64_sys_fdatasync (fs/sync.c:223:1) #14 do_syscall_x64 (arch/x86/entry/common.c:52:14) #15 do_syscall_64 (arch/x86/entry/common.c:83:7) #16 entry_SYSCALL_64+0xaf/0x14c (arch/x86/entry/entry_64.S:121) So we're logging a changed extent from fsync, which is splitti
- Products
- Kernel
- Affected versions
- Not specified
- Fixed versions
- 5.15.197, 6.1.94, 6.6.34, 6.9.5
- CVEs
- CVE-2024-37354
- Confirmed fixed CVEs
- Not specified
- Updated in this feed
- 4 Nov 2026, 04:20 UTC · Revision 1
Source evidence
btrfs: fix crash on racing fsync and size-extending write into prealloc
core-osv · Original sourcePublished 25 Jun 2024, 14:22 UTC
In the Linux kernel, the following vulnerability has been resolved: btrfs: fix crash on racing fsync and size-extending write into prealloc We have been seeing crashes on duplicate keys in btrfs_set_item_key_safe(): BTRFS critical (device vdb): slot 4 key (450 108 8192) new key (450 108 8192) ------------[ cut here ]------------ kernel BUG at fs/btrfs/ctree.c:2620! invalid opcode: 0000 [#1] PREEMPT SMP PTI CPU: 0 PID: 3139 Comm: xfs_io Kdump: loaded Not tainted 6.9.0 #6 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.3-2.fc40 04/01/2014 RIP: 0010:btrfs_set_item_key_safe+0x11f/0x290 [btrfs] With the following stack trace: #0 btrfs_set_item_key_safe (fs/btrfs/ctree.c:2620:4) #1 btrfs_drop_extents (fs/btrfs/file.c:411:4) #2 log_one_extent (fs/btrfs/tree-log.c:4732:9) #3 btrfs_log_changed_extents (fs/btrfs/tree-log.c:4955:9) #4 btrfs_log_inode (fs/btrfs/tree-log.c:6626:9) #5 btrfs_log_inode_parent (fs/btrfs/tree-log.c:7070:8) #6 btrfs_log_dentry_safe (fs/btrfs/tree-log.c:7171:8) #7 btrfs_sync_file (fs/btrfs/file.c:1933:8) #8 vfs_fsync_range (fs/sync.c:188:9) #9 vfs_fsync (fs/sync.c:202:9) #10 do_fsync (fs/sync.c:212:9) #11 __do_sys_fdatasync (fs/sync.c:225:9) #12 __se_sys_fdatasync (fs/sync.c:223:1) #13 __x64_sys_fdatasync (fs/sync.c:223:1) #14 do_syscall_x64 (arch/x86/entry/common.c:52:14) #15 do_syscall_64 (arch/x86/entry/common.c:83:7) #16 entry_SYSCALL_64+0xaf/0x14c (arch/x86/entry/entry_64.S:121) So we're logging a changed extent from fsync, which is splitti
osv:CVE-2024-37354
Kernel
Fixed versions: 5.15.197, 6.1.94, 6.6.34, 6.9.5
Complete source record
{
"id": "0c69ea74f86401de66a926524d5e2b0a0b157af197432df7e55607fab2a31f5f",
"url": "https://osv.dev/vulnerability/CVE-2024-37354",
"method": "structured",
"payload": {
"kind": "advisory",
"title": "btrfs: fix crash on racing fsync and size-extending write into prealloc",
"summary": "In the Linux kernel, the following vulnerability has been resolved: btrfs: fix crash on racing fsync and size-extending write into prealloc We have been seeing crashes on duplicate keys in btrfs_set_item_key_safe(): BTRFS critical (device vdb): slot 4 key (450 108 8192) new key (450 108 8192) ------------[ cut here ]------------ kernel BUG at fs/btrfs/ctree.c:2620! invalid opcode: 0000 [#1] PREEMPT SMP PTI CPU: 0 PID: 3139 Comm: xfs_io Kdump: loaded Not tainted 6.9.0 #6 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.3-2.fc40 04/01/2014 RIP: 0010:btrfs_set_item_key_safe+0x11f/0x290 [btrfs] With the following stack trace: #0 btrfs_set_item_key_safe (fs/btrfs/ctree.c:2620:4) #1 btrfs_drop_extents (fs/btrfs/file.c:411:4) #2 log_one_extent (fs/btrfs/tree-log.c:4732:9) #3 btrfs_log_changed_extents (fs/btrfs/tree-log.c:4955:9) #4 btrfs_log_inode (fs/btrfs/tree-log.c:6626:9) #5 btrfs_log_inode_parent (fs/btrfs/tree-log.c:7070:8) #6 btrfs_log_dentry_safe (fs/btrfs/tree-log.c:7171:8) #7 btrfs_sync_file (fs/btrfs/file.c:1933:8) #8 vfs_fsync_range (fs/sync.c:188:9) #9 vfs_fsync (fs/sync.c:202:9) #10 do_fsync (fs/sync.c:212:9) #11 __do_sys_fdatasync (fs/sync.c:225:9) #12 __se_sys_fdatasync (fs/sync.c:223:1) #13 __x64_sys_fdatasync (fs/sync.c:223:1) #14 do_syscall_x64 (arch/x86/entry/common.c:52:14) #15 do_syscall_64 (arch/x86/entry/common.c:83:7) #16 entry_SYSCALL_64+0xaf/0x14c (arch/x86/entry/entry_64.S:121) So we're logging a changed extent from fsync, which is splitti",
"evidence": "osv:CVE-2024-37354",
"products": [
{
"name": {
"value": "Kernel",
"evidence": "/affected/1/package/name"
},
"prerequisites": [],
"fixed_versions": [
{
"value": "5.15.197",
"evidence": "/affected/1/ranges"
},
{
"value": "6.1.94",
"evidence": "/affected/1/ranges"
},
{
"value": "6.6.34",
"evidence": "/affected/1/ranges"
},
{
"value": "6.9.5",
"evidence": "/affected/1/ranges"
}
],
"affected_versions": []
}
],
"severity": "high",
"structured": {
"id": "CVE-2024-37354",
"aliases": [
"CVE-2024-37354"
],
"metrics": [
{
"type": "CVSS_V3",
"score": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H"
}
],
"affected": [
{
"ranges": [
{
"repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
"type": "GIT",
"events": [
{
"introduced": "31d11b83b96faaee4bb514d375a09489117c3e8d"
},
{
"fixed": "c993fd02ba471e296ca1996f13626fc917120158"
},
{
"fixed": "1ff2bd566fbcefcb892be85c493bdb92b911c428"
},
{
"fixed": "3d08c52ba1887a1ff9c179d4b6a18b427bcb2097"
},
{
"fixed": "f4e5ed974876c14d3623e04dc43d3e3281bc6011"
},
{
"fixed": "9d274c19a71b3a276949933859610721a453946b"
}
]
},
{
"repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
"type": "GIT",
"events": [
{
"introduced": "4.14.57"
},
{
"fixed": "4.15"
}
]
},
{
"repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
"type": "GIT",
"events": [
{
"introduced": "61a9f6b7fe0ca9706b49a23cecf5f9a9c802b6ce"
}
]
}
],
"versions": [
"v4.14.336",
"v4.14.335",
"v4.14.334",
"v4.14.333",
"v4.14.332",
"v4.14.331",
"v4.14.330",
"v4.14.329",
"v4.14.328",
"v4.14.327",
"v4.14.326",
"v4.14.325",
"v4.14.324",
"v4.14.323",
"v4.14.322",
"v4.14.321",
"v4.14.320",
"v4.14.319",
"v4.14.318",
"v4.14.317",
"v4.14.316",
"v4.14.315",
"v4.14.314",
"v4.14.313",
"v4.14.312",
"v4.14.311",
"v4.14.310",
"v4.14.309",
"v4.14.308",
"v4.14.307",
"v4.14.306",
"v4.14.305",
"v4.14.304",
"v4.14.303",
"v4.14.302",
"v4.14.301",
"v4.14.300",
"v4.14.299",
"v4.14.298",
"v4.14.297",
"v4.14.296",
"v4.14.295",
"v4.14.294",
"v4.14.293",
"v4.14.292",
"v4.14.291",
"v4.14.290",
"v4.14.289",
"v4.14.288",
"v4.14.287",
"v4.14.286",
"v4.14.285",
"v4.14.284",
"v4.14.283",
"v4.14.282",
"v4.14.281",
"v4.14.280",
"v4.14.279",
"v4.14.278",
"v4.14.277",
"v4.14.276",
"v4.14.275",
"v4.14.274",
"v4.14.273",
"v4.14.272",
"v4.14.271",
"v4.14.270",
"v4.14.269",
"v4.14.268",
"v4.14.267",
"v4.14.266",
"v4.14.265",
"v4.14.264",
"v4.14.263",
"v4.14.262",
"v4.14.261",
"v4.14.260",
"v4.14.259",
"v4.14.258",
"v4.14.257",
"v4.14.256",
"v4.14.255",
"v4.14.254",
"v4.14.253",
"v4.14.252",
"v4.14.251",
"v4.14.250",
"v4.14.249",
"v4.14.248",
"v4.14.247",
"v4.14.246",
"v4.14.245",
"v4.14.244",
"v4.14.243",
"v4.14.242",
"v4.14.241",
"v4.14.240",
"v4.14.239",
"v4.14.238",
"v4.14.237",
"v4.14.236",
"v4.14.235",
"v4.14.234",
"v4.14.233",
"v4.14.232",
"v4.14.231",
"v4.14.230",
"v4.14.229",
"v4.14.228",
"v4.14.227",
"v4.14.226",
"v4.14.225",
"v4.14.224",
"v4.14.223",
"v4.14.222",
"v4.14.221",
"v4.14.220",
"v4.14.219",
"v4.14.218",
"v4.14.217",
"v4.14.216",
"v4.14.215",
"v4.14.214",
"v4.14.213",
"v4.14.212",
"v4.14.211",
"v4.14.210",
"v4.14.209",
"v4.14.208",
"v4.14.207",
"v4.14.206",
"v4.14.205",
"v4.14.204",
"v4.14.203",
"v4.14.202",
"v4.14.201",
"v4.14.200",
"v4.14.199",
"v4.14.198",
"v4.14.197",
"v4.14.196",
"v4.14.195",
"v4.14.194",
"v4.14.193",
"v4.14.192",
"v4.14.191",
"v4.14.190",
"v4.14.189",
"v4.14.188",
"v4.14.187",
"v4.14.186",
"v4.14.185",
"v4.14.184",
"v4.14.183",
"v4.14.182",
"v4.14.181",
"v4.14.180",
"v4.14.179",
"v4.14.178",
"v4.14.177",
"v4.14.176",
"v4.14.175",
"v4.14.174",
"v4.14.173",
"v4.14.172",
"v4.14.171",
"v4.14.170",
"v4.14.169",
"v4.14.168",
"v4.14.167",
"v4.14.166",
"v4.14.165",
"v4.14.164",
"v4.14.163",
"v4.14.162",
"v4.14.161",
"v4.14.160",
"v4.14.159",
"v4.14.158",
"v4.14.157",
"v4.14.156",
"v4.14.155",
"v4.14.154",
"v4.14.153",
"v4.14.152",
"v4.14.151",
"v4.14.150",
"v4.14.149",
"v4.14.148",
"v4.14.147",
"v4.14.146",
"v4.14.145",
"v4.14.144",
"v4.14.143",
"v4.14.142",
"v4.14.141",
"v4.14.140",
"v4.14.139",
"v4.14.138",
"v4.14.137",
"v4.14.136",
"v4.14.135",
"v4.14.134",
"v4.14.133",
"v4.14.132",
"v4.14.131",
"v4.14.130",
"v4.14.129",
"v4.14.128",
"v4.14.127",
"v4.14.126",
"v4.14.125",
"v4.14.124",
"v4.14.123",
"v4.14.122",
"v4.14.121",
"v4.14.120",
"v4.14.119",
"v4.14.118",
"v4.14.117",
"v4.14.116",
"v4.14.115",
"v4.14.114",
"v4.14.113",
"v4.14.112",
"v4.14.111",
"v4.14.110",
"v4.14.109",
"v4.14.108",
"v4.14.107",
"v4.14.106",
"v4.14.105",
"v4.14.104",
"v4.14.103",
"v4.14.102",
"v4.14.101",
"v4.14.100",
"v4.14.99",
"v4.14.98",
"v4.14.97",
"v4.14.96",
"v4.14.95",
"v4.14.94",
"v4.14.93",
"v4.14.92",
"v4.14.91",
"v4.14.90",
"v4.14.89",
"v4.14.88",
"v4.14.87",
"v4.14.86",
"v4.14.85",
"v4.14.84",
"v4.14.83",
"v4.14.82",
"v4.14.81",
"v4.14.80",
"v4.14.79",
"v4.14.78",
"v4.14.77",
"v4.14.76",
"v4.14.75",
"v4.14.74",
"v4.14.73",
"v4.14.72",
"v4.14.71",
"v4.14.70",
"v4.14.69",
"v4.14.68",
"v4.14.67",
"v4.14.66",
"v4.14.65",
"v4.14.64",
"v4.14.63",
"v4.14.62",
"v4.14.61",
"v4.14.60",
"v4.14.59",
"v4.14.58",
"v4.14.57"
],
"database_specific": {
"source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2024-37354.json"
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "4.17.0"
},
{
"fixed": "5.15.197"
}
]
},
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "5.16.0"
},
{
"fixed": "6.1.94"
}
]
},
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "6.2.0"
},
{
"fixed": "6.6.34"
}
]
},
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "6.7.0"
},
{
"fixed": "6.9.5"
}
]
}
],
"package": {
"name": "Kernel",
"ecosystem": "Linux"
},
"database_specific": {
"source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2024-37354.json"
}
}
],
"modified": "2026-10-28T02:30:33.123246592Z",
"provider": "osv",
"references": [
"https://git.kernel.org/stable/c/1ff2bd566fbcefcb892be85c493bdb92b911c428",
"https://git.kernel.org/stable/c/3d08c52ba1887a1ff9c179d4b6a18b427bcb2097",
"https://git.kernel.org/stable/c/9d274c19a71b3a276949933859610721a453946b",
"https://git.kernel.org/stable/c/c993fd02ba471e296ca1996f13626fc917120158",
"https://git.kernel.org/stable/c/f4e5ed974876c14d3623e04dc43d3e3281bc6011",
"https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/37xxx/CVE-2024-37354.json",
"https://nvd.nist.gov/vuln/detail/CVE-2024-37354",
"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"
],
"provider_metadata": {
"cna_assigner": "Linux",
"osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/37xxx/CVE-2024-37354.json"
}
},
"related_cves": [
{
"value": "CVE-2024-37354",
"evidence": "/id"
}
],
"security_relevant": true,
"severity_evidence": "/severity/0/score"
},
"source_id": "core-osv",
"document_id": 500258,
"published_at": "2024-06-25T14:22:36.228+00:00"
}