In the Linux kernel, the following vulnerability has been resolved:
mfd: qcom-spmi-pmic: Fix revid implementation
The Qualcomm SPMI PMIC revid implementation is broken in multiple ways.
First, it assumes that just because the sibling base device has been registered that means that it is also bound to a driver, which may not be the case (e.g. due to probe deferral or asynchronous probe). This could trigger a NULL-pointer dereference when attempting to access the driver data of the unbound device.
Second, it accesses driver data of a sibling device directly and without any locking, which means that the driver data may be freed while it is being accessed (e.g. on driver unbind).
Third, it leaks a struct device reference to the sibling device which is looked up using the spmidevicefrom_of() every time a function (child) device is calling the revid function (e.g. on probe).
Fix this mess by reimplementing the revid lookup so that it is done only at probe of the PMIC device; the base device fetches the revid info from the hardware, while any secondary SPMI device fetches the information from the base device and caches it so that it can be accessed safely from its children. If the base device has not been probed yet then probe of a secondary device is deferred.
[
{
"signature_type": "Function",
"digest": {
"function_hash": "52288630983790127773526285344796154284",
"length": 540.0
},
"target": {
"file": "drivers/mfd/qcom-spmi-pmic.c",
"function": "pmic_spmi_probe"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@affae18838db5e6b463ee30c821385695af56dc2",
"id": "CVE-2023-52765-25786ebc",
"deprecated": false,
"signature_version": "v1"
},
{
"signature_type": "Line",
"digest": {
"threshold": 0.9,
"line_hashes": [
"186268552433704457638457465511521128862",
"313584047149259360795518663019835356529",
"3499772744744962182608293095315290595",
"258742423740007329872858221533122271588",
"316375896652761044056293406196545193862",
"204134830387353184987943036466491039874",
"137895748071121558443952151661486487873",
"161330274046111901076564847608912493936",
"319473775911812068197668676570005301814",
"147582160770358873272194693910198335968",
"146573647050436174866020137236733690720",
"228333786893646164320218047072773020662",
"198485675408101757246236296082454705718",
"79788261681224019234705457529340076292",
"70364990001330439148462370258009183059",
"276547555580713151194349802589033740732",
"262539210555109221496935705379427808472",
"220317651659912172560494721985665848221",
"19641068351826038189892219132114776054",
"242031068110038547178678697690510178232",
"182352353392882543923310209348906924437",
"15787470002058140615573668345088164731",
"109887843515141106740541443738462775676",
"205396400595885772507719001046301829025",
"53886455027278453550187694998386826395",
"69140590068477795409435841921070111197",
"230824666234907823090860148761680099500",
"225895040163530514542596644745858493189",
"87819082475090723924950307694119280283",
"215774479431976771440416458209780126007",
"295941066161445681357388136294535614395",
"152308183224606597685508844319897366471",
"315375751219433698292362883971987962887",
"263913319497426428806269587098527090537",
"185661106229016938427610820348317875274",
"188299314653527004168201827264456367900",
"309765689952266734989389737745753836199",
"13023436514492294400911091803810030206",
"323078492771895614480824146951021715756",
"270026294462658292430340320484140077383",
"260072222826928530179163175958610331425"
]
},
"target": {
"file": "drivers/mfd/qcom-spmi-pmic.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@4ce77b023d42a9f1062eecf438df1af4b4072eb2",
"id": "CVE-2023-52765-26070c35",
"deprecated": false,
"signature_version": "v1"
},
{
"signature_type": "Line",
"digest": {
"threshold": 0.9,
"line_hashes": [
"186268552433704457638457465511521128862",
"313584047149259360795518663019835356529",
"3499772744744962182608293095315290595",
"258742423740007329872858221533122271588",
"316375896652761044056293406196545193862",
"204134830387353184987943036466491039874",
"137895748071121558443952151661486487873",
"161330274046111901076564847608912493936",
"319473775911812068197668676570005301814",
"147582160770358873272194693910198335968",
"146573647050436174866020137236733690720",
"228333786893646164320218047072773020662",
"198485675408101757246236296082454705718",
"79788261681224019234705457529340076292",
"70364990001330439148462370258009183059",
"276547555580713151194349802589033740732",
"262539210555109221496935705379427808472",
"220317651659912172560494721985665848221",
"19641068351826038189892219132114776054",
"242031068110038547178678697690510178232",
"182352353392882543923310209348906924437",
"15787470002058140615573668345088164731",
"109887843515141106740541443738462775676",
"205396400595885772507719001046301829025",
"53886455027278453550187694998386826395",
"69140590068477795409435841921070111197",
"230824666234907823090860148761680099500",
"225895040163530514542596644745858493189",
"87819082475090723924950307694119280283",
"215774479431976771440416458209780126007",
"295941066161445681357388136294535614395",
"152308183224606597685508844319897366471",
"315375751219433698292362883971987962887",
"263913319497426428806269587098527090537",
"185661106229016938427610820348317875274",
"188299314653527004168201827264456367900",
"309765689952266734989389737745753836199",
"13023436514492294400911091803810030206",
"323078492771895614480824146951021715756",
"270026294462658292430340320484140077383",
"260072222826928530179163175958610331425"
]
},
"target": {
"file": "drivers/mfd/qcom-spmi-pmic.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@db98de0809f12b0edb9cd1be78e1ec1bfeba8f40",
"id": "CVE-2023-52765-2ba9ebe1",
"deprecated": false,
"signature_version": "v1"
},
{
"signature_type": "Function",
"digest": {
"function_hash": "52288630983790127773526285344796154284",
"length": 540.0
},
"target": {
"file": "drivers/mfd/qcom-spmi-pmic.c",
"function": "pmic_spmi_probe"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@4ce77b023d42a9f1062eecf438df1af4b4072eb2",
"id": "CVE-2023-52765-3825e6ab",
"deprecated": false,
"signature_version": "v1"
},
{
"signature_type": "Line",
"digest": {
"threshold": 0.9,
"line_hashes": [
"186268552433704457638457465511521128862",
"313584047149259360795518663019835356529",
"3499772744744962182608293095315290595",
"258742423740007329872858221533122271588",
"316375896652761044056293406196545193862",
"204134830387353184987943036466491039874",
"137895748071121558443952151661486487873",
"161330274046111901076564847608912493936",
"319473775911812068197668676570005301814",
"147582160770358873272194693910198335968",
"146573647050436174866020137236733690720",
"228333786893646164320218047072773020662",
"198485675408101757246236296082454705718",
"79788261681224019234705457529340076292",
"70364990001330439148462370258009183059",
"276547555580713151194349802589033740732",
"262539210555109221496935705379427808472",
"220317651659912172560494721985665848221",
"19641068351826038189892219132114776054",
"242031068110038547178678697690510178232",
"182352353392882543923310209348906924437",
"15787470002058140615573668345088164731",
"109887843515141106740541443738462775676",
"205396400595885772507719001046301829025",
"53886455027278453550187694998386826395",
"69140590068477795409435841921070111197",
"230824666234907823090860148761680099500",
"225895040163530514542596644745858493189",
"87819082475090723924950307694119280283",
"215774479431976771440416458209780126007",
"295941066161445681357388136294535614395",
"152308183224606597685508844319897366471",
"315375751219433698292362883971987962887",
"263913319497426428806269587098527090537",
"185661106229016938427610820348317875274",
"188299314653527004168201827264456367900",
"309765689952266734989389737745753836199",
"13023436514492294400911091803810030206",
"323078492771895614480824146951021715756",
"270026294462658292430340320484140077383",
"260072222826928530179163175958610331425"
]
},
"target": {
"file": "drivers/mfd/qcom-spmi-pmic.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@7b439aaa62fee474a0d84d67a25f4984467e7b95",
"id": "CVE-2023-52765-7011590c",
"deprecated": false,
"signature_version": "v1"
},
{
"signature_type": "Line",
"digest": {
"threshold": 0.9,
"line_hashes": [
"186268552433704457638457465511521128862",
"313584047149259360795518663019835356529",
"3499772744744962182608293095315290595",
"258742423740007329872858221533122271588",
"316375896652761044056293406196545193862",
"204134830387353184987943036466491039874",
"137895748071121558443952151661486487873",
"161330274046111901076564847608912493936",
"319473775911812068197668676570005301814",
"147582160770358873272194693910198335968",
"146573647050436174866020137236733690720",
"228333786893646164320218047072773020662",
"198485675408101757246236296082454705718",
"79788261681224019234705457529340076292",
"70364990001330439148462370258009183059",
"276547555580713151194349802589033740732",
"262539210555109221496935705379427808472",
"220317651659912172560494721985665848221",
"19641068351826038189892219132114776054",
"242031068110038547178678697690510178232",
"182352353392882543923310209348906924437",
"15787470002058140615573668345088164731",
"109887843515141106740541443738462775676",
"205396400595885772507719001046301829025",
"53886455027278453550187694998386826395",
"69140590068477795409435841921070111197",
"230824666234907823090860148761680099500",
"225895040163530514542596644745858493189",
"87819082475090723924950307694119280283",
"215774479431976771440416458209780126007",
"295941066161445681357388136294535614395",
"152308183224606597685508844319897366471",
"315375751219433698292362883971987962887",
"263913319497426428806269587098527090537",
"185661106229016938427610820348317875274",
"188299314653527004168201827264456367900",
"309765689952266734989389737745753836199",
"13023436514492294400911091803810030206",
"323078492771895614480824146951021715756",
"270026294462658292430340320484140077383",
"260072222826928530179163175958610331425"
]
},
"target": {
"file": "drivers/mfd/qcom-spmi-pmic.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@affae18838db5e6b463ee30c821385695af56dc2",
"id": "CVE-2023-52765-7a1c5302",
"deprecated": false,
"signature_version": "v1"
},
{
"signature_type": "Function",
"digest": {
"function_hash": "52288630983790127773526285344796154284",
"length": 540.0
},
"target": {
"file": "drivers/mfd/qcom-spmi-pmic.c",
"function": "pmic_spmi_probe"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@7b439aaa62fee474a0d84d67a25f4984467e7b95",
"id": "CVE-2023-52765-907234f1",
"deprecated": false,
"signature_version": "v1"
},
{
"signature_type": "Function",
"digest": {
"function_hash": "48017955733459337814194269830243280441",
"length": 308.0
},
"target": {
"file": "drivers/mfd/qcom-spmi-pmic.c",
"function": "qcom_pmic_get"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@affae18838db5e6b463ee30c821385695af56dc2",
"id": "CVE-2023-52765-9ac16711",
"deprecated": false,
"signature_version": "v1"
},
{
"signature_type": "Function",
"digest": {
"function_hash": "48017955733459337814194269830243280441",
"length": 308.0
},
"target": {
"file": "drivers/mfd/qcom-spmi-pmic.c",
"function": "qcom_pmic_get"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@db98de0809f12b0edb9cd1be78e1ec1bfeba8f40",
"id": "CVE-2023-52765-9e45a44a",
"deprecated": false,
"signature_version": "v1"
},
{
"signature_type": "Function",
"digest": {
"function_hash": "113048724525675055617818915806877784197",
"length": 684.0
},
"target": {
"file": "drivers/mfd/qcom-spmi-pmic.c",
"function": "qcom_pmic_get_base_usid"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@affae18838db5e6b463ee30c821385695af56dc2",
"id": "CVE-2023-52765-baedf638",
"deprecated": false,
"signature_version": "v1"
},
{
"signature_type": "Function",
"digest": {
"function_hash": "52288630983790127773526285344796154284",
"length": 540.0
},
"target": {
"file": "drivers/mfd/qcom-spmi-pmic.c",
"function": "pmic_spmi_probe"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@db98de0809f12b0edb9cd1be78e1ec1bfeba8f40",
"id": "CVE-2023-52765-d2119edd",
"deprecated": false,
"signature_version": "v1"
},
{
"signature_type": "Function",
"digest": {
"function_hash": "48017955733459337814194269830243280441",
"length": 308.0
},
"target": {
"file": "drivers/mfd/qcom-spmi-pmic.c",
"function": "qcom_pmic_get"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@4ce77b023d42a9f1062eecf438df1af4b4072eb2",
"id": "CVE-2023-52765-dba76ec0",
"deprecated": false,
"signature_version": "v1"
},
{
"signature_type": "Function",
"digest": {
"function_hash": "113048724525675055617818915806877784197",
"length": 684.0
},
"target": {
"file": "drivers/mfd/qcom-spmi-pmic.c",
"function": "qcom_pmic_get_base_usid"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@4ce77b023d42a9f1062eecf438df1af4b4072eb2",
"id": "CVE-2023-52765-e49eb839",
"deprecated": false,
"signature_version": "v1"
},
{
"signature_type": "Function",
"digest": {
"function_hash": "113048724525675055617818915806877784197",
"length": 684.0
},
"target": {
"file": "drivers/mfd/qcom-spmi-pmic.c",
"function": "qcom_pmic_get_base_usid"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@7b439aaa62fee474a0d84d67a25f4984467e7b95",
"id": "CVE-2023-52765-ec897ddc",
"deprecated": false,
"signature_version": "v1"
},
{
"signature_type": "Function",
"digest": {
"function_hash": "113048724525675055617818915806877784197",
"length": 684.0
},
"target": {
"file": "drivers/mfd/qcom-spmi-pmic.c",
"function": "qcom_pmic_get_base_usid"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@db98de0809f12b0edb9cd1be78e1ec1bfeba8f40",
"id": "CVE-2023-52765-edca3524",
"deprecated": false,
"signature_version": "v1"
},
{
"signature_type": "Function",
"digest": {
"function_hash": "48017955733459337814194269830243280441",
"length": 308.0
},
"target": {
"file": "drivers/mfd/qcom-spmi-pmic.c",
"function": "qcom_pmic_get"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@7b439aaa62fee474a0d84d67a25f4984467e7b95",
"id": "CVE-2023-52765-fb27750b",
"deprecated": false,
"signature_version": "v1"
}
]