CVE-2021-46958: btrfs: fix race between transaction aborts and fsyncs leading to use-after-free
Noroxi assessment
Priority: Monitor (action score 18/100)
- The sources we track (CISA KEV, Exploit-DB, Metasploit, Nuclei, GitHub) show no public exploit code or exploitation in the wild.
- Probability of exploitation in the next 30 days: 0.24% (FIRST EPSS).
- Someone with local access to the system can trigger it. A low-privileged account is enough. No user action is required. Special conditions such as timing or configuration are required.
- Fixed version: Linux Linux 061dde8245356d8864d29e25207aa4daa0be4d3c, 633f7f216663587f17601eaa1cf2ac3d5654874c, a4794be7b00b7eda4b45fffd283ab7d76df7e5d6.
- Severity is disputed: the assigning authority (CNA) scores it 7.8, NVD 4.7.
- Mentioned 1 time in Turkish national cyber security advisories (siberguvenlik.gov.tr).
Low priority for now. Upgrade to Linux Linux 061dde8245356d8864d29e25207aa4daa0be4d3c, 633f7f216663587f17601eaa1cf2ac3d5654874c, a4794be7b00b7eda4b45fffd283ab7d76df7e5d6 or later.
Generated automatically from the record's data: CVSS (NVD and CNA), CISA KEV and SSVC, FIRST EPSS, exploit sources, fixed versions. How we calculate it
Primary sources: NVD · CVE.org · FIRST EPSS
In the Linux kernel, the following vulnerability has been resolved: btrfs: fix race between transaction aborts and fsyncs leading to use-after-free There is a race between a task aborting a transaction during a commit, a task doing an fsync and the transaction kthread, which leads to an use-after-free of the log root tree. When this happens, it results in a stack trace like the following: BTRFS info (device dm-0): forced readonly BTRFS warning (device dm-0): Skipping commit of aborted transaction. BTRFS: error (device dm-0) in cleanup_transaction:1958: errno=-5 IO failure BTRFS warning (device dm-0): lost page write due to IO error on /dev/mapper/error-test (-5) BTRFS warning (device dm-0): Skipping commit of aborted transaction. BTRFS warning (device dm-0): direct IO failed ino 261 rw 0,0 sector 0xa4e8 len 4096 err no 10 BTRFS error (device dm-0): error writing primary super block to device 1 BTRFS warning (device dm-0): direct IO failed ino 261 rw 0,0 sector 0x12e000 len 4096 err no 10 BTRFS warning (device dm-0): direct IO failed ino 261 rw 0,0 sector 0x12e008 len 4096 err no 10 BTRFS warning (device dm-0): direct IO failed ino 261 rw 0,0 sector 0x12e010 len 4096 err no 10 BTRFS: error (device dm-0) in write_all_supers:4110: errno=-5 IO failure (1 errors while writing supers) BTRFS: error (device dm-0) in btrfs_sync_log:3308: errno=-5 IO failure general protection fault, probably for non-canonical address 0x6b6b6b6b6b6b6b68: 0000 [#1] PREEMPT SMP DEBUG_PAGEALLOC PTI CPU: 2 PID: 2458471 Comm: fsstress Not tainted 5.12.0-rc5-btrfs-next-84 #1 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.14.0-0-g155821a1990b-prebuilt.qemu.org 04/01/2014 RIP: 0010:__mutex_lock+0x139/0xa40 Code: c0 74 19 (...) RSP: 0018:ffff9f18830d7b00 EFLAGS: 00010202 RAX: 6b6b6b6b6b6b6b68 RBX: 0000000000000001 RCX: 0000000000000002 RDX: ffffffffb9c54d13 RSI: 0000000000000000 RDI: 0000000000000000 RBP: ffff9f18830d7bc0 R08: 0000000000000000 R09: 0000000000000000 R10: ffff9f18830d7be0 R11: 0000000000000001 R12: ffff8c6cd199c040 R13: ffff8c6c95821358 R14: 00000000fffffffb R15: ffff8c6cbcf01358 FS: 00007fa9140c2b80(0000) GS:ffff8c6fac600000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007fa913d52000 CR3: 000000013d2b4003 CR4: 0000000000370ee0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: ? __btrfs_handle_fs_error+0xde/0x146 [btrfs] ? btrfs_sync_log+0x7c1/0xf20 [btrfs] ? btrfs_sync_log+0x7c1/0xf20 [btrfs] btrfs_sync_log+0x7c1/0xf20 [btrfs] btrfs_sync_file+0x40c/0x580 [btrfs] do_fsync+0x38/0x70 __x64_sys_fsync+0x10/0x20 do_syscall_64+0x33/0x80 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x7fa9142a55c3 Code: 8b 15 09 (...) RSP: 002b:00007fff26278d48 EFLAGS: 00000246 ORIG_RAX: 000000000000004a RAX: ffffffffffffffda RBX: 0000563c83cb4560 RCX: 00007fa9142a55c3 RDX: 00007fff26278cb0 RSI: 00007fff26278cb0 RDI: 0000000000000005 RBP: 0000000000000005 R08: 0000000000000001 R09: 00007fff26278d5c R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000340 R13: 00007fff26278de0 R14: 00007fff26278d96 R15: 0000563c83ca57c0 Modules linked in: btrfs dm_zero dm_snapshot dm_thin_pool (...) ---[ end trace ee2f1b19327d791d ]--- The steps that lead to this crash are the following: 1) We are at transaction N; 2) We have two tasks with a transaction handle attached to transaction N. Task A and Task B. Task B is doing an fsync; 3) Task B is at btrfs_sync_log(), and has saved fs_info->log_root_tree into a local variable named 'log_root_tree' at the top of btrfs_sync_log(). Task B is about to call write_all_supers(), but before that... 4) Task A calls btrfs_commit_transaction(), and after it sets the transaction state to TRANS_STATE_COMMIT_START, an error happens before it w ---truncated---
- Published
- Feb 27, 2024
- Updated
- Aug 5, 2026
- EPSS
- 0.2% · 15th percentile
- CWE
- CWE-416
Report tools
Action score
18
Low priority for now.
- CVSS
- 18 / 40 · 4.7 / 10
- CISA KEV
- 0 / 30 · Not listed
- EPSS
- 0 / 30 · 0.2%
CISA SSVC decision
- Exploitation
- none
- Automatable
- no
- Technical impact
- partial
Vulnrichment: CISA's decision-tree inputs.
CNA vs NVD score
- NVD
- 4.7
- CNA · Linux
- 7.8
- 3.1 point gap
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
The score given by the assigning authority versus NVD’s independent score. A gap means the severity is contested.
Get told when this record changes
- Not in KEV: no record of exploitation in the wild
- No public exploit code on record
- A fix has been released
If any of these changes, we'll tell you in the daily email digest.
Is your version affected? Check itNoroxi analysis
What does it mean in your environment?
The assessment above is generated automatically from the record's data; it doesn't know your environment. Our team verifies on your systems whether this vulnerability is actually exploitable and which mitigation is enough.
We use this product, ask for helpAffected systems
Is your version affected?
Pick the product and type the version you run. It's compared with this record's version ranges in your browser; the version isn't sent anywhere.
| Vendor | Product | CPE |
|---|---|---|
| linux | linux kernel | cpe:2.3:o:linux:linux_kernel |
Versions reported by the vendor
Affected version ranges reported by the assigning authority (Linux). Independent of NVD's CPE analysis and usually ahead of it.
Linux Linux
- 5.7affected
- ef67963dac255b293e19815ea3d440567be4626f and later · before a4794be7b00b7eda4b45fffd283ab7d76df7e5d6affected · git
- ef67963dac255b293e19815ea3d440567be4626f and later · before 633f7f216663587f17601eaa1cf2ac3d5654874caffected · git
- ef67963dac255b293e19815ea3d440567be4626f and later · before e2da98788369bfba1138bada72765c47989a4338affected · git
- ef67963dac255b293e19815ea3d440567be4626f and later · before 061dde8245356d8864d29e25207aa4daa0be4d3caffected · git
- before 5.7not affected · semver
- 5.10.36 and later · up to and including 5.10.*not affected · semver
- 5.11.20 and later · up to and including 5.11.*not affected · semver
- 5.12.3 and later · up to and including 5.12.*not affected · semver
- 5.13 and laternot affected · original_commit_for_fix
Affected versions
NVD version ranges (for catalog products). Add the product to your stack with a version and matching uses these.
- linux linux kernel5.7 and later · before 5.10.36
- linux linux kernel5.11 and later · before 5.11.20
- linux linux kernel5.12 and later · before 5.12.3
Package-level exposure
OSV and GitHub Advisory data: ecosystem, package and range. SBOM matching uses this table.
| Ecosystem | Package | Affected range | Fix |
|---|---|---|---|
| Debian:12 | linux | before 5.10.38-1 | 5.10.38-1 |
| SUSE:Linux Enterprise High Availability Extension 12 SP5 | kernel-default | before 4.12.14-122.216.1 | 4.12.14-122.216.1 |
| SUSE:Linux Enterprise High Performance Computing 15 SP2-LTSS | kernel-default-base | before 5.3.18-150200.24.188.1.150200.9.95.3 | 5.3.18-150200.24.188.1.150200.9.95.3 |
| SUSE:Linux Enterprise High Performance Computing 15 SP2-LTSS | kernel-docs | before 5.3.18-150200.24.188.1 | 5.3.18-150200.24.188.1 |
| SUSE:Linux Enterprise High Performance Computing 15 SP2-LTSS | kernel-obs-build | before 5.3.18-150200.24.188.1 | 5.3.18-150200.24.188.1 |
| SUSE:Linux Enterprise High Performance Computing 15 SP2-LTSS | kernel-preempt | before 5.3.18-150200.24.188.1 | 5.3.18-150200.24.188.1 |
| SUSE:Linux Enterprise High Performance Computing 15 SP2-LTSS | kernel-source | before 5.3.18-150200.24.188.1 | 5.3.18-150200.24.188.1 |
| SUSE:Linux Enterprise High Performance Computing 15 SP2-LTSS | kernel-syms | before 5.3.18-150200.24.188.1 | 5.3.18-150200.24.188.1 |
| SUSE:Linux Enterprise Live Patching 12 SP5 | kgraft-patch-SLE12-SP5_Update_56 | before 1-8.3.1 | 1-8.3.1 |
| SUSE:Linux Enterprise Live Patching 15 SP2 | kernel-default | before 5.3.18-150200.24.188.1 | 5.3.18-150200.24.188.1 |
| SUSE:Linux Enterprise Live Patching 15 SP2 | kernel-livepatch-SLE15-SP2_Update_47 | before 1-150200.5.3.3 | 1-150200.5.3.3 |
| SUSE:Linux Enterprise Real Time 12 SP5 | kernel-rt | before 4.12.14-10.182.1 | 4.12.14-10.182.1 |
| SUSE:Linux Enterprise Real Time 12 SP5 | kernel-rt_debug | before 4.12.14-10.182.1 | 4.12.14-10.182.1 |
| SUSE:Linux Enterprise Real Time 12 SP5 | kernel-source-rt | before 4.12.14-10.182.1 | 4.12.14-10.182.1 |
| SUSE:Linux Enterprise Real Time 12 SP5 | kernel-syms-rt | before 4.12.14-10.182.1 | 4.12.14-10.182.1 |
| SUSE:Linux Enterprise Server 12 SP5 | kernel-azure | before 4.12.14-16.182.1 | 4.12.14-16.182.1 |
| SUSE:Linux Enterprise Server 12 SP5 | kernel-source | before 4.12.14-122.216.1 | 4.12.14-122.216.1 |
| SUSE:Linux Enterprise Server 12 SP5 | kernel-source-azure | before 4.12.14-16.182.1 | 4.12.14-16.182.1 |
| SUSE:Linux Enterprise Server 12 SP5 | kernel-syms | before 4.12.14-122.216.1 | 4.12.14-122.216.1 |
| SUSE:Linux Enterprise Server 12 SP5 | kernel-syms-azure | before 4.12.14-16.182.1 | 4.12.14-16.182.1 |
| SUSE:Linux Enterprise Software Development Kit 12 SP5 | kernel-docs | before 4.12.14-122.216.1 | 4.12.14-122.216.1 |
| SUSE:Linux Enterprise Software Development Kit 12 SP5 | kernel-obs-build | before 4.12.14-122.216.1 | 4.12.14-122.216.1 |
Same product
linux: all recordsOther highest-scoring records for the same primary product.
- CVE-2026-31431crypto: algif_aead - Revert to operating out-of-placeKEV90Now
- CVE-2022-0847A flaw was found in the way the "flags" member of the new pipe buffer structure was lacking proper initialization in copy_page_to_iter_pipe…KEV89Now
- CVE-2021-22555Heap Out-Of-Bounds Write in Netfilter IP6T_SO_SET_REPLACEKEV85Now
Published before and after this one in the same product
- ← EarlierCVE-2021-46956Feb 27, 2024 · virtiofs: fix memory leak in virtio_fs_probe()22Monitor
- ← EarlierCVE-2021-46957Feb 27, 2024 · riscv/kprobe: fix kernel panic when invoking sys_read traced by kprobe22Monitor
- Later →CVE-2021-46960Feb 27, 2024 · cifs: Return correct error code from smb2_get_enc_key22Monitor
Remediation
Which version to upgrade to
Fix versions compiled from the vendor, package registries and Microsoft. Verify the vendor's note before upgrading.
| Product / package | Fixed version | Source |
|---|---|---|
| Linux Linux | 061dde8245356d8864d29e25207aa4daa0be4d3c | Vendor (CNA) |
| Linux Linux | 633f7f216663587f17601eaa1cf2ac3d5654874c | Vendor (CNA) |
| Linux Linux | a4794be7b00b7eda4b45fffd283ab7d76df7e5d6 | Vendor (CNA) |
| Linux Linux | e2da98788369bfba1138bada72765c47989a4338 | Vendor (CNA) |
| debian:linux | 5.10.38-1 · Debian:12 | Package registry (OSV) |
| suse:kernel-azure | 4.12.14-16.182.1 · SUSE:Linux Enterprise Server 12 SP5 | Package registry (OSV) |
| suse:kernel-default | 5.3.18-150200.24.188.1 · SUSE:Linux Enterprise Live Patching 15 SP2 | Package registry (OSV) |
| suse:kernel-default-base | 5.3.18-150200.24.188.1.150200.9.95.3 · SUSE:Linux Enterprise High Performance Computing 15 SP2-LTSS | Package registry (OSV) |
| suse:kernel-docs | 5.3.18-150200.24.188.1 · SUSE:Linux Enterprise High Performance Computing 15 SP2-LTSS | Package registry (OSV) |
| suse:kernel-livepatch-SLE15-SP2_Update_47 | 1-150200.5.3.3 · SUSE:Linux Enterprise Live Patching 15 SP2 | Package registry (OSV) |
| suse:kernel-obs-build | 5.3.18-150200.24.188.1 · SUSE:Linux Enterprise High Performance Computing 15 SP2-LTSS | Package registry (OSV) |
| suse:kernel-preempt | 5.3.18-150200.24.188.1 · SUSE:Linux Enterprise High Performance Computing 15 SP2-LTSS | Package registry (OSV) |
| suse:kernel-rt | 4.12.14-10.182.1 · SUSE:Linux Enterprise Real Time 12 SP5 | Package registry (OSV) |
| suse:kernel-source | 5.3.18-150200.24.188.1 · SUSE:Linux Enterprise High Performance Computing 15 SP2-LTSS | Package registry (OSV) |
| suse:kernel-source-azure | 4.12.14-16.182.1 · SUSE:Linux Enterprise Server 12 SP5 | Package registry (OSV) |
| suse:kernel-syms | 5.3.18-150200.24.188.1 · SUSE:Linux Enterprise High Performance Computing 15 SP2-LTSS | Package registry (OSV) |
| suse:kernel-syms-azure | 4.12.14-16.182.1 · SUSE:Linux Enterprise Server 12 SP5 | Package registry (OSV) |
Exploit status
No known public exploit
No public exploit has been observed yet. That doesn't mean you're safe, only that the bar is a little higher.
Research context
For pentesters and researchers: attack profile, score disagreement, timeline, patch commits, credits, variant and chain candidates, bug bounty scope. All derived from existing data; no exploit code.
Timeline
From publication to today: proof of concept, Metasploit module, CISA KEV and fix record. Dates are as reported by the sources.
No dated events beyond publication.
National notice (Türkiye Cybersecurity Directorate / USOM)
Official security notices citing this record; remediation advice is on the agency's page.
- TR-24-0138 · Feb 28, 2024(Linux Kernel Güncellemesi)
Not on record for this CVE: EPSS history · patch commit or PR link · researcher credit · variant or chain candidate · public bounty program.
Technical details
Attack conditions
- Someone with local access to the system can trigger it.
- A low-privileged account is enough.
- No user action is required.
- Special conditions such as timing or configuration are required.
If successful
- Confidentiality
- none
- Integrity
- none
- Availability
- high · the service can be disrupted
- Attack vector
- Local
- Attack complexity
- High
- Privileges required
- Low
- User interaction
- None
- Scope
- Unchanged
- Confidentiality impact
- None
- Integrity impact
- None
- Availability impact
- High
Weakness class (CWE)
CWE-416 · Use After FreeCVSS vector
CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:H
nvd-primary
Root cause
After a memory region is freed, another reference pointing to it is still used. By then, the same region may have been allocated for different data.
The bug in code
The whole CWE-416 classA representative example of this vulnerability class. Not the vendor's source code; it shows the faulty pattern and its fix.
Vulnerable
free(dev->buf);
/* ... another thread is still running ... */
process(dev->buf);Fixed
lock(&dev->lock);
free(dev->buf);
dev->buf = NULL;
unlock(&dev->lock);Attack context
MITRE CAPEC attack patterns and ATT&CK techniques for this weakness class (CWE). A starting point for detection rules and threat hunting.
MITRE has no CAPEC/ATT&CK mapping for this CWE.
Change log (1)
- Fix✗ → ✓
For records you follow, these changes also arrive as notifications. →
References
Show all references (3 more)Show less
Vendor advisories and official records. Exploit/PoC links are deliberately left out.