CVE-2022-49311: drivers: staging: rtl8192bs: Fix deadlock in rtw_joinbss_event_prehandle()
In the Linux kernel, the following vulnerability has been resolved:
drivers: staging: rtl8192bs: Fix deadlock in rtwjoinbsseventprehandle()
There is a deadlock in rtwjoinbsseventprehandle(), which is shown below:
(Thread 1) | (Thread 2) | settimer() rtwjoinbsseventprehandle()| modtimer() spinlockbh() //(1) | (wait a time) ... | rtwjointimeouthandler() deltimersync() | spinlockbh() //(2) (wait timer to stop) | ...
We hold pmlmepriv->lock in position (1) of thread 1 and use deltimersync() to wait timer to stop, but timer handler also need pmlmepriv->lock in position (2) of thread 2. As a result, rtwjoinbsseventprehandle() will block forever.
This patch extracts deltimersync() from the protection of spinlockbh(), which could let timer handler to obtain the needed lock. Whats more, we change spinlockbh() to spinlockirq() in rtwjointimeouthandler() in order to prevent deadlock.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 5.18.5-1 - Upgrade
Upgrade
ubuntu/linux-aws-5.15to a version that resolves this vulnerability.Fixed in 5.15.0-1020.24~20.04.1 - Upgrade
Upgrade
ubuntu/linux-azure-5.15to a version that resolves this vulnerability.Fixed in 5.15.0-1020.25~20.04.1 - Upgrade
Upgrade
ubuntu/linux-gcp-5.15to a version that resolves this vulnerability.Fixed in 5.15.0-1018.24~20.04.1 - Upgrade
Upgrade
ubuntu/linux-hwe-5.15to a version that resolves this vulnerability.Fixed in 5.15.0-48.54~20.04.1 - Upgrade
Upgrade
ubuntu/linux-intel-iotg-5.15to a version that resolves this vulnerability.Fixed in 5.15.0-1016.21~20.04.1 - Upgrade
Upgrade
ubuntu/linux-lowlatency-hwe-5.15to a version that resolves this vulnerability.Fixed in 5.15.0-48.54~20.04.1 - Upgrade
Upgrade
ubuntu/linux-oracle-5.15to a version that resolves this vulnerability.Fixed in 5.15.0-1018.23~20.04.1 - Upgrade
Upgrade
ubuntu/linux-riscv-5.15to a version that resolves this vulnerability.Fixed in 5.15.0-1019.22~20.04.1 - Upgrade
Upgrade
ubuntu/linuxto a version that resolves this vulnerability.Fixed in 5.15.0-48.54 - Upgrade
Upgrade
ubuntu/linux-awsto a version that resolves this vulnerability.Fixed in 5.15.0-1020.24 - Upgrade
Upgrade
ubuntu/linux-azureto a version that resolves this vulnerability.Fixed in 5.15.0-1020.25 - Upgrade
Upgrade
ubuntu/linux-azure-fdeto a version that resolves this vulnerability.Fixed in 5.15.0-1024.30.1 - Upgrade
Upgrade
ubuntu/linux-gcpto a version that resolves this vulnerability.Fixed in 5.15.0-1018.24 - Upgrade
Upgrade
ubuntu/linux-gketo a version that resolves this vulnerability.Fixed in 5.15.0-1016.19 - Upgrade
Upgrade
ubuntu/linux-gkeopto a version that resolves this vulnerability.Fixed in 5.15.0-1003.5 - Upgrade
Upgrade
ubuntu/linux-ibmto a version that resolves this vulnerability.Fixed in 5.15.0-1015.17 - Upgrade
Upgrade
ubuntu/linux-intel-iotgto a version that resolves this vulnerability.Fixed in 5.15.0-1016.21 - Upgrade
Upgrade
ubuntu/linux-kvmto a version that resolves this vulnerability.Fixed in 5.15.0-1018.22 - Upgrade
Upgrade
ubuntu/linux-lowlatencyto a version that resolves this vulnerability.Fixed in 5.15.0-48.54 - Upgrade
Upgrade
ubuntu/linux-nvidiato a version that resolves this vulnerability.Fixed in 5.15.0-1007.7 - Upgrade
Upgrade
ubuntu/linux-oracleto a version that resolves this vulnerability.Fixed in 5.15.0-1018.23 - Upgrade
Upgrade
ubuntu/linux-raspito a version that resolves this vulnerability.Fixed in 5.15.0-1015.17 - Upgrade
Upgrade
ubuntu/linux-realtimeto a version that resolves this vulnerability.Fixed in 5.15.0-1021.21 - Compensating control
In drivers/staging/rtl8192bs, move del_timer_sync() outside the spin_lock_bh() protection in rtw_joinbss_event_prehandle(), and change spin_lock_bh() to spin_lock_irq() in _rtw_join_timeout_handler().
Event History
Frequently Asked Questions
What is the severity of CVE-2022-49311?
CVE-2022-49311 has been classified with a severity rating yet to be assigned based on the potential impact of the deadlock vulnerability.
How do I fix CVE-2022-49311?
To fix CVE-2022-49311, update to the latest version of the Linux kernel that includes the patch for this deadlock issue.
Which versions of the Linux kernel are affected by CVE-2022-49311?
CVE-2022-49311 affects certain versions of the Linux kernel that utilize the rtl8192bs driver.
What impact does CVE-2022-49311 have on the Linux kernel?
CVE-2022-49311 can lead to a deadlock situation in the Linux kernel, potentially affecting system stability and performance.
Is CVE-2022-49311 being actively exploited in the wild?
As of now, there is no public information indicating that CVE-2022-49311 is being actively exploited in the wild.