{"schemaVersion":1,"url":"https://cve.openhack.com/cve/CVE-2024-56759","id":"CVE-2024-56759","title":"btrfs: fix use-after-free when COWing tree bock and tracing is enabled","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nbtrfs: fix use-after-free when COWing tree bock and tracing is enabled\n\nWhen a COWing a tree block, at btrfs_cow_block(), and we have the\ntracepoint trace_btrfs_cow_block() enabled and preemption is also enabled\n(CONFIG_PREEMPT=y), we can trigger a use-after-free in the COWed extent\nbuffer while inside the tracepoint code. This i","descriptionLong":"In the Linux kernel, the following vulnerability has been resolved:\n\nbtrfs: fix use-after-free when COWing tree bock and tracing is enabled\n\nWhen a COWing a tree block, at btrfs_cow_block(), and we have the\ntracepoint trace_btrfs_cow_block() enabled and preemption is also enabled\n(CONFIG_PREEMPT=y), we can trigger a use-after-free in the COWed extent\nbuffer while inside the tracepoint code. This is because in some paths\nthat call btrfs_cow_block(), such as btrfs_search_slot(), we are holding\nthe last reference on the extent buffer @buf so btrfs_force_cow_block()\ndrops the last reference on the @buf extent buffer when it calls\nfree_extent_buffer_stale(buf), which schedules the release of the extent\nbuffer with RCU. This means that if we are on a kernel with preemption,\nthe current task may be preempted before calling trace_btrfs_cow_block()\nand the extent buffer already released by the time trace_btrfs_cow_block()\nis called, resulting in a use-after-free.\n\nFix this by moving the trace_btrfs_cow_block() from btrfs_cow_block() to\nbtrfs_force_cow_block() before the COWed extent buffer is freed.\nThis also has a side effect of invoking the tracepoint in the tree defrag\ncode, at defrag.c:btrfs_realloc_node(), since btrfs_force_cow_block() is\ncalled there, but this is fine and it was actually missing there.","published":"2025-01-06T16:20:39.668Z","updated":"2026-10-28T02:30:41.109645497Z","reserved":"2024-12-29T11:26:39.761Z","status":"Modified","rejected":false,"assigner":"Linux","metric":{"version":"3.1","score":7.8,"vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","rating":"high","source":"Linux"},"metrics":[{"version":"3.1","score":7.8,"vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","rating":"high","source":"Linux"},{"version":"3.1","score":7.8,"vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","rating":"high","source":"NVD"},{"version":"3.1","score":7.8,"vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","rating":"high","source":"CISA-ADP"},{"version":"3.1","score":7.8,"vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","rating":"high","source":"OSV"}],"rating":"high","products":["Linux"],"affectedProducts":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"3083ee2e18b701122a3b841db83448543a87a583","lessThan":"ba5120a2fb5f23b4d39d302e181aa5d4e28a90d1","status":"affected","versionType":"git"},{"version":"3083ee2e18b701122a3b841db83448543a87a583","lessThan":"526ff5b27f090fb15040471f892cd2c9899ce314","status":"affected","versionType":"git"},{"version":"3083ee2e18b701122a3b841db83448543a87a583","lessThan":"66376f1a73cba57fd0af2631d7888605b738e499","status":"affected","versionType":"git"},{"version":"3083ee2e18b701122a3b841db83448543a87a583","lessThan":"9a466b8693b9add05de99af00c7bdff8259ecf19","status":"affected","versionType":"git"},{"version":"3083ee2e18b701122a3b841db83448543a87a583","lessThan":"c3a403d8ce36f5a809a492581de5ad17843e4701","status":"affected","versionType":"git"},{"version":"3083ee2e18b701122a3b841db83448543a87a583","lessThan":"44f52bbe96dfdbe4aca3818a2534520082a07040","status":"affected","versionType":"git"}],"platforms":[]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"3.4","status":"affected"},{"version":"0","lessThan":"3.4","status":"unaffected","versionType":"semver"},{"version":"5.10.233","lessThanOrEqual":"5.10.*","status":"unaffected","versionType":"semver"},{"version":"5.15.176","lessThanOrEqual":"5.15.*","status":"unaffected","versionType":"semver"},{"version":"6.1.124","lessThanOrEqual":"6.1.*","status":"unaffected","versionType":"semver"},{"version":"6.6.70","lessThanOrEqual":"6.6.*","status":"unaffected","versionType":"semver"},{"version":"6.12.8","lessThanOrEqual":"6.12.*","status":"unaffected","versionType":"semver"},{"version":"6.13","lessThanOrEqual":"*","status":"unaffected","versionType":"original_commit_for_fix"}],"platforms":[]}],"packages":[],"cwes":["CWE-416"],"aliases":[],"references":[{"url":"https://git.kernel.org/stable/c/ba5120a2fb5f23b4d39d302e181aa5d4e28a90d1","tags":["web"]},{"url":"https://git.kernel.org/stable/c/526ff5b27f090fb15040471f892cd2c9899ce314","tags":["web"]},{"url":"https://git.kernel.org/stable/c/66376f1a73cba57fd0af2631d7888605b738e499","tags":["web"]},{"url":"https://git.kernel.org/stable/c/9a466b8693b9add05de99af00c7bdff8259ecf19","tags":["web"]},{"url":"https://git.kernel.org/stable/c/c3a403d8ce36f5a809a492581de5ad17843e4701","tags":["Patch","web"]},{"url":"https://git.kernel.org/stable/c/44f52bbe96dfdbe4aca3818a2534520082a07040","tags":["Patch","web"]},{"url":"https://lists.debian.org/debian-lts-announce/2025/03/msg00001.html","tags":["web"]},{"url":"https://lists.debian.org/debian-lts-announce/2025/03/msg00002.html","tags":["web"]},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/56xxx/CVE-2024-56759.json","tags":["advisory"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2024-56759","tags":["advisory"]},{"url":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","tags":["package"]}],"patchReferenced":true,"fixAvailable":true,"exploitReferenced":false,"kev":false,"kevAdded":null,"kevDue":null,"kevEntry":null,"ssvc":{"exploitation":"none","automatable":"no","technicalImpact":"total"},"epss":0.00223,"epssPercentile":0.13038,"sources":[{"name":"CVE List","url":"https://www.cve.org/CVERecord?id=CVE-2024-56759","ok":true},{"name":"NVD","url":"https://nvd.nist.gov/vuln/detail/CVE-2024-56759","ok":true,"note":"Modified"},{"name":"OSV","url":"https://osv.dev/vulnerability/CVE-2024-56759","ok":true,"note":"0 packages"},{"name":"CISA KEV","url":"https://www.cisa.gov/known-exploited-vulnerabilities-catalog","ok":true,"note":"not listed"},{"name":"EPSS","url":"https://api.first.org/data/v1/epss?cve=CVE-2024-56759","ok":true,"note":"scored 2026-11-19"}],"aiTitle":false,"tech":[],"critical":[],"attention":null}