In the Linux kernel, the following vulnerability has been resolved:
i2c: core: Run atomic i2c xfer when !preemptible
Since bae1d3a05a8b, i2c transfers are non-atomic if preemption is disabled. However, non-atomic i2c transfers require preemption (e.g. in waitforcompletion() while waiting for the DMA).
panic() calls preemptdisablenotrace() before calling emergency_restart(). Therefore, if an i2c device is used for the restart, the xfer should be atomic. This avoids warnings like:
[ 12.667612] WARNING: CPU: 1 PID: 1 at kernel/rcu/treeplugin.h:318 rcunotecontextswitch+0x33c/0x6b0 [ 12.676926] Voluntary context switch within RCU read-side critical section! ... [ 12.742376] scheduletimeout from waitforcompletiontimeout+0x90/0x114 [ 12.749179] waitforcompletiontimeout from tegrai2cwaitcompletion+0x40/0x70 ... [ 12.994527] atomicnotifiercallchain from machinerestart+0x34/0x58 [ 13.001050] machine_restart from panic+0x2a8/0x32c
Use !preemptible() instead, which is basically the same check as pre-v5.2.
[
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@8c3fa52a46ff4d208cefb1a462ec94e0043a91e1",
"signature_version": "v1",
"deprecated": false,
"id": "CVE-2023-52791-1ed80047",
"target": {
"function": "i2c_in_atomic_xfer_mode",
"file": "drivers/i2c/i2c-core.h"
},
"digest": {
"length": 97.0,
"function_hash": "31663674888450723209597774771041823608"
},
"signature_type": "Function"
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@3473cf43b9068b9dfef2f545f833f33c6a544b91",
"signature_version": "v1",
"deprecated": false,
"id": "CVE-2023-52791-2b477771",
"target": {
"file": "drivers/i2c/i2c-core.h"
},
"digest": {
"threshold": 0.9,
"line_hashes": [
"21460648286803359911626766831417632249",
"83841939135483905296057820051774719991",
"326328558075148422769450697713224292341",
"330804709867701753055901937761359387624"
]
},
"signature_type": "Line"
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@185f3617adc8fe45e40489b458f03911f0dec46c",
"signature_version": "v1",
"deprecated": false,
"id": "CVE-2023-52791-3f944b37",
"target": {
"function": "i2c_in_atomic_xfer_mode",
"file": "drivers/i2c/i2c-core.h"
},
"digest": {
"length": 97.0,
"function_hash": "31663674888450723209597774771041823608"
},
"signature_type": "Function"
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@3473cf43b9068b9dfef2f545f833f33c6a544b91",
"signature_version": "v1",
"deprecated": false,
"id": "CVE-2023-52791-4dcf0985",
"target": {
"function": "i2c_in_atomic_xfer_mode",
"file": "drivers/i2c/i2c-core.h"
},
"digest": {
"length": 97.0,
"function_hash": "31663674888450723209597774771041823608"
},
"signature_type": "Function"
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@25eb381a736e7ae39a4245ef5c96484eb1073809",
"signature_version": "v1",
"deprecated": false,
"id": "CVE-2023-52791-75ec302f",
"target": {
"file": "drivers/i2c/i2c-core.h"
},
"digest": {
"threshold": 0.9,
"line_hashes": [
"21460648286803359911626766831417632249",
"83841939135483905296057820051774719991",
"326328558075148422769450697713224292341",
"330804709867701753055901937761359387624"
]
},
"signature_type": "Line"
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@f6237afabc349c1c7909db00e15d2816519e0d2b",
"signature_version": "v1",
"deprecated": false,
"id": "CVE-2023-52791-8222dfe3",
"target": {
"function": "i2c_in_atomic_xfer_mode",
"file": "drivers/i2c/i2c-core.h"
},
"digest": {
"length": 97.0,
"function_hash": "31663674888450723209597774771041823608"
},
"signature_type": "Function"
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@185f3617adc8fe45e40489b458f03911f0dec46c",
"signature_version": "v1",
"deprecated": false,
"id": "CVE-2023-52791-a3bce5a2",
"target": {
"file": "drivers/i2c/i2c-core.h"
},
"digest": {
"threshold": 0.9,
"line_hashes": [
"21460648286803359911626766831417632249",
"83841939135483905296057820051774719991",
"326328558075148422769450697713224292341",
"330804709867701753055901937761359387624"
]
},
"signature_type": "Line"
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@aa49c90894d06e18a1ee7c095edbd2f37c232d02",
"signature_version": "v1",
"deprecated": false,
"id": "CVE-2023-52791-af58ca02",
"target": {
"function": "i2c_in_atomic_xfer_mode",
"file": "drivers/i2c/i2c-core.h"
},
"digest": {
"length": 97.0,
"function_hash": "31663674888450723209597774771041823608"
},
"signature_type": "Function"
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@f6237afabc349c1c7909db00e15d2816519e0d2b",
"signature_version": "v1",
"deprecated": false,
"id": "CVE-2023-52791-b4337115",
"target": {
"file": "drivers/i2c/i2c-core.h"
},
"digest": {
"threshold": 0.9,
"line_hashes": [
"21460648286803359911626766831417632249",
"83841939135483905296057820051774719991",
"326328558075148422769450697713224292341",
"330804709867701753055901937761359387624"
]
},
"signature_type": "Line"
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@aa49c90894d06e18a1ee7c095edbd2f37c232d02",
"signature_version": "v1",
"deprecated": false,
"id": "CVE-2023-52791-c713a3ba",
"target": {
"file": "drivers/i2c/i2c-core.h"
},
"digest": {
"threshold": 0.9,
"line_hashes": [
"21460648286803359911626766831417632249",
"83841939135483905296057820051774719991",
"326328558075148422769450697713224292341",
"330804709867701753055901937761359387624"
]
},
"signature_type": "Line"
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@8c3fa52a46ff4d208cefb1a462ec94e0043a91e1",
"signature_version": "v1",
"deprecated": false,
"id": "CVE-2023-52791-c8d7f540",
"target": {
"file": "drivers/i2c/i2c-core.h"
},
"digest": {
"threshold": 0.9,
"line_hashes": [
"21460648286803359911626766831417632249",
"83841939135483905296057820051774719991",
"326328558075148422769450697713224292341",
"330804709867701753055901937761359387624"
]
},
"signature_type": "Line"
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@25eb381a736e7ae39a4245ef5c96484eb1073809",
"signature_version": "v1",
"deprecated": false,
"id": "CVE-2023-52791-d326fdbf",
"target": {
"function": "i2c_in_atomic_xfer_mode",
"file": "drivers/i2c/i2c-core.h"
},
"digest": {
"length": 97.0,
"function_hash": "31663674888450723209597774771041823608"
},
"signature_type": "Function"
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@25284c46b657f48c0f3880a2e0706c70d81182c0",
"signature_version": "v1",
"deprecated": false,
"id": "CVE-2023-52791-e85dc3c0",
"target": {
"file": "drivers/i2c/i2c-core.h"
},
"digest": {
"threshold": 0.9,
"line_hashes": [
"21460648286803359911626766831417632249",
"83841939135483905296057820051774719991",
"326328558075148422769450697713224292341",
"330804709867701753055901937761359387624"
]
},
"signature_type": "Line"
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@25284c46b657f48c0f3880a2e0706c70d81182c0",
"signature_version": "v1",
"deprecated": false,
"id": "CVE-2023-52791-f18cc42a",
"target": {
"function": "i2c_in_atomic_xfer_mode",
"file": "drivers/i2c/i2c-core.h"
},
"digest": {
"length": 97.0,
"function_hash": "31663674888450723209597774771041823608"
},
"signature_type": "Function"
}
]