In the Linux kernel, the following vulnerability has been resolved:
net: atlantic: fix aq_vec index out of range error
The final update statement of the for loop exceeds the array range, the dereference of self->aq_vec[i] is not checked and then leads to the index out of range error. Also fixed this kind of coding style in other for loop.
[ 97.937604] UBSAN: array-index-out-of-bounds in drivers/net/ethernet/aquantia/atlantic/aqnic.c:1404:48 [ 97.937607] index 8 is out of range for type 'aqvecs *[8]' [ 97.937608] CPU: 38 PID: 3767 Comm: kworker/u256:18 Not tainted 5.19.0+ #2 [ 97.937610] Hardware name: Dell Inc. Precision 7865 Tower/, BIOS 1.0.0 06/12/2022 [ 97.937611] Workqueue: eventsunbound asyncrunentryfn [ 97.937616] Call Trace: [ 97.937617] <TASK> [ 97.937619] dumpstacklvl+0x49/0x63 [ 97.937624] dumpstack+0x10/0x16 [ 97.937626] ubsanepilogue+0x9/0x3f [ 97.937627] _ubsanhandleoutofbounds.cold+0x44/0x49 [ 97.937629] ? _scmsend+0x348/0x440 [ 97.937632] ? aqvecstop+0x72/0x80 [atlantic] [ 97.937639] aqnicstop+0x1b6/0x1c0 [atlantic] [ 97.937644] aqsuspendcommon+0x88/0x90 [atlantic] [ 97.937648] aqpmsuspendpoweroff+0xe/0x20 [atlantic] [ 97.937653] pcipmsuspend+0x7e/0x1a0 [ 97.937655] ? pcipmsuspendnoirq+0x2b0/0x2b0 [ 97.937657] dpmruncallback+0x54/0x190 [ 97.937660] _devicesuspend+0x14c/0x4d0 [ 97.937661] asyncsuspend+0x23/0x70 [ 97.937663] asyncrunentryfn+0x33/0x120 [ 97.937664] processonework+0x21f/0x3f0 [ 97.937666] workerthread+0x4a/0x3c0 [ 97.937668] ? processonework+0x3f0/0x3f0 [ 97.937669] kthread+0xf0/0x120 [ 97.937671] ? kthreadcompleteandexit+0x20/0x20 [ 97.937672] retfromfork+0x22/0x30 [ 97.937676] </TASK>
v2. fixed "warning: variable 'aq_vec' set but not used"
v3. simplified a for loop
[
{
"signature_type": "Function",
"signature_version": "v1",
"target": {
"function": "aq_nic_get_stats",
"file": "drivers/net/ethernet/aquantia/atlantic/aq_nic.c"
},
"digest": {
"function_hash": "114817476562794275582163536492997849138",
"length": 1703.0
},
"deprecated": false,
"id": "CVE-2022-50066-0332210f",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@422a02a771599cac96f2b2900d993e0bb7ba5b88"
},
{
"signature_type": "Function",
"signature_version": "v1",
"target": {
"function": "aq_nic_get_stats",
"file": "drivers/net/ethernet/aquantia/atlantic/aq_nic.c"
},
"digest": {
"function_hash": "114817476562794275582163536492997849138",
"length": 1703.0
},
"deprecated": false,
"id": "CVE-2022-50066-164a08b6",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@2ba5e47fb75fbb8fab45f5c1bc8d5c33d8834bd3"
},
{
"signature_type": "Function",
"signature_version": "v1",
"target": {
"function": "aq_nic_stop",
"file": "drivers/net/ethernet/aquantia/atlantic/aq_nic.c"
},
"digest": {
"function_hash": "333345594301597148313596574467363889894",
"length": 628.0
},
"deprecated": false,
"id": "CVE-2022-50066-1f77faf0",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@df60c534d4c5a681172952dd4b475a5d818b3a86"
},
{
"signature_type": "Line",
"signature_version": "v1",
"target": {
"file": "drivers/net/ethernet/aquantia/atlantic/aq_nic.c"
},
"digest": {
"threshold": 0.9,
"line_hashes": [
"285271666496257933942271330442856003579",
"259057240212623259130570433392065871863",
"262696106860547746029131508266867419075",
"197900993757606096115810819856529854426",
"100238438187851499915580463313119438507",
"258898149829240688110768273279539101889",
"81830135407488744304550938574687437416",
"268282724800614435125938680481464600107",
"87918741810498575094612290164366276445",
"35425893287441509304894507841929490393",
"305993357333535760682830976233277051117",
"186174037275406896474229143380908236899",
"210272619171526806740409294484865974176",
"33237342919066210137371995975688142018",
"134110718287163820101509685597715021032",
"166119650286489271902165751630043941063",
"246049637818891649960602958279985264287",
"128899357673867225779043737137390925823",
"181085455023217451580507384510550401739",
"189386466653108715538712185385355594288",
"299906925718273087481424977319696989198",
"36367745584872498039445674991129123464",
"121644895392147734023279204106378555065",
"267018166459625314725397028343238822681",
"276547927281520497705394993887390906513",
"16233905389338616244188248724886712023",
"135471538857478787398868828167893658383",
"125352566116205279352612994583280435015",
"31848506061426421908269236177144565626",
"322493564272116211951513255209923915557"
]
},
"deprecated": false,
"id": "CVE-2022-50066-362d4f6a",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@23bf155476539354ab5c8cc9bb460fd1209b39b5"
},
{
"signature_type": "Function",
"signature_version": "v1",
"target": {
"function": "aq_nic_stop",
"file": "drivers/net/ethernet/aquantia/atlantic/aq_nic.c"
},
"digest": {
"function_hash": "333345594301597148313596574467363889894",
"length": 628.0
},
"deprecated": false,
"id": "CVE-2022-50066-3aad33d9",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@422a02a771599cac96f2b2900d993e0bb7ba5b88"
},
{
"signature_type": "Function",
"signature_version": "v1",
"target": {
"function": "aq_nic_stop",
"file": "drivers/net/ethernet/aquantia/atlantic/aq_nic.c"
},
"digest": {
"function_hash": "333345594301597148313596574467363889894",
"length": 628.0
},
"deprecated": false,
"id": "CVE-2022-50066-3eaed4f2",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@2ba5e47fb75fbb8fab45f5c1bc8d5c33d8834bd3"
},
{
"signature_type": "Function",
"signature_version": "v1",
"target": {
"function": "aq_nic_stop",
"file": "drivers/net/ethernet/aquantia/atlantic/aq_nic.c"
},
"digest": {
"function_hash": "333345594301597148313596574467363889894",
"length": 628.0
},
"deprecated": false,
"id": "CVE-2022-50066-6e359aed",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@23bf155476539354ab5c8cc9bb460fd1209b39b5"
},
{
"signature_type": "Function",
"signature_version": "v1",
"target": {
"function": "aq_nic_polling_timer_cb",
"file": "drivers/net/ethernet/aquantia/atlantic/aq_nic.c"
},
"digest": {
"function_hash": "169834453063332031615708346275215545694",
"length": 365.0
},
"deprecated": false,
"id": "CVE-2022-50066-835164c5",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@df60c534d4c5a681172952dd4b475a5d818b3a86"
},
{
"signature_type": "Function",
"signature_version": "v1",
"target": {
"function": "aq_nic_polling_timer_cb",
"file": "drivers/net/ethernet/aquantia/atlantic/aq_nic.c"
},
"digest": {
"function_hash": "169834453063332031615708346275215545694",
"length": 365.0
},
"deprecated": false,
"id": "CVE-2022-50066-93c964d6",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@23bf155476539354ab5c8cc9bb460fd1209b39b5"
},
{
"signature_type": "Function",
"signature_version": "v1",
"target": {
"function": "aq_nic_get_stats",
"file": "drivers/net/ethernet/aquantia/atlantic/aq_nic.c"
},
"digest": {
"function_hash": "114817476562794275582163536492997849138",
"length": 1703.0
},
"deprecated": false,
"id": "CVE-2022-50066-9679daee",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@23bf155476539354ab5c8cc9bb460fd1209b39b5"
},
{
"signature_type": "Function",
"signature_version": "v1",
"target": {
"function": "aq_nic_polling_timer_cb",
"file": "drivers/net/ethernet/aquantia/atlantic/aq_nic.c"
},
"digest": {
"function_hash": "169834453063332031615708346275215545694",
"length": 365.0
},
"deprecated": false,
"id": "CVE-2022-50066-bbe5c413",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@422a02a771599cac96f2b2900d993e0bb7ba5b88"
},
{
"signature_type": "Line",
"signature_version": "v1",
"target": {
"file": "drivers/net/ethernet/aquantia/atlantic/aq_nic.c"
},
"digest": {
"threshold": 0.9,
"line_hashes": [
"285271666496257933942271330442856003579",
"259057240212623259130570433392065871863",
"262696106860547746029131508266867419075",
"197900993757606096115810819856529854426",
"100238438187851499915580463313119438507",
"258898149829240688110768273279539101889",
"81830135407488744304550938574687437416",
"268282724800614435125938680481464600107",
"87918741810498575094612290164366276445",
"35425893287441509304894507841929490393",
"305993357333535760682830976233277051117",
"186174037275406896474229143380908236899",
"210272619171526806740409294484865974176",
"33237342919066210137371995975688142018",
"134110718287163820101509685597715021032",
"166119650286489271902165751630043941063",
"246049637818891649960602958279985264287",
"128899357673867225779043737137390925823",
"181085455023217451580507384510550401739",
"189386466653108715538712185385355594288",
"299906925718273087481424977319696989198",
"36367745584872498039445674991129123464",
"121644895392147734023279204106378555065",
"267018166459625314725397028343238822681",
"276547927281520497705394993887390906513",
"16233905389338616244188248724886712023",
"135471538857478787398868828167893658383",
"125352566116205279352612994583280435015",
"31848506061426421908269236177144565626",
"322493564272116211951513255209923915557"
]
},
"deprecated": false,
"id": "CVE-2022-50066-bf60d3ac",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@2ba5e47fb75fbb8fab45f5c1bc8d5c33d8834bd3"
},
{
"signature_type": "Function",
"signature_version": "v1",
"target": {
"function": "aq_nic_get_stats",
"file": "drivers/net/ethernet/aquantia/atlantic/aq_nic.c"
},
"digest": {
"function_hash": "114817476562794275582163536492997849138",
"length": 1703.0
},
"deprecated": false,
"id": "CVE-2022-50066-c341fc66",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@df60c534d4c5a681172952dd4b475a5d818b3a86"
},
{
"signature_type": "Function",
"signature_version": "v1",
"target": {
"function": "aq_nic_polling_timer_cb",
"file": "drivers/net/ethernet/aquantia/atlantic/aq_nic.c"
},
"digest": {
"function_hash": "169834453063332031615708346275215545694",
"length": 365.0
},
"deprecated": false,
"id": "CVE-2022-50066-ddec4e11",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@2ba5e47fb75fbb8fab45f5c1bc8d5c33d8834bd3"
},
{
"signature_type": "Line",
"signature_version": "v1",
"target": {
"file": "drivers/net/ethernet/aquantia/atlantic/aq_nic.c"
},
"digest": {
"threshold": 0.9,
"line_hashes": [
"285271666496257933942271330442856003579",
"259057240212623259130570433392065871863",
"262696106860547746029131508266867419075",
"197900993757606096115810819856529854426",
"100238438187851499915580463313119438507",
"258898149829240688110768273279539101889",
"81830135407488744304550938574687437416",
"268282724800614435125938680481464600107",
"87918741810498575094612290164366276445",
"35425893287441509304894507841929490393",
"305993357333535760682830976233277051117",
"186174037275406896474229143380908236899",
"210272619171526806740409294484865974176",
"33237342919066210137371995975688142018",
"134110718287163820101509685597715021032",
"166119650286489271902165751630043941063",
"246049637818891649960602958279985264287",
"128899357673867225779043737137390925823",
"181085455023217451580507384510550401739",
"189386466653108715538712185385355594288",
"299906925718273087481424977319696989198",
"36367745584872498039445674991129123464",
"121644895392147734023279204106378555065",
"267018166459625314725397028343238822681",
"276547927281520497705394993887390906513",
"16233905389338616244188248724886712023",
"135471538857478787398868828167893658383",
"125352566116205279352612994583280435015",
"31848506061426421908269236177144565626",
"322493564272116211951513255209923915557"
]
},
"deprecated": false,
"id": "CVE-2022-50066-e51b273a",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@422a02a771599cac96f2b2900d993e0bb7ba5b88"
},
{
"signature_type": "Line",
"signature_version": "v1",
"target": {
"file": "drivers/net/ethernet/aquantia/atlantic/aq_nic.c"
},
"digest": {
"threshold": 0.9,
"line_hashes": [
"285271666496257933942271330442856003579",
"259057240212623259130570433392065871863",
"262696106860547746029131508266867419075",
"197900993757606096115810819856529854426",
"100238438187851499915580463313119438507",
"258898149829240688110768273279539101889",
"81830135407488744304550938574687437416",
"268282724800614435125938680481464600107",
"87918741810498575094612290164366276445",
"35425893287441509304894507841929490393",
"305993357333535760682830976233277051117",
"186174037275406896474229143380908236899",
"210272619171526806740409294484865974176",
"33237342919066210137371995975688142018",
"134110718287163820101509685597715021032",
"166119650286489271902165751630043941063",
"246049637818891649960602958279985264287",
"128899357673867225779043737137390925823",
"181085455023217451580507384510550401739",
"189386466653108715538712185385355594288",
"299906925718273087481424977319696989198",
"36367745584872498039445674991129123464",
"121644895392147734023279204106378555065",
"267018166459625314725397028343238822681",
"276547927281520497705394993887390906513",
"16233905389338616244188248724886712023",
"135471538857478787398868828167893658383",
"125352566116205279352612994583280435015",
"31848506061426421908269236177144565626",
"322493564272116211951513255209923915557"
]
},
"deprecated": false,
"id": "CVE-2022-50066-f39de008",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@df60c534d4c5a681172952dd4b475a5d818b3a86"
}
]