{"id":"CVE-2025-71159","published":"2026-01-23T15:23:57Z","modified":"2026-08-05T12:12:25Z","title":"btrfs: fix use-after-free warning in btrfs_get_or_create_delayed_node()","vendor":"Linux","product":"Linux","tier":"tail","description":{"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.","provenance":"source","from":"CVE.org"},"cvss":{"score":9.8,"severity":"CRITICAL","version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00442,"percentile":0.30322,"provenance":"source"},"cwes":[],"references":[{"url":"https://git.kernel.org/stable/c/c8385851a5435f4006281828d428e5d0b0bbf8af","tags":[]},{"url":"https://git.kernel.org/stable/c/83f59076a1ae6f5c6845d6f7ed3a1a373d883684","tags":[]}],"priority":{"score":12.9,"factors":[{"name":"EPSS percentile","points":6.06},{"name":"CVSS severity","points":6.86}]},"vendorSlug":"linux","affectedVersions":[{"vendor":"Linux","product":"Linux","versions":[">= e8513c012de75fd65e2df5499572bc6ef3f6e409, < c8385851a5435f4006281828d428e5d0b0bbf8af",">= e8513c012de75fd65e2df5499572bc6ef3f6e409, < 83f59076a1ae6f5c6845d6f7ed3a1a373d883684"]},{"vendor":"Linux","product":"Linux","versions":["6.18"]}],"euvd":{"id":"EUVD-2026-4311","exploited":false,"provenance":"source"}}