CVE-2022-48721

Source
https://cve.org/CVERecord?id=CVE-2022-48721
Import Source
https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2022-48721.json
JSON Data
https://api.test.osv.dev/v1/vulns/CVE-2022-48721
Downstream
Related
Published
2024-06-20T11:13:12.668Z
Modified
2026-03-13T05:40:29.397993Z
Summary
net/smc: Forward wakeup to smc socket waitqueue after fallback
Details

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:__wakeupcommon+0x65/0x170 Call Trace: <IRQ> __wakeupcommonlock+0x7a/0xc0 sockdefreadable+0x3c/0x70 tcpdataqueue+0x4a7/0xc40 tcprcvestablished+0x32f/0x660 ? skfiltertrimcap+0xcb/0x2e0 tcpv4dorcv+0x10b/0x260 tcpv4rcv+0xd2a/0xde0 ipprotocoldeliverrcu+0x3b/0x1d0 iplocaldeliverfinish+0x54/0x60 iplocaldeliver+0x6a/0x110 ? tcpv4earlydemux+0xa2/0x140 ? tcpv4earlydemux+0x10d/0x140 ipsublistrcvfinish+0x49/0x60 ipsublistrcv+0x19d/0x230 iplistrcv+0x13e/0x170 __netifreceiveskb_listcore+0x1c2/0x240 netifreceiveskblistinternal+0x1e6/0x320 napicompletedone+0x11d/0x190 mlx5enapipoll+0x163/0x6b0 [mlx5core] __napipoll+0x3c/0x1b0 netrx_action+0x27c/0x300 __dosoftirq+0x114/0x2d2 irqexitrcu+0xb4/0xe0 commoninterrupt+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.

Database specific
{
    "cna_assigner": "Linux",
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/48xxx/CVE-2022-48721.json"
}
References

Affected packages

Git / git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git

Affected ranges

Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
fb92e025baa73e99250b79ab64f4e088d2888993
Fixed
0ef6049f664941bc0f75828b3a61877635048b27
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
2153bd1e3d3dbf6a3403572084ef6ed31c53c5f0
Fixed
504078fbe9dd570d685361b57784a6050bc40aaa
Fixed
341adeec9adad0874f29a0a1af35638207352a39
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
0 Unknown introduced commit / All previous commits are affected
Last affected
d6e981ec9491be5ec46d838b1151e7edefe607f5
Last affected
ff6eeb627898c179aac421af5d6515d3f50b84df

Database specific

source
"https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2022-48721.json"