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

Goal: 1000 CNY · Raised: 1336 CNY

100%

CVE-2022-49215— xsk: Fix race at socket teardown

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存在安全漏洞,该漏洞源于xsk socket拆卸代码中存在竞争条件,可能导致空指针取消引用。

CVSS 7.8 · High EPSS 0.20% · P10

Affected Version Matrix 10

VendorProduct Version RangeStatus
Linux Linux 42fddcc7c64b723a867c7b2f5f7505e244212f13< ad7219cd8751bd258b9d1e69ae0654ec00f71875 affected
42fddcc7c64b723a867c7b2f5f7505e244212f13< d1579253ffce39986e7a6ab757ac93b2680a665f affected
42fddcc7c64b723a867c7b2f5f7505e244212f13< 8a2dea162b92c322f3e42eae0c4a74b8d20aa7a9 affected
42fddcc7c64b723a867c7b2f5f7505e244212f13< 18b1ab7aa76bde181bdb1ab19a87fa9523c32f21 affected
5.4 affected
< 5.4 unaffected
5.15.33≤ 5.15.* unaffected
5.16.19≤ 5.16.* unaffected
… +2 more rows
Get alerts for future matching vulnerabilities Log in to subscribe

I. Basic Information for CVE-2022-49215

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
xsk: Fix race at socket teardown
Source: CVE Program / CVE List V5
Vulnerability Description
In the Linux kernel, the following vulnerability has been resolved: xsk: Fix race at socket teardown Fix a race in the xsk socket teardown code that can lead to a NULL pointer dereference splat. The current xsk unbind code in xsk_unbind_dev() starts by setting xs->state to XSK_UNBOUND, sets xs->dev to NULL and then waits for any NAPI processing to terminate using synchronize_net(). After that, the release code starts to tear down the socket state and free allocated memory. BUG: kernel NULL pointer dereference, address: 00000000000000c0 PGD 8000000932469067 P4D 8000000932469067 PUD 0 Oops: 0000 [#1] PREEMPT SMP PTI CPU: 25 PID: 69132 Comm: grpcpp_sync_ser Tainted: G I 5.16.0+ #2 Hardware name: Dell Inc. PowerEdge R730/0599V5, BIOS 1.2.10 03/09/2015 RIP: 0010:__xsk_sendmsg+0x2c/0x690 [...] RSP: 0018:ffffa2348bd13d50 EFLAGS: 00010246 RAX: 0000000000000000 RBX: 0000000000000040 RCX: ffff8d5fc632d258 RDX: 0000000000400000 RSI: ffffa2348bd13e10 RDI: ffff8d5fc5489800 RBP: ffffa2348bd13db0 R08: 0000000000000000 R09: 00007ffffffff000 R10: 0000000000000000 R11: 0000000000000000 R12: ffff8d5fc5489800 R13: ffff8d5fcb0f5140 R14: ffff8d5fcb0f5140 R15: 0000000000000000 FS: 00007f991cff9400(0000) GS:ffff8d6f1f700000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00000000000000c0 CR3: 0000000114888005 CR4: 00000000001706e0 Call Trace: <TASK> ? aa_sk_perm+0x43/0x1b0 xsk_sendmsg+0xf0/0x110 sock_sendmsg+0x65/0x70 __sys_sendto+0x113/0x190 ? debug_smp_processor_id+0x17/0x20 ? fpregs_assert_state_consistent+0x23/0x50 ? exit_to_user_mode_prepare+0xa5/0x1d0 __x64_sys_sendto+0x29/0x30 do_syscall_64+0x3b/0xc0 entry_SYSCALL_64_after_hwframe+0x44/0xae There are two problems with the current code. First, setting xs->dev to NULL before waiting for all users to stop using the socket is not correct. The entry to the data plane functions xsk_poll(), xsk_sendmsg(), and xsk_recvmsg() are all guarded by a test that xs->state is in the state XSK_BOUND and if not, it returns right away. But one process might have passed this test but still have not gotten to the point in which it uses xs->dev in the code. In this interim, a second process executing xsk_unbind_dev() might have set xs->dev to NULL which will lead to a crash for the first process. The solution here is just to get rid of this NULL assignment since it is not used anymore. Before commit 42fddcc7c64b ("xsk: use state member for socket synchronization"), xs->dev was the gatekeeper to admit processes into the data plane functions, but it was replaced with the state variable xs->state in the aforementioned commit. The second problem is that synchronize_net() does not wait for any process in xsk_poll(), xsk_sendmsg(), or xsk_recvmsg() to complete, which means that the state they rely on might be cleaned up prematurely. This can happen when the notifier gets called (at driver unload for example) as it uses xsk_unbind_dev(). Solve this by extending the RCU critical region from just the ndo_xsk_wakeup to the whole functions mentioned above, so that both the test of xs->state == XSK_BOUND and the last use of any member of xs is covered by the RCU critical section. This will guarantee that when synchronize_net() completes, there will be no processes left executing xsk_poll(), xsk_sendmsg(), or xsk_recvmsg() and state can be cleaned up safely. Note that we need to drop the RCU lock for the skb xmit path as it uses functions that might sleep. Due to this, we have to retest the xs->state after we grab the mutex that protects the skb xmit code from, among a number of things, an xsk_unbind_dev() being executed from the notifier at the same time.
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存在安全漏洞,该漏洞源于xsk socket拆卸代码中存在竞争条件,可能导致空指针取消引用。
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 42fddcc7c64b723a867c7b2f5f7505e244212f13 ~ ad7219cd8751bd258b9d1e69ae0654ec00f71875 -
Linux Linux 5.4 -

II. Public POCs for CVE-2022-49215

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

No public POC found.

Login to generate AI POC

III. Intelligence Information for CVE-2022-49215

登录查看更多情报信息。

Patches & Fixes for CVE-2022-49215 (4)

Same Patch Batch · Linux · 2025-02-26 · 706 CVEs total

CVE-2022-49201 9.8 CRITICAL ibmvnic: fix race between xmit and reset
CVE-2022-49194 9.8 CRITICAL net: bcmgenet: Use stronger register read/writes to assure ordering
CVE-2022-49356 9.8 CRITICAL SUNRPC: Trap RDMA segment overflows
CVE-2022-49407 9.8 CRITICAL dlm: fix plock invalid read
CVE-2022-49280 9.8 CRITICAL NFSD: prevent underflow in nfssvc_decode_writeargs()
CVE-2022-49362 9.8 CRITICAL NFSD: Fix potential use-after-free in nfsd_file_put()
CVE-2022-49561 9.8 CRITICAL netfilter: conntrack: re-fetch conntrack after insertion
CVE-2022-49093 9.8 CRITICAL skbuff: fix coalescing for page_pool fragment recycling
CVE-2022-49094 9.8 CRITICAL net/tls: fix slab-out-of-bounds bug in decrypt_internal
CVE-2022-49418 9.8 CRITICAL NFSv4: Fix free of uninitialized nfs4_label on referral lookup.
CVE-2022-49149 9.8 CRITICAL rxrpc: Fix call timer start racing with call destruction
CVE-2022-49260 9.8 CRITICAL crypto: hisilicon/sec - fix the aead software fallback for engine
CVE-2022-49058 9.1 CRITICAL cifs: potential buffer overflow in handling symlinks
CVE-2022-49159 8.8 HIGH scsi: qla2xxx: Implement ref count for SRB
CVE-2022-49500 8.8 HIGH wl1251: dynamically allocate memory used for DMA
CVE-2022-49519 8.8 HIGH ath10k: skip ath10k_halt during suspend for driver state RESTARTING
CVE-2022-49238 8.8 HIGH ath11k: free peer for station when disconnect from AP for QCA6390/WCN6855
CVE-2022-49535 8.8 HIGH scsi: lpfc: Fix null pointer dereference after failing to issue FLOGI and PLOGI
CVE-2022-49470 8.8 HIGH Bluetooth: btmtksdio: fix use-after-free at btmtksdio_recv_event
CVE-2022-49416 8.8 HIGH wifi: mac80211: fix use-after-free in chanctx code

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

IV. Related Vulnerabilities

V. Comments for CVE-2022-49215

No comments yet


Leave a comment