In the Linux kernel, the following vulnerability has been resolved:
i2c: stm32f7: Do not prepare/unprepare clock during runtime suspend/resume
In case there is any sort of clock controller attached to this I2C bus controller, for example Versaclock or even an AIC32x4 I2C codec, then an I2C transfer triggered from the clock controller clkops .prepare callback may trigger a deadlock on drivers/clk/clk.c preparelock mutex.
This is because the clock controller first grabs the preparelock mutex and then performs the prepare operation, including its I2C access. The I2C access resumes this I2C bus controller via .runtimeresume callback, which calls clkprepareenable(), which attempts to grab the prepare_lock mutex again and deadlocks.
Since the clock are already prepared since probe() and unprepared in remove(), use simple clkenable()/clkdisable() calls to enable and disable the clock on runtime suspend and resume, to avoid hitting the prepare_lock mutex.
[
{
"id": "CVE-2024-49985-0247cb69",
"deprecated": false,
"signature_version": "v1",
"signature_type": "Function",
"target": {
"file": "drivers/i2c/busses/i2c-stm32f7.c",
"function": "stm32f7_i2c_runtime_resume"
},
"digest": {
"function_hash": "195282318038723583189755666431361221337",
"length": 249.0
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@894cd5f5fd9061983445bbd1fa3d81be43095344"
},
{
"id": "CVE-2024-49985-07a277fc",
"deprecated": false,
"signature_version": "v1",
"signature_type": "Line",
"target": {
"file": "drivers/i2c/busses/i2c-stm32f7.c"
},
"digest": {
"line_hashes": [
"329473493114416341984072711378249224287",
"298939336391894660366298830761331701606",
"156579986743760844087149235515360924423",
"160362740746389140044374124030049930834",
"120378822762836527518143065399655289214",
"10722035645117517223634426057248238517",
"134990244841756995251451607050448894456",
"64396529888882130625985904375020298777",
"140088653837382974598383112703699676887",
"64226591006069578799659783888767355291"
],
"threshold": 0.9
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@d6f1250a4d5773f447740b9fe37b8692105796d4"
},
{
"id": "CVE-2024-49985-185bae2f",
"deprecated": false,
"signature_version": "v1",
"signature_type": "Line",
"target": {
"file": "drivers/i2c/busses/i2c-stm32f7.c"
},
"digest": {
"line_hashes": [
"329473493114416341984072711378249224287",
"298939336391894660366298830761331701606",
"156579986743760844087149235515360924423",
"71893335007056305341517979320163354942",
"120378822762836527518143065399655289214",
"10722035645117517223634426057248238517",
"134990244841756995251451607050448894456",
"64396529888882130625985904375020298777",
"140088653837382974598383112703699676887",
"64226591006069578799659783888767355291"
],
"threshold": 0.9
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@1883cad2cc629ded4a3556c0bbb8b42533ad8764"
},
{
"id": "CVE-2024-49985-262b4db1",
"deprecated": false,
"signature_version": "v1",
"signature_type": "Line",
"target": {
"file": "drivers/i2c/busses/i2c-stm32f7.c"
},
"digest": {
"line_hashes": [
"329473493114416341984072711378249224287",
"298939336391894660366298830761331701606",
"156579986743760844087149235515360924423",
"71893335007056305341517979320163354942",
"120378822762836527518143065399655289214",
"10722035645117517223634426057248238517",
"134990244841756995251451607050448894456",
"64396529888882130625985904375020298777",
"140088653837382974598383112703699676887",
"64226591006069578799659783888767355291"
],
"threshold": 0.9
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@22a1f8a5b56ba93d3e8b7a1dafa24e01c8bb48ba"
},
{
"id": "CVE-2024-49985-3e033ec5",
"deprecated": false,
"signature_version": "v1",
"signature_type": "Line",
"target": {
"file": "drivers/i2c/busses/i2c-stm32f7.c"
},
"digest": {
"line_hashes": [
"329473493114416341984072711378249224287",
"298939336391894660366298830761331701606",
"156579986743760844087149235515360924423",
"71893335007056305341517979320163354942",
"120378822762836527518143065399655289214",
"10722035645117517223634426057248238517",
"134990244841756995251451607050448894456",
"64396529888882130625985904375020298777",
"140088653837382974598383112703699676887",
"64226591006069578799659783888767355291"
],
"threshold": 0.9
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@048bbbdbf85e5e00258dfb12f5e368f908801d7b"
},
{
"id": "CVE-2024-49985-537fbdf6",
"deprecated": false,
"signature_version": "v1",
"signature_type": "Function",
"target": {
"file": "drivers/i2c/busses/i2c-stm32f7.c",
"function": "stm32f7_i2c_runtime_resume"
},
"digest": {
"function_hash": "195282318038723583189755666431361221337",
"length": 249.0
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@d6f1250a4d5773f447740b9fe37b8692105796d4"
},
{
"id": "CVE-2024-49985-5aca7076",
"deprecated": false,
"signature_version": "v1",
"signature_type": "Function",
"target": {
"file": "drivers/i2c/busses/i2c-stm32f7.c",
"function": "stm32f7_i2c_runtime_resume"
},
"digest": {
"function_hash": "195282318038723583189755666431361221337",
"length": 249.0
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@1883cad2cc629ded4a3556c0bbb8b42533ad8764"
},
{
"id": "CVE-2024-49985-75fe9e0f",
"deprecated": false,
"signature_version": "v1",
"signature_type": "Function",
"target": {
"file": "drivers/i2c/busses/i2c-stm32f7.c",
"function": "stm32f7_i2c_runtime_resume"
},
"digest": {
"function_hash": "195282318038723583189755666431361221337",
"length": 249.0
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@22a1f8a5b56ba93d3e8b7a1dafa24e01c8bb48ba"
},
{
"id": "CVE-2024-49985-876aa5bb",
"deprecated": false,
"signature_version": "v1",
"signature_type": "Line",
"target": {
"file": "drivers/i2c/busses/i2c-stm32f7.c"
},
"digest": {
"line_hashes": [
"329473493114416341984072711378249224287",
"298939336391894660366298830761331701606",
"156579986743760844087149235515360924423",
"71893335007056305341517979320163354942",
"120378822762836527518143065399655289214",
"10722035645117517223634426057248238517",
"134990244841756995251451607050448894456",
"64396529888882130625985904375020298777",
"140088653837382974598383112703699676887",
"64226591006069578799659783888767355291"
],
"threshold": 0.9
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@fac3c9f7784e8184c0338e9f0877b81e55d3ef1c"
},
{
"id": "CVE-2024-49985-8ef024e3",
"deprecated": false,
"signature_version": "v1",
"signature_type": "Line",
"target": {
"file": "drivers/i2c/busses/i2c-stm32f7.c"
},
"digest": {
"line_hashes": [
"329473493114416341984072711378249224287",
"298939336391894660366298830761331701606",
"156579986743760844087149235515360924423",
"71893335007056305341517979320163354942",
"120378822762836527518143065399655289214",
"10722035645117517223634426057248238517",
"134990244841756995251451607050448894456",
"64396529888882130625985904375020298777",
"140088653837382974598383112703699676887",
"64226591006069578799659783888767355291"
],
"threshold": 0.9
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@9b8bc33ad64192f54142396470cc34ce539a8940"
},
{
"id": "CVE-2024-49985-bef16b23",
"deprecated": false,
"signature_version": "v1",
"signature_type": "Function",
"target": {
"file": "drivers/i2c/busses/i2c-stm32f7.c",
"function": "stm32f7_i2c_runtime_resume"
},
"digest": {
"function_hash": "195282318038723583189755666431361221337",
"length": 249.0
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@048bbbdbf85e5e00258dfb12f5e368f908801d7b"
},
{
"id": "CVE-2024-49985-cbc72052",
"deprecated": false,
"signature_version": "v1",
"signature_type": "Function",
"target": {
"file": "drivers/i2c/busses/i2c-stm32f7.c",
"function": "stm32f7_i2c_runtime_resume"
},
"digest": {
"function_hash": "195282318038723583189755666431361221337",
"length": 249.0
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@c2024b1a583ab9176c797ea1e5f57baf8d5e2682"
},
{
"id": "CVE-2024-49985-d355a372",
"deprecated": false,
"signature_version": "v1",
"signature_type": "Function",
"target": {
"file": "drivers/i2c/busses/i2c-stm32f7.c",
"function": "stm32f7_i2c_runtime_resume"
},
"digest": {
"function_hash": "195282318038723583189755666431361221337",
"length": 249.0
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@9b8bc33ad64192f54142396470cc34ce539a8940"
},
{
"id": "CVE-2024-49985-d9e0a29a",
"deprecated": false,
"signature_version": "v1",
"signature_type": "Line",
"target": {
"file": "drivers/i2c/busses/i2c-stm32f7.c"
},
"digest": {
"line_hashes": [
"329473493114416341984072711378249224287",
"298939336391894660366298830761331701606",
"156579986743760844087149235515360924423",
"71893335007056305341517979320163354942",
"120378822762836527518143065399655289214",
"10722035645117517223634426057248238517",
"134990244841756995251451607050448894456",
"64396529888882130625985904375020298777",
"140088653837382974598383112703699676887",
"64226591006069578799659783888767355291"
],
"threshold": 0.9
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@c2024b1a583ab9176c797ea1e5f57baf8d5e2682"
},
{
"id": "CVE-2024-49985-e132d541",
"deprecated": false,
"signature_version": "v1",
"signature_type": "Function",
"target": {
"file": "drivers/i2c/busses/i2c-stm32f7.c",
"function": "stm32f7_i2c_runtime_resume"
},
"digest": {
"function_hash": "195282318038723583189755666431361221337",
"length": 249.0
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@fac3c9f7784e8184c0338e9f0877b81e55d3ef1c"
},
{
"id": "CVE-2024-49985-f61b9193",
"deprecated": false,
"signature_version": "v1",
"signature_type": "Line",
"target": {
"file": "drivers/i2c/busses/i2c-stm32f7.c"
},
"digest": {
"line_hashes": [
"329473493114416341984072711378249224287",
"298939336391894660366298830761331701606",
"156579986743760844087149235515360924423",
"71893335007056305341517979320163354942",
"120378822762836527518143065399655289214",
"10722035645117517223634426057248238517",
"134990244841756995251451607050448894456",
"64396529888882130625985904375020298777",
"140088653837382974598383112703699676887",
"64226591006069578799659783888767355291"
],
"threshold": 0.9
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@894cd5f5fd9061983445bbd1fa3d81be43095344"
}
]