CVE-2022-48721·Kernel vulnerability
In the Linux kernel, the following vulnerability has been resolved: net/smc: Forward wakeup to smc socket waitqueue after fallback When we replace TCP with SMC and a fallback occurs, there may be some socket waitqueue entries remaining in smc socket->wq, such as eppoll_entries inserted by userspace applications. After the fallback, data flows over TCP/IP and only clcsocket->wq will be woken up. Applications can't be notified by the entries which were inserted in smc socket->wq before fallback. So we need a mechanism to wake up smc socket->wq at the same time if some entries remaining in it. The current workaround is to transfer the entries from smc socket->wq to clcsock->wq during the fallback. But this may cause a crash like this: general protection fault, probably for non-canonical address 0xdead000000000100: 0000 [#1] PREEMPT SMP PTI CPU: 3 PID: 0 Comm: swapper/3 Kdump: loaded Tainted: G E 5.16.0+ #107 RIP: 0010:__wake_up_common+0x65/0x170 Call Trace: <IRQ> __wake_up_common_lock+0x7a/0xc0 sock_def_readable+0x3c/0x70 tcp_data_queue+0x4a7/0xc40 tcp_rcv_established+0x32f/0x660 ? sk_filter_trim_cap+0xcb/0x2e0 tcp_v4_do_rcv+0x10b/0x260 tcp_v4_rcv+0xd2a/0xde0 ip_protocol_deliver_rcu+0x3b/0x1d0 ip_local_deliver_finish+0x54/0x60 ip_local_deliver+0x6a/0x110 ? tcp_v4_early_demux+0xa2/0x140 ? tcp_v4_early_demux+0x10d/0x140 ip_sublist_rcv_finish+0x49/0x60 ip_sublist_rcv+0x19d/0x230 ip_list_rcv+0x13e/0x170 __netif_receive_skb_list_core+0x1c2/0x240 netif_receive_skb_list_internal+0x1e6/0x320 napi_complete_done+0x11d/0x190 mlx5e_napi_poll+0x163/0x6b0 [mlx5_core] __napi_poll+0x3c/0x1b0 net_rx_action+0x27c/0x300 __do_softirq+0x114/0x2d2 irq_exit_rcu+0xb4/0xe0 common_interrupt+0xba/0xe0 </IRQ> <TASK> The crash is caused by privately transferring waitqueue entries from smc socket->wq to clcsock->wq. The owners of these entries, such as epoll, have no idea that the entries have been transferred to a different socket wait queue and still use original waitqueue spinlock (smc socket->wq.wait.lock) to make the entries operation exclusive, but it doesn't work. The operations to the entries, such as removing from the waitqueue (now is clcsock->wq after fallback), may cause a crash when clcsock waitqueue is being iterated over at the moment. This patch tries to fix this by no longer transferring wait queue entries privately, but introducing own implementations of clcsock's callback functions in fallback situation. The callback functions will forward the wakeup to smc socket->wq if clcsock->wq is actually woken up and smc socket->wq has remaining entries.
- Severity
- medium
- Software
- Kernel
- Fixed in
- 5.16.8
- Published
- 2024-06-20
Affected versions
From: 5.16.1
Until: 5.16.8
Fixed in: 5.16.8
How to fix this CVE
Update your Linux kernel to version 5.16.8 or later to resolve a critical race condition in the SMC (Shared Memory Communications) fallback mechanism. This vulnerability affects systems where SMC connections fall back to TCP/IP, causing potential kernel crashes due to improper socket wait queue management. Ensure all kernel patches are applied promptly to maintain system stability.
sudo dnf update kernelDefensia detects this vulnerability
How to check if you are affected
- Step 1: Check installed kernel version with `uname -r` and compare against the vulnerable range (5.16.1 to 5.16.7)
- Step 2: Verify SMC protocol usage by checking `/proc/net/smc` to see active SMC connections that may trigger fallback scenarios
- Step 3: Search kernel logs for general protection faults related to SMC with `grep -i 'general protection fault\|smc.*fallback' /var/log/kern.log /var/log/messages`
- Step 4: After patching, confirm kernel version is 5.16.8 or higher with `uname -r` and verify no SMC-related crashes in dmesg with `dmesg | grep -i smc`
FAQ
What is CVE-2022-48721?
CVE-2022-48721 is a kernel race condition in SMC socket fallback handling where improperly transferred wait queue entries between sockets can cause general protection faults when the kernel attempts to wake up listeners. The vulnerability occurs when SMC connections fall back to standard TCP/IP communication but leave orphaned epoll or select entries in the wrong wait queue.
Is CVE-2022-48721 being actively exploited?
No, this vulnerability is not listed in the CISA Known Exploited Vulnerabilities catalog and has no publicly available exploits. However, it can be triggered under specific conditions involving SMC fallback scenarios.
What versions of Kernel are affected by CVE-2022-48721?
Linux kernel versions 5.16.1 through 5.16.7 are affected. The vulnerability is resolved in kernel 5.16.8 and later.
How do I check if my server is vulnerable to CVE-2022-48721?
Run `uname -r` and if the output shows a kernel version between 5.16.1 and 5.16.7, your system is vulnerable. Kernels below 5.16.1 or 5.16.8+ are not affected.
Does Defensia detect CVE-2022-48721?
Yes — Defensia's CVE advisory scanner compares installed package versions against the NVD database. If the Linux kernel is installed on a monitored server, CVE-2022-48721 will appear in your dashboard with remediation steps.
Related Kernel CVEs
References
- https://git.kernel.org/stable/c/0ef6049f664941bc0f75828b3a61877635048b27
- https://git.kernel.org/stable/c/341adeec9adad0874f29a0a1af35638207352a39
- https://git.kernel.org/stable/c/504078fbe9dd570d685361b57784a6050bc40aaa
- https://git.kernel.org/stable/c/0ef6049f664941bc0f75828b3a61877635048b27
- https://git.kernel.org/stable/c/341adeec9adad0874f29a0a1af35638207352a39
Track CVEs across your fleet automatically
Defensia scans your Linux servers and tells you exactly which ones are running vulnerable versions — including CVE-2022-48721. Free for 1 server.
Get started free