In the Linux kernel, the following vulnerability has been resolved:
drivers: staging: rtl8192bs: Fix deadlock in rtwjoinbssevent_prehandle()
There is a deadlock in rtwjoinbssevent_prehandle(), 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, rtwjoinbssevent_prehandle() will block forever.
This patch extracts deltimersync() from the protection of spinlockbh(), which could let timer handler to obtain the needed lock. What`s more, we change spinlockbh() to spinlockirq() in rtwjointimeouthandler() in order to prevent deadlock.
[
{
"signature_version": "v1",
"digest": {
"length": 2776.0,
"function_hash": "3855740063056779416121084603303942797"
},
"signature_type": "Function",
"id": "CVE-2022-49311-27464449",
"target": {
"file": "drivers/staging/rtl8723bs/core/rtw_mlme.c",
"function": "rtw_joinbss_event_prehandle"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@041879b12ddb0c6c83ed9c0bdd10dc82a056f2fc",
"deprecated": false
},
{
"signature_version": "v1",
"digest": {
"length": 2776.0,
"function_hash": "3855740063056779416121084603303942797"
},
"signature_type": "Function",
"id": "CVE-2022-49311-3bd4991b",
"target": {
"file": "drivers/staging/rtl8723bs/core/rtw_mlme.c",
"function": "rtw_joinbss_event_prehandle"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@1f6c99b94ca3caad346876b3e22e3ca3d25bc8ee",
"deprecated": false
},
{
"signature_version": "v1",
"digest": {
"length": 2776.0,
"function_hash": "3855740063056779416121084603303942797"
},
"signature_type": "Function",
"id": "CVE-2022-49311-8ac6a808",
"target": {
"file": "drivers/staging/rtl8723bs/core/rtw_mlme.c",
"function": "rtw_joinbss_event_prehandle"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@eca9748d9267a38d532464e3305a38629e9c35a9",
"deprecated": false
},
{
"signature_version": "v1",
"digest": {
"threshold": 0.9,
"line_hashes": [
"172223227933891095506809584906650542952",
"287118705702629311559203056403605033769",
"7469402895797796783819986558899036051",
"183723281402703106527594683397701408361",
"331140480606492234305013708248533071053",
"196289558753906754991450715089900405274",
"3812825970029137492459930205652602459",
"160884521953941595683161688917306260707",
"330677152423135473813853020694374386315",
"267694050991392000553725660819800897079",
"105443792990885365883596153136156645729",
"28173650280103303283822071763978926927"
]
},
"signature_type": "Line",
"id": "CVE-2022-49311-93489015",
"target": {
"file": "drivers/staging/rtl8723bs/core/rtw_mlme.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@041879b12ddb0c6c83ed9c0bdd10dc82a056f2fc",
"deprecated": false
},
{
"signature_version": "v1",
"digest": {
"length": 2776.0,
"function_hash": "3855740063056779416121084603303942797"
},
"signature_type": "Function",
"id": "CVE-2022-49311-d92db38c",
"target": {
"file": "drivers/staging/rtl8723bs/core/rtw_mlme.c",
"function": "rtw_joinbss_event_prehandle"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@ae60744d5fad840b9d056d35b4b652d95e755846",
"deprecated": false
},
{
"signature_version": "v1",
"digest": {
"threshold": 0.9,
"line_hashes": [
"172223227933891095506809584906650542952",
"287118705702629311559203056403605033769",
"7469402895797796783819986558899036051",
"183723281402703106527594683397701408361",
"331140480606492234305013708248533071053",
"196289558753906754991450715089900405274",
"3812825970029137492459930205652602459",
"160884521953941595683161688917306260707",
"330677152423135473813853020694374386315",
"267694050991392000553725660819800897079",
"105443792990885365883596153136156645729",
"28173650280103303283822071763978926927"
]
},
"signature_type": "Line",
"id": "CVE-2022-49311-dd509c8d",
"target": {
"file": "drivers/staging/rtl8723bs/core/rtw_mlme.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@eca9748d9267a38d532464e3305a38629e9c35a9",
"deprecated": false
},
{
"signature_version": "v1",
"digest": {
"threshold": 0.9,
"line_hashes": [
"172223227933891095506809584906650542952",
"287118705702629311559203056403605033769",
"7469402895797796783819986558899036051",
"183723281402703106527594683397701408361",
"331140480606492234305013708248533071053",
"196289558753906754991450715089900405274",
"3812825970029137492459930205652602459",
"160884521953941595683161688917306260707",
"330677152423135473813853020694374386315",
"267694050991392000553725660819800897079",
"105443792990885365883596153136156645729",
"28173650280103303283822071763978926927"
]
},
"signature_type": "Line",
"id": "CVE-2022-49311-de904b7b",
"target": {
"file": "drivers/staging/rtl8723bs/core/rtw_mlme.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@1f6c99b94ca3caad346876b3e22e3ca3d25bc8ee",
"deprecated": false
},
{
"signature_version": "v1",
"digest": {
"threshold": 0.9,
"line_hashes": [
"172223227933891095506809584906650542952",
"287118705702629311559203056403605033769",
"7469402895797796783819986558899036051",
"183723281402703106527594683397701408361",
"331140480606492234305013708248533071053",
"196289558753906754991450715089900405274",
"3812825970029137492459930205652602459",
"160884521953941595683161688917306260707",
"330677152423135473813853020694374386315",
"267694050991392000553725660819800897079",
"105443792990885365883596153136156645729",
"28173650280103303283822071763978926927"
]
},
"signature_type": "Line",
"id": "CVE-2022-49311-fcf3cb1c",
"target": {
"file": "drivers/staging/rtl8723bs/core/rtw_mlme.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@ae60744d5fad840b9d056d35b4b652d95e755846",
"deprecated": false
}
]