{"id":"CVE-2025-71159","aliases":["CVE-2025-71159"],"related":[],"kind":"vulnerability","state":"published","title":"btrfs: fix use-after-free warning in btrfs_get_or_create_delayed_node()","summary":"In the Linux kernel, the following vulnerability has been resolved:\n\nbtrfs: fix use-after-free warning in btrfs_get_or_create_delayed_node()\n\nPreviously, btrfs_get_or_create_delayed_node() set the delayed_node's\nrefcount before acquiring the root->delayed_nodes lock.\nCommit e8513c012de7 (\"btrfs: implement ref_tracker for delayed_nodes\")\nmoved refcount_set inside the critical section, which means there is\nno longer a memory barrier between setting the refcount and setting\nbtrfs_inode->delayed_node.\n\nWithout that barrier, the stores to node->refs and\nbtrfs_inode->delayed_node may become visible out of order. Another\nthread can then read btrfs_inode->delayed_node and attempt to\nincrement a refcount that hasn't been set yet, leading to a\nrefcounting bug and a use-after-free warning.\n\nThe fix is to move refcount_set back to where it was to take\nadvantage of the implicit memory barrier provided by lock\nacquisition.\n\nBecause the allocations now happen outside of the lock's critical\nsection, they can use GFP_NOFS instead of GFP_ATOMIC.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In the Linux kernel, the following vulnerability has been resolved:\n\nbtrfs: fix use-after-free warning in btrfs_get_or_create_delayed_node()\n\nPreviously, btrfs_get_or_create_delayed_node() set the delayed_node's\nrefcount before acquiring the root->delayed_nodes lock.\nCommit e8513c012de7 (\"btrfs: implement ref_tracker for delayed_nodes\")\nmoved refcount_set inside the critical section, which means there is\nno longer a memory barrier between setting the refcount and setting\nbtrfs_inode->delayed_node.\n\nWithout that barrier, the stores to node->refs and\nbtrfs_inode->delayed_node may become visible out of order. Another\nthread can then read btrfs_inode->delayed_node and attempt to\nincrement a refcount that hasn't been set yet, leading to a\nrefcounting bug and a use-after-free warning.\n\nThe fix is to move refcount_set back to where it was to take\nadvantage of the implicit memory barrier provided by lock\nacquisition.\n\nBecause the allocations now happen outside of the lock's critical\nsection, they can use GFP_NOFS instead of GFP_ATOMIC.","source":"cvelist"},{"lang":"es","text":"En el kernel de Linux, la siguiente vulnerabilidad ha sido resuelta:\n\nbtrfs: soluciona la advertencia de uso después de liberación en btrfs_get_or_create_delayed_node()\n\nAnteriormente, btrfs_get_or_create_delayed_node() establecía el refcount del delayed_node antes de adquirir el bloqueo root-&gt;delayed_nodes. El commit e8513c012de7 ('btrfs: implementa ref_tracker para delayed_nodes') movió refcount_set dentro de la sección crítica, lo que significa que ya no hay una barrera de memoria entre el establecimiento del refcount y el establecimiento de btrfs_inode-&gt;delayed_node.\n\nSin esa barrera, los almacenamientos en node-&gt;refs y btrfs_inode-&gt;delayed_node pueden volverse visibles fuera de orden. Otro hilo puede entonces leer btrfs_inode-&gt;delayed_node e intentar incrementar un refcount que aún no ha sido establecido, lo que lleva a un error de refcounting y a una advertencia de uso después de liberación.\n\nLa solución es mover refcount_set de vuelta a donde estaba para aprovechar la barrera de memoria implícita proporcionada por la adquisición del bloqueo.\n\nDebido a que las asignaciones ahora ocurren fuera de la sección crítica del bloqueo, pueden usar GFP_NOFS en lugar de GFP_ATOMIC.","source":"nvd"}],"published":"2026-01-23T15:23:57.824Z","modified":"2026-08-05T12:12:25.188Z","severity":{"scorer":"Linux","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"},"severities":[{"scorer":"Linux","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","score":7.8,"rating":"HIGH"}],"cwes":["CWE-416"],"affected":[{"ranges":[{"type":"git","introduced":"e8513c012de75fd65e2df5499572bc6ef3f6e409","fixed":"c8385851a5435f4006281828d428e5d0b0bbf8af","status":"affected"},{"type":"git","introduced":"e8513c012de75fd65e2df5499572bc6ef3f6e409","fixed":"83f59076a1ae6f5c6845d6f7ed3a1a373d883684","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"6.18","status":"affected"},{"type":"semver","introduced":"0","fixed":"6.18","status":"unaffected"},{"type":"semver","introduced":"6.18.6","lastAffected":"6.18.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"6.19","lastAffected":"*","status":"unaffected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"status":"affected","introduced":"6.18","fixed":"6.18.6"},{"status":"affected","version":"6.19"},{"status":"affected","version":"6.19"},{"status":"affected","version":"6.19"},{"status":"affected","version":"6.19"}],"vendor":"linux","product":"linux_kernel","cpe":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://git.kernel.org/stable/c/c8385851a5435f4006281828d428e5d0b0bbf8af","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/83f59076a1ae6f5c6845d6f7ed3a1a373d883684","tags":["patch"],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2025-71159","url":"https://www.cve.org/CVERecord?id=CVE-2025-71159","licence":"CVE Terms of Use","modified":"2026-08-05T12:12:25.188Z"},{"source":"nvd","name":"NVD","id":"CVE-2025-71159","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-71159","licence":"Public domain","modified":"2026-07-30T06:24:54.993Z"}],"updatedAt":"2026-11-25T22:59:10.841Z","epss":{"score":0.00246,"percentile":0.17014,"date":"2026-12-01T12:00:22.000Z"}}