In the Linux kernel, the following vulnerability has been resolved:
usb: dwc2: fix a devres leak in hw_enable upon suspend resume
Each time the platform goes to low power, PM suspend / resume routines call: _dwc2lowlevelhwenable -> devmaddactionorreset(). This adds a new devres each time. This may also happen at runtime, as dwc2lowlevelhwenable() can be called from udcstart().
This can be seen with tracing: - echo 1 > /sys/kernel/debug/tracing/events/dev/devres_log/enable - go to low power - cat /sys/kernel/debug/tracing/trace
A new "ADD" entry is found upon each low power cycle: ... devreslog: 49000000.usb-otg ADD 82a13bba devmactionrelease (8 bytes) ... devreslog: 49000000.usb-otg ADD 49889daf devmactionrelease (8 bytes) ...
A second issue is addressed here: - regulatorbulkenable() is called upon each PM cycle (suspend/resume). - regulatorbulkdisable() never gets called.
So the reference count for these regulators constantly increase, by one upon each low power cycle, due to missing regulatorbulkdisable() call in _dwc2lowlevelhwdisable().
The original fix that introduced the devmaddactionorreset() call, fixed an issue during probe, that happens due to other errors in dwc2driverprobe() -> dwc2corereset(). Then the probe fails without disabling regulators, when drmode == USBDRMODEPERIPHERAL.
Rather fix the error path: disable all the low level hardware in the error path, by using the "hsotg->llhwenabled" flag. Checking drmode has been introduced to avoid a dual call to dwc2lowlevelhwdisable(). "llhwenabled" should achieve the same (and is used currently in the remove() routine).
{ "vanir_signatures": [ { "digest": { "length": 4040.0, "function_hash": "155010850463541780174592374038982537779" }, "target": { "function": "dwc2_driver_probe", "file": "drivers/usb/dwc2/platform.c" }, "signature_type": "Function", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@f747313249b74f323ddf841a9c8db14d989f296a", "deprecated": false, "signature_version": "v1", "id": "CVE-2023-53054-0f622b02" }, { "digest": { "length": 460.0, "function_hash": "186655465631506588089323174032411918687" }, "target": { "function": "__dwc2_lowlevel_hw_disable", "file": "drivers/usb/dwc2/platform.c" }, "signature_type": "Function", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@6485fc381b6528b6f547ee1ff10bdbcbe31a6e4c", "deprecated": false, "signature_version": "v1", "id": "CVE-2023-53054-1d4d1382" }, { "digest": { "line_hashes": [ "135999200032155949020518806436149785753", "339115103608525884123096975428260850689", "98867121075701021345925199959432792500", "332279985562492398296498434548982704837", "174597305172848251998857918145972243692", "11691082763114663735299916355928866436", "90353551177686795325196673565608610632", "3404825890523541885409233807375980203", "104582089313675291191820798080439335896", "139883403986277194496709538013759185233", "83521640555785930245958552369478929654", "142465564304637958663183421744683851071", "67908159031052683405225075735873674397", "128557865576506403493403609424137748779", "184221264266915103737792382439456661291", "214995124071434316365681747176832132023", "309364032021042112483422652602189988671", "262823283707898229342855785606302952321", "286832592841955154615281850917029091799", "63810906073901524108675010211936271522", "334183654016612849492299276809373104981", "289175584956966216561139868429892255956", "12318516073583470977862674799518596667" ], "threshold": 0.9 }, "target": { "file": "drivers/usb/dwc2/platform.c" }, "signature_type": "Line", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@cba76e1fb896b573f09f51aa299223276a77bc90", "deprecated": false, "signature_version": "v1", "id": "CVE-2023-53054-23f190a3" }, { "digest": { "length": 460.0, "function_hash": "186655465631506588089323174032411918687" }, "target": { "function": "__dwc2_lowlevel_hw_disable", "file": "drivers/usb/dwc2/platform.c" }, "signature_type": "Function", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@1f01027c51eb16145e8e07fafea3ca07ef102d06", "deprecated": false, "signature_version": "v1", "id": "CVE-2023-53054-5beb9b03" }, { "digest": { "length": 3979.0, "function_hash": "314940616493086995712825848034743184008" }, "target": { "function": "dwc2_driver_probe", "file": "drivers/usb/dwc2/platform.c" }, "signature_type": "Function", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@ffb8ab6f87bd28d700ab5c20d9d3a7e75067630d", "deprecated": false, "signature_version": "v1", "id": "CVE-2023-53054-5d82cc2b" }, { "digest": { "line_hashes": [ "135999200032155949020518806436149785753", "339115103608525884123096975428260850689", "98867121075701021345925199959432792500", "332279985562492398296498434548982704837", "174597305172848251998857918145972243692", "11691082763114663735299916355928866436", "90353551177686795325196673565608610632", "3404825890523541885409233807375980203", "104582089313675291191820798080439335896", "139883403986277194496709538013759185233", "83521640555785930245958552369478929654", "142465564304637958663183421744683851071", "67908159031052683405225075735873674397", "128557865576506403493403609424137748779", "184221264266915103737792382439456661291", "214995124071434316365681747176832132023", "309364032021042112483422652602189988671", "262823283707898229342855785606302952321", "286832592841955154615281850917029091799", "63810906073901524108675010211936271522", "334183654016612849492299276809373104981", "289175584956966216561139868429892255956", "12318516073583470977862674799518596667" ], "threshold": 0.9 }, "target": { "file": "drivers/usb/dwc2/platform.c" }, "signature_type": "Line", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@1f01027c51eb16145e8e07fafea3ca07ef102d06", "deprecated": false, "signature_version": "v1", "id": "CVE-2023-53054-5decdecc" }, { "digest": { "length": 664.0, "function_hash": "222313760062378890657850734647783039921" }, "target": { "function": "__dwc2_lowlevel_hw_enable", "file": "drivers/usb/dwc2/platform.c" }, "signature_type": "Function", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@6485fc381b6528b6f547ee1ff10bdbcbe31a6e4c", "deprecated": false, "signature_version": "v1", "id": "CVE-2023-53054-5ecf0d22" }, { "digest": { "length": 664.0, "function_hash": "222313760062378890657850734647783039921" }, "target": { "function": "__dwc2_lowlevel_hw_enable", "file": "drivers/usb/dwc2/platform.c" }, "signature_type": "Function", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@cba76e1fb896b573f09f51aa299223276a77bc90", "deprecated": false, "signature_version": "v1", "id": "CVE-2023-53054-60705d68" }, { "digest": { "line_hashes": [ "135999200032155949020518806436149785753", "339115103608525884123096975428260850689", "98867121075701021345925199959432792500", "332279985562492398296498434548982704837", "174597305172848251998857918145972243692", "11691082763114663735299916355928866436", "90353551177686795325196673565608610632", "3404825890523541885409233807375980203", "104582089313675291191820798080439335896", "139883403986277194496709538013759185233", "83521640555785930245958552369478929654", "142465564304637958663183421744683851071", "67908159031052683405225075735873674397", "128557865576506403493403609424137748779", "184221264266915103737792382439456661291", "214995124071434316365681747176832132023", "309364032021042112483422652602189988671", "262823283707898229342855785606302952321", "286832592841955154615281850917029091799", "63810906073901524108675010211936271522", "334183654016612849492299276809373104981", "289175584956966216561139868429892255956", "12318516073583470977862674799518596667" ], "threshold": 0.9 }, "target": { "file": "drivers/usb/dwc2/platform.c" }, "signature_type": "Line", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@f747313249b74f323ddf841a9c8db14d989f296a", "deprecated": false, "signature_version": "v1", "id": "CVE-2023-53054-626d3c58" }, { "digest": { "length": 460.0, "function_hash": "186655465631506588089323174032411918687" }, "target": { "function": "__dwc2_lowlevel_hw_disable", "file": "drivers/usb/dwc2/platform.c" }, "signature_type": "Function", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@f747313249b74f323ddf841a9c8db14d989f296a", "deprecated": false, "signature_version": "v1", "id": "CVE-2023-53054-6bf5834c" }, { "digest": { "length": 460.0, "function_hash": "186655465631506588089323174032411918687" }, "target": { "function": "__dwc2_lowlevel_hw_disable", "file": "drivers/usb/dwc2/platform.c" }, "signature_type": "Function", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@ffb8ab6f87bd28d700ab5c20d9d3a7e75067630d", "deprecated": false, "signature_version": "v1", "id": "CVE-2023-53054-6dcac4ca" }, { "digest": { "line_hashes": [ "135999200032155949020518806436149785753", "339115103608525884123096975428260850689", "98867121075701021345925199959432792500", "332279985562492398296498434548982704837", "174597305172848251998857918145972243692", "11691082763114663735299916355928866436", "90353551177686795325196673565608610632", "3404825890523541885409233807375980203", "104582089313675291191820798080439335896", "139883403986277194496709538013759185233", "83521640555785930245958552369478929654", "142465564304637958663183421744683851071", "67908159031052683405225075735873674397", "128557865576506403493403609424137748779", "184221264266915103737792382439456661291", "214995124071434316365681747176832132023", "309364032021042112483422652602189988671", "262823283707898229342855785606302952321", "286832592841955154615281850917029091799", "63810906073901524108675010211936271522", "334183654016612849492299276809373104981", "289175584956966216561139868429892255956", "12318516073583470977862674799518596667" ], "threshold": 0.9 }, "target": { "file": "drivers/usb/dwc2/platform.c" }, "signature_type": "Line", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@6485fc381b6528b6f547ee1ff10bdbcbe31a6e4c", "deprecated": false, "signature_version": "v1", "id": "CVE-2023-53054-7205abeb" }, { "digest": { "length": 127.0, "function_hash": "248071147479482752077948545471395728285" }, "target": { "function": "__dwc2_disable_regulators", "file": "drivers/usb/dwc2/platform.c" }, "signature_type": "Function", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@1f01027c51eb16145e8e07fafea3ca07ef102d06", "deprecated": false, "signature_version": "v1", "id": "CVE-2023-53054-84b0ce8c" }, { "digest": { "length": 127.0, "function_hash": "248071147479482752077948545471395728285" }, "target": { "function": "__dwc2_disable_regulators", "file": "drivers/usb/dwc2/platform.c" }, "signature_type": "Function", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@f747313249b74f323ddf841a9c8db14d989f296a", "deprecated": false, "signature_version": "v1", "id": "CVE-2023-53054-8984cd24" }, { "digest": { "length": 664.0, "function_hash": "222313760062378890657850734647783039921" }, "target": { "function": "__dwc2_lowlevel_hw_enable", "file": "drivers/usb/dwc2/platform.c" }, "signature_type": "Function", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@f747313249b74f323ddf841a9c8db14d989f296a", "deprecated": false, "signature_version": "v1", "id": "CVE-2023-53054-8a8e5a25" }, { "digest": { "length": 127.0, "function_hash": "248071147479482752077948545471395728285" }, "target": { "function": "__dwc2_disable_regulators", "file": "drivers/usb/dwc2/platform.c" }, "signature_type": "Function", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@6485fc381b6528b6f547ee1ff10bdbcbe31a6e4c", "deprecated": false, "signature_version": "v1", "id": "CVE-2023-53054-94648319" }, { "digest": { "length": 127.0, "function_hash": "248071147479482752077948545471395728285" }, "target": { "function": "__dwc2_disable_regulators", "file": "drivers/usb/dwc2/platform.c" }, "signature_type": "Function", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@cba76e1fb896b573f09f51aa299223276a77bc90", "deprecated": false, "signature_version": "v1", "id": "CVE-2023-53054-af3ea214" }, { "digest": { "length": 127.0, "function_hash": "248071147479482752077948545471395728285" }, "target": { "function": "__dwc2_disable_regulators", "file": "drivers/usb/dwc2/platform.c" }, "signature_type": "Function", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@ffb8ab6f87bd28d700ab5c20d9d3a7e75067630d", "deprecated": false, "signature_version": "v1", "id": "CVE-2023-53054-b226df1e" }, { "digest": { "length": 3979.0, "function_hash": "314940616493086995712825848034743184008" }, "target": { "function": "dwc2_driver_probe", "file": "drivers/usb/dwc2/platform.c" }, "signature_type": "Function", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@6485fc381b6528b6f547ee1ff10bdbcbe31a6e4c", "deprecated": false, "signature_version": "v1", "id": "CVE-2023-53054-b967f3a8" }, { "digest": { "line_hashes": [ "135999200032155949020518806436149785753", "339115103608525884123096975428260850689", "98867121075701021345925199959432792500", "332279985562492398296498434548982704837", "174597305172848251998857918145972243692", "11691082763114663735299916355928866436", "90353551177686795325196673565608610632", "3404825890523541885409233807375980203", "104582089313675291191820798080439335896", "139883403986277194496709538013759185233", "83521640555785930245958552369478929654", "142465564304637958663183421744683851071", "67908159031052683405225075735873674397", "128557865576506403493403609424137748779", "184221264266915103737792382439456661291", "214995124071434316365681747176832132023", "309364032021042112483422652602189988671", "262823283707898229342855785606302952321", "286832592841955154615281850917029091799", "63810906073901524108675010211936271522", "334183654016612849492299276809373104981", "289175584956966216561139868429892255956", "12318516073583470977862674799518596667" ], "threshold": 0.9 }, "target": { "file": "drivers/usb/dwc2/platform.c" }, "signature_type": "Line", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@ffb8ab6f87bd28d700ab5c20d9d3a7e75067630d", "deprecated": false, "signature_version": "v1", "id": "CVE-2023-53054-c67bf8e1" }, { "digest": { "length": 460.0, "function_hash": "186655465631506588089323174032411918687" }, "target": { "function": "__dwc2_lowlevel_hw_disable", "file": "drivers/usb/dwc2/platform.c" }, "signature_type": "Function", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@cba76e1fb896b573f09f51aa299223276a77bc90", "deprecated": false, "signature_version": "v1", "id": "CVE-2023-53054-cc1c7571" }, { "digest": { "length": 4039.0, "function_hash": "157275732753571700397298464205345531337" }, "target": { "function": "dwc2_driver_probe", "file": "drivers/usb/dwc2/platform.c" }, "signature_type": "Function", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@cba76e1fb896b573f09f51aa299223276a77bc90", "deprecated": false, "signature_version": "v1", "id": "CVE-2023-53054-d5efe37a" }, { "digest": { "length": 664.0, "function_hash": "222313760062378890657850734647783039921" }, "target": { "function": "__dwc2_lowlevel_hw_enable", "file": "drivers/usb/dwc2/platform.c" }, "signature_type": "Function", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@ffb8ab6f87bd28d700ab5c20d9d3a7e75067630d", "deprecated": false, "signature_version": "v1", "id": "CVE-2023-53054-e8e33279" }, { "digest": { "length": 664.0, "function_hash": "222313760062378890657850734647783039921" }, "target": { "function": "__dwc2_lowlevel_hw_enable", "file": "drivers/usb/dwc2/platform.c" }, "signature_type": "Function", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@1f01027c51eb16145e8e07fafea3ca07ef102d06", "deprecated": false, "signature_version": "v1", "id": "CVE-2023-53054-e90eecec" }, { "digest": { "length": 4039.0, "function_hash": "157275732753571700397298464205345531337" }, "target": { "function": "dwc2_driver_probe", "file": "drivers/usb/dwc2/platform.c" }, "signature_type": "Function", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@1f01027c51eb16145e8e07fafea3ca07ef102d06", "deprecated": false, "signature_version": "v1", "id": "CVE-2023-53054-f78da0c0" } ] }