{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2025-71159","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","state":"PUBLISHED","assignerShortName":"Linux","dateReserved":"2026-01-13T15:30:19.665Z","datePublished":"2026-01-23T15:23:57.824Z","dateUpdated":"2026-08-05T12:12:25.188Z"},"containers":{"cna":{"providerMetadata":{"orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","shortName":"Linux","dateUpdated":"2026-08-05T12:12:25.188Z"},"descriptions":[{"lang":"en","value":"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."}],"metrics":[{"cvssV3_1":{"version":"3.1","vectorString":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","baseScore":9.8,"baseSeverity":"CRITICAL"},"scenarios":[{"lang":"en","value":"AV:N - A remote attacker can reach the path through a writable Btrfs-backed ksmbd guest share: SMB2 WRITE reaches ksmbd_vfs_write(), kernel_write(), and the Btrfs ordered-write completion path. This is a reasonable network-facing Btrfs deployment.\nAC:L - Concurrent writes create multiple ordered extents whose parallel end-I/O workers can race while publishing and acquiring the same delayed node. The attacker controls the workload and can repeatedly create both sides of the race.\nPR:N - Although ksmbd checks the session, writable tree connection, and file handle, a guest-writable share grants these without attacker credentials. No prior account, capability, or local privilege is therefore required in that deployment.\nUI:N - The attacker directly triggers the race with concurrent write requests; no separate victim action is required.\nS:U - The vulnerable Btrfs code and the resulting kernel memory corruption are within the same host-kernel security authority.\nC:H - The lost reference can leave a delayed-node pointer usable after its slab object is freed and reused. Exploitation of this kernel use-after-free can expose arbitrary kernel memory.\nI:H - Subsequent mutex, flag, counter, tree, and inode-item operations write through the stale pointer. Heap reuse and spraying can turn these writes into kernel memory corruption and potential code execution.\nA:H - The observed refcount failure raises a kernel warning, and use of the prematurely freed delayed node can cause an oops, panic, hang, or filesystem shutdown."}]}],"affected":[{"product":"Linux","vendor":"Linux","defaultStatus":"unaffected","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/btrfs/delayed-inode.c"],"versions":[{"version":"e8513c012de75fd65e2df5499572bc6ef3f6e409","lessThan":"c8385851a5435f4006281828d428e5d0b0bbf8af","status":"affected","versionType":"git"},{"version":"e8513c012de75fd65e2df5499572bc6ef3f6e409","lessThan":"83f59076a1ae6f5c6845d6f7ed3a1a373d883684","status":"affected","versionType":"git"}]},{"product":"Linux","vendor":"Linux","defaultStatus":"affected","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/btrfs/delayed-inode.c"],"versions":[{"version":"6.18","status":"affected"},{"version":"0","lessThan":"6.18","status":"unaffected","versionType":"semver"},{"version":"6.18.6","lessThanOrEqual":"6.18.*","status":"unaffected","versionType":"semver"},{"version":"6.19","lessThanOrEqual":"*","status":"unaffected","versionType":"original_commit_for_fix"}]}],"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.18","versionEndExcluding":"6.18.6"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.18","versionEndExcluding":"6.19"}]}]}],"references":[{"url":"https://git.kernel.org/stable/c/c8385851a5435f4006281828d428e5d0b0bbf8af"},{"url":"https://git.kernel.org/stable/c/83f59076a1ae6f5c6845d6f7ed3a1a373d883684"}],"title":"btrfs: fix use-after-free warning in btrfs_get_or_create_delayed_node()","x_generator":{"engine":"bippy-1.2.0"}}}}