Goal Reached Thanks to every supporter — we hit 100%!

Goal: 1000 CNY · Raised: 1359 CNY

100%

CVE-2021-46958— btrfs: fix race between transaction aborts and fsyncs leading to use-after-free

Quick assessment

Affected
Linux Linux
Exploitation
No confirmed in-the-wild exploitation; assess based on exposure
Recommended action
Check the vendor advisory and references for a fixed version. If immediate upgrade is impossible, restrict exposure and increase monitoring.

Linux kernel是美国Linux基金会的开源操作系统Linux所使用的内核。 Linux kernel 存在安全漏洞,该漏洞源于在提交期间中止事务的任务、执行 fsync 的任务和事务 kthread 之间存在竞争,这会导致日志根树的释放后重用。

CVSS 7.8 · High EPSS 0.24% · P15

Affected Version Matrix 10

VendorProduct Version RangeStatus
Linux Linux ef67963dac255b293e19815ea3d440567be4626f< a4794be7b00b7eda4b45fffd283ab7d76df7e5d6 affected
ef67963dac255b293e19815ea3d440567be4626f< 633f7f216663587f17601eaa1cf2ac3d5654874c affected
ef67963dac255b293e19815ea3d440567be4626f< e2da98788369bfba1138bada72765c47989a4338 affected
ef67963dac255b293e19815ea3d440567be4626f< 061dde8245356d8864d29e25207aa4daa0be4d3c affected
5.7 affected
< 5.7 unaffected
5.10.36≤ 5.10.* unaffected
5.11.20≤ 5.11.* unaffected
… +2 more rows
Get alerts for future matching vulnerabilities Log in to subscribe

I. Basic Information for CVE-2021-46958

Vulnerability Information

Have questions about the vulnerability? See if Shenlong's analysis helps!
View Shenlong Deep Dive ↗

Although we use advanced large model technology, its output may still contain inaccurate or outdated information.Shenlong tries to ensure data accuracy, but please verify and judge based on the actual situation.

Vulnerability Title
btrfs: fix race between transaction aborts and fsyncs leading to use-after-free
Source: CVE Program / CVE List V5
Vulnerability Description
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---
Source: CVE Program / CVE List V5
CVSS Information
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
Source: CVE Program / CVE List V5
Vulnerability Type
N/A
Source: CVE Program / CVE List V5
Vulnerability Title
Linux kernel 安全漏洞
Source: CNNVD (China National Vulnerability Database)
Vulnerability Description
Linux kernel是美国Linux基金会的开源操作系统Linux所使用的内核。 Linux kernel 存在安全漏洞,该漏洞源于在提交期间中止事务的任务、执行 fsync 的任务和事务 kthread 之间存在竞争,这会导致日志根树的释放后重用。
Source: CNNVD (China National Vulnerability Database)
CVSS Information
N/A
Source: CNNVD (China National Vulnerability Database)
Vulnerability Type
N/A
Source: CNNVD (China National Vulnerability Database)

Affected Products

Vendor Product Affected Versions CPE Subscribe
Linux Linux ef67963dac255b293e19815ea3d440567be4626f ~ a4794be7b00b7eda4b45fffd283ab7d76df7e5d6 -
Linux Linux 5.7 -

II. Public POCs for CVE-2021-46958

# POC Description Source Link Shenlong Link
AI-Generated POC Premium

No public POC found.

Login to generate AI POC

III. Intelligence Information for CVE-2021-46958

请登录查看更多情报信息。

Other References for CVE-2021-46958 (4)

Same Patch Batch · Linux · 2024-02-27 · 67 CVEs total

CVE-2021-46911 9.8 CRITICAL ch_ktls: Fix kernel panic
CVE-2021-46955 8.2 HIGH openvswitch: fix stack OOB read while fragmenting IPv4 packets
CVE-2021-46925 7.8 HIGH net/smc: fix kernel panic caused by race of smc_sock
CVE-2021-46963 7.8 HIGH scsi: qla2xxx: Fix crash in qla2xxx_mqueuecommand()
CVE-2021-46929 7.8 HIGH sctp: use call_rcu to free endpoint
CVE-2021-46913 7.8 HIGH netfilter: nftables: clone set element expression template
CVE-2021-46973 7.8 HIGH net: qrtr: Avoid potential use after free in MHI send
CVE-2021-46936 7.8 HIGH net: fix use-after-free in tw_timer_handler
CVE-2021-46933 7.8 HIGH usb: gadget: f_fs: Clear ffs_eventfd in ffs_data_clear.
CVE-2021-46969 7.8 HIGH bus: mhi: core: Fix invalid error returning in mhi_queue
CVE-2021-46922 7.8 HIGH KEYS: trusted: Fix TPM reservation for seal/unseal
CVE-2021-46967 7.8 HIGH vhost-vdpa: fix vm_flags for virtqueue doorbell mapping
CVE-2021-46921 7.8 HIGH locking/qrwlock: Fix ordering in queued_write_lock_slowpath()
CVE-2021-46948 7.5 HIGH sfc: farch: fix TX queue lookup in TX event handling
CVE-2021-46960 7.5 HIGH cifs: Return correct error code from smb2_get_enc_key
CVE-2021-46912 7.3 HIGH net: Make tcp_allowed_congestion_control readonly in non-init netns
CVE-2021-46908 7.1 HIGH bpf: Use correct permission flag for mixed signed bounds arithmetic
CVE-2021-46974 7.1 HIGH bpf: Fix masking negation logic upon negative dst register
CVE-2021-46910 7.0 HIGH ARM: 9063/1: mm: reduce maximum number of CPUs if DEBUG_KMAP_LOCAL is enabled
CVE-2021-46952 NFS: fs_context: validate UDP retrans to prevent shift out-of-bounds

Showing top 20 of 67 CVEs. View all on vendor page &rarr; →

IV. Related Vulnerabilities

V. Comments for CVE-2021-46958

No comments yet


Leave a comment