In the Linux kernel, the following vulnerability has been resolved:
usb: dwc3: core: remove lock of otg mode during gadget suspend/resume to avoid deadlock
When config CONFIGUSBDWC3DUALROLE is selected, and trigger system to enter suspend status with below command: echo mem > /sys/power/state There will be a deadlock issue occurring. Detailed invoking path as below: dwc3suspendcommon() spinlockirqsave(&dwc->lock, flags); <-- 1st dwc3gadgetsuspend(dwc); dwc3gadgetsoftdisconnect(dwc); spinlockirqsave(&dwc->lock, flags); <-- 2nd This issue is exposed by commit c7ebd8149ee5 ("usb: dwc3: gadget: Fix NULL pointer dereference in dwc3gadgetsuspend") that removes the code of checking whether dwc->gadgetdriver is NULL or not. It causes the following code is executed and deadlock occurs when trying to get the spinlock. In fact, the root cause is the commit 5265397f9442("usb: dwc3: Remove DWC3 locking during gadget suspend/resume") that forgot to remove the lock of otg mode. So, remove the redundant lock of otg mode during gadget suspend/resume.
[
{
"signature_type": "Function",
"deprecated": false,
"id": "CVE-2024-42085-0105ab09",
"digest": {
"length": 1093.0,
"function_hash": "336737577096200335091051213607977815959"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@17e2956633ca560b95f1cbbb297cfc2adf650649",
"signature_version": "v1",
"target": {
"file": "drivers/usb/dwc3/core.c",
"function": "dwc3_suspend_common"
}
},
{
"signature_type": "Function",
"deprecated": false,
"id": "CVE-2024-42085-06e68190",
"digest": {
"length": 1291.0,
"function_hash": "280449820856045002342100589384988129702"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@d77e2b5104c51d3668b9717c825a4a06998efe63",
"signature_version": "v1",
"target": {
"file": "drivers/usb/dwc3/core.c",
"function": "dwc3_resume_common"
}
},
{
"signature_type": "Function",
"deprecated": false,
"id": "CVE-2024-42085-0c88d310",
"digest": {
"length": 1498.0,
"function_hash": "188687590691977128018749582600859443470"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@7838de15bb700c2898a7d741db9b1f3cbc86c136",
"signature_version": "v1",
"target": {
"file": "drivers/usb/dwc3/core.c",
"function": "dwc3_resume_common"
}
},
{
"signature_type": "Function",
"deprecated": false,
"id": "CVE-2024-42085-16576cd7",
"digest": {
"length": 1062.0,
"function_hash": "296991861466026512175979687417507168333"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@8731a0b180f6b5d52397c7aeea6eda9511a467a7",
"signature_version": "v1",
"target": {
"file": "drivers/usb/dwc3/core.c",
"function": "dwc3_suspend_common"
}
},
{
"signature_type": "Line",
"deprecated": false,
"id": "CVE-2024-42085-29e52cfb",
"digest": {
"line_hashes": [
"242135026772575990573152492378080885943",
"301509458292796189059446495426810862371",
"245306877475342926071517955960098063486",
"161662207573989504388629116350302647406",
"71586498515879110048625068141316237030",
"241771056128170134494388925177725170565",
"9701400252560480777537637083311068152",
"119544139887235364215446060446750466977",
"288762954698246899836755109689565373730",
"241135982952536281703376753029471907370",
"68476298796784539520282671336354908007",
"86739532685913750136999635377553387384",
"141680639064711105946359152898787846378",
"155646248927227216621451832103081954924",
"129247920568157385233468721561814571606",
"188024768252286831246747221195977023809",
"190321848316528344042572505138818025277",
"321785131822036935330942682010046582730",
"215275760438761442932256058319692764150",
"245292985103868664701487839275739071997"
],
"threshold": 0.9
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@f1274cfab183e69a7c7bafffcb4f50703c876276",
"signature_version": "v1",
"target": {
"file": "drivers/usb/dwc3/core.c"
}
},
{
"signature_type": "Line",
"deprecated": false,
"id": "CVE-2024-42085-32aabea0",
"digest": {
"line_hashes": [
"242135026772575990573152492378080885943",
"301509458292796189059446495426810862371",
"245306877475342926071517955960098063486",
"161662207573989504388629116350302647406",
"71586498515879110048625068141316237030",
"241771056128170134494388925177725170565",
"9701400252560480777537637083311068152",
"119544139887235364215446060446750466977",
"288762954698246899836755109689565373730",
"241135982952536281703376753029471907370",
"68476298796784539520282671336354908007",
"86739532685913750136999635377553387384",
"141680639064711105946359152898787846378",
"155646248927227216621451832103081954924",
"129247920568157385233468721561814571606",
"188024768252286831246747221195977023809",
"190321848316528344042572505138818025277",
"321785131822036935330942682010046582730",
"215275760438761442932256058319692764150",
"245292985103868664701487839275739071997"
],
"threshold": 0.9
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@d77e2b5104c51d3668b9717c825a4a06998efe63",
"signature_version": "v1",
"target": {
"file": "drivers/usb/dwc3/core.c"
}
},
{
"signature_type": "Line",
"deprecated": false,
"id": "CVE-2024-42085-3fd64f7e",
"digest": {
"line_hashes": [
"242135026772575990573152492378080885943",
"301509458292796189059446495426810862371",
"245306877475342926071517955960098063486",
"161662207573989504388629116350302647406",
"71586498515879110048625068141316237030",
"241771056128170134494388925177725170565",
"9701400252560480777537637083311068152",
"119544139887235364215446060446750466977",
"288762954698246899836755109689565373730",
"241135982952536281703376753029471907370",
"68476298796784539520282671336354908007",
"86739532685913750136999635377553387384",
"141680639064711105946359152898787846378",
"155646248927227216621451832103081954924",
"129247920568157385233468721561814571606",
"188024768252286831246747221195977023809",
"190321848316528344042572505138818025277",
"321785131822036935330942682010046582730",
"215275760438761442932256058319692764150",
"245292985103868664701487839275739071997"
],
"threshold": 0.9
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@8731a0b180f6b5d52397c7aeea6eda9511a467a7",
"signature_version": "v1",
"target": {
"file": "drivers/usb/dwc3/core.c"
}
},
{
"signature_type": "Line",
"deprecated": false,
"id": "CVE-2024-42085-6ca8f017",
"digest": {
"line_hashes": [
"242135026772575990573152492378080885943",
"301509458292796189059446495426810862371",
"245306877475342926071517955960098063486",
"161662207573989504388629116350302647406",
"71586498515879110048625068141316237030",
"241771056128170134494388925177725170565",
"9701400252560480777537637083311068152",
"119544139887235364215446060446750466977",
"288762954698246899836755109689565373730",
"241135982952536281703376753029471907370",
"68476298796784539520282671336354908007",
"86739532685913750136999635377553387384",
"141680639064711105946359152898787846378",
"155646248927227216621451832103081954924",
"129247920568157385233468721561814571606",
"188024768252286831246747221195977023809",
"190321848316528344042572505138818025277",
"321785131822036935330942682010046582730",
"215275760438761442932256058319692764150",
"245292985103868664701487839275739071997"
],
"threshold": 0.9
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@17e2956633ca560b95f1cbbb297cfc2adf650649",
"signature_version": "v1",
"target": {
"file": "drivers/usb/dwc3/core.c"
}
},
{
"signature_type": "Function",
"deprecated": false,
"id": "CVE-2024-42085-72da40ad",
"digest": {
"length": 1093.0,
"function_hash": "336737577096200335091051213607977815959"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@f1274cfab183e69a7c7bafffcb4f50703c876276",
"signature_version": "v1",
"target": {
"file": "drivers/usb/dwc3/core.c",
"function": "dwc3_suspend_common"
}
},
{
"signature_type": "Line",
"deprecated": false,
"id": "CVE-2024-42085-7781a2d1",
"digest": {
"line_hashes": [
"242135026772575990573152492378080885943",
"301509458292796189059446495426810862371",
"183650525317254128228583201261322772621",
"286721286547530665818057908697552462543",
"71586498515879110048625068141316237030",
"241771056128170134494388925177725170565",
"9701400252560480777537637083311068152",
"119544139887235364215446060446750466977",
"288762954698246899836755109689565373730",
"241135982952536281703376753029471907370",
"68476298796784539520282671336354908007",
"86739532685913750136999635377553387384",
"141680639064711105946359152898787846378",
"247594360097091862266637644919628665396",
"129247920568157385233468721561814571606",
"188024768252286831246747221195977023809",
"190321848316528344042572505138818025277",
"321785131822036935330942682010046582730",
"215275760438761442932256058319692764150",
"245292985103868664701487839275739071997"
],
"threshold": 0.9
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@7838de15bb700c2898a7d741db9b1f3cbc86c136",
"signature_version": "v1",
"target": {
"file": "drivers/usb/dwc3/core.c"
}
},
{
"signature_type": "Function",
"deprecated": false,
"id": "CVE-2024-42085-8a2171ef",
"digest": {
"length": 1300.0,
"function_hash": "106632543559696166096109062172683149016"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@7838de15bb700c2898a7d741db9b1f3cbc86c136",
"signature_version": "v1",
"target": {
"file": "drivers/usb/dwc3/core.c",
"function": "dwc3_suspend_common"
}
},
{
"signature_type": "Function",
"deprecated": false,
"id": "CVE-2024-42085-c070cd16",
"digest": {
"length": 1291.0,
"function_hash": "280449820856045002342100589384988129702"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@17e2956633ca560b95f1cbbb297cfc2adf650649",
"signature_version": "v1",
"target": {
"file": "drivers/usb/dwc3/core.c",
"function": "dwc3_resume_common"
}
},
{
"signature_type": "Function",
"deprecated": false,
"id": "CVE-2024-42085-f0604ee0",
"digest": {
"length": 1260.0,
"function_hash": "151226526451112953856880945573493484002"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@8731a0b180f6b5d52397c7aeea6eda9511a467a7",
"signature_version": "v1",
"target": {
"file": "drivers/usb/dwc3/core.c",
"function": "dwc3_resume_common"
}
},
{
"signature_type": "Function",
"deprecated": false,
"id": "CVE-2024-42085-f73142bb",
"digest": {
"length": 1291.0,
"function_hash": "280449820856045002342100589384988129702"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@f1274cfab183e69a7c7bafffcb4f50703c876276",
"signature_version": "v1",
"target": {
"file": "drivers/usb/dwc3/core.c",
"function": "dwc3_resume_common"
}
},
{
"signature_type": "Function",
"deprecated": false,
"id": "CVE-2024-42085-fbd6be9d",
"digest": {
"length": 1093.0,
"function_hash": "336737577096200335091051213607977815959"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@d77e2b5104c51d3668b9717c825a4a06998efe63",
"signature_version": "v1",
"target": {
"file": "drivers/usb/dwc3/core.c",
"function": "dwc3_suspend_common"
}
}
]