In the Linux kernel, the following vulnerability has been resolved:
mlxsw: spectrum: Guard against invalid local ports
When processing events generated by the device's firmware, the driver protects itself from events reported for non-existent local ports, but not for the CPU port (local port 0), which exists, but does not have all the fields as any local port.
This can result in a NULL pointer dereference when trying access 'struct mlxswspport' fields which are not initialized for CPU port.
Commit 63b08b1f6834 ("mlxsw: spectrum: Protect driver from buggy firmware") already handled such issue by bailing early when processing a PUDE event reported for the CPU port.
Generalize the approach by moving the check to a common function and making use of it in all relevant places.
[
{
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@4cad27ba2e5a5843a7fab5aa30de2b8e8c3db3a8",
"deprecated": false,
"id": "CVE-2022-49134-05bdd577",
"signature_type": "Function",
"digest": {
"length": 599.0,
"function_hash": "7545833846689158538596133807654826021"
},
"target": {
"function": "mlxsw_sp_pude_event_func",
"file": "drivers/net/ethernet/mellanox/mlxsw/spectrum.c"
}
},
{
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@4cad27ba2e5a5843a7fab5aa30de2b8e8c3db3a8",
"deprecated": false,
"id": "CVE-2022-49134-112c61db",
"signature_type": "Function",
"digest": {
"length": 1327.0,
"function_hash": "207558388006782364475008455357520708720"
},
"target": {
"function": "mlxsw_sp_fdb_notify_mac_process",
"file": "drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c"
}
},
{
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@bcdfd615f83b4bd04678109bf18022d1476e4bbf",
"deprecated": false,
"id": "CVE-2022-49134-16324d2c",
"signature_type": "Function",
"digest": {
"length": 606.0,
"function_hash": "243496129119967346594198980250852305263"
},
"target": {
"function": "mlxsw_sp1_ptp_got_timestamp",
"file": "drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c"
}
},
{
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@bcdfd615f83b4bd04678109bf18022d1476e4bbf",
"deprecated": false,
"id": "CVE-2022-49134-20b92d19",
"signature_type": "Function",
"digest": {
"length": 599.0,
"function_hash": "7545833846689158538596133807654826021"
},
"target": {
"function": "mlxsw_sp_pude_event_func",
"file": "drivers/net/ethernet/mellanox/mlxsw/spectrum.c"
}
},
{
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@bcdfd615f83b4bd04678109bf18022d1476e4bbf",
"deprecated": false,
"id": "CVE-2022-49134-314451d0",
"signature_type": "Line",
"digest": {
"threshold": 0.9,
"line_hashes": [
"327051488013277705082273000784866796202",
"89375943220233722992252791701281854087",
"230010650447837090077195781425135752393",
"35066617467664606380863202859221795398",
"89164497611495474225680510277108282366",
"332296292692952844741238437322830725816",
"94087699895748840873293456888210456791",
"64445417612741508399193517416577971699"
]
},
"target": {
"file": "drivers/net/ethernet/mellanox/mlxsw/spectrum.c"
}
},
{
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@4cad27ba2e5a5843a7fab5aa30de2b8e8c3db3a8",
"deprecated": false,
"id": "CVE-2022-49134-39599ba6",
"signature_type": "Function",
"digest": {
"length": 606.0,
"function_hash": "243496129119967346594198980250852305263"
},
"target": {
"function": "mlxsw_sp1_ptp_got_timestamp",
"file": "drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c"
}
},
{
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@bcdfd615f83b4bd04678109bf18022d1476e4bbf",
"deprecated": false,
"id": "CVE-2022-49134-4de2b932",
"signature_type": "Line",
"digest": {
"threshold": 0.9,
"line_hashes": [
"227532353610971077145175281769811873830",
"87283010360188934665869169904421525672",
"186787851342262448022893564488052664468",
"288877115610081063366395543432958606836",
"116957221114617533821899800123005088153",
"25347534711727296066150014941704286242",
"110379464425269305478117182247352045228",
"134353815502811195360395463016505363108"
]
},
"target": {
"file": "drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c"
}
},
{
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@4cad27ba2e5a5843a7fab5aa30de2b8e8c3db3a8",
"deprecated": false,
"id": "CVE-2022-49134-6114dd0b",
"signature_type": "Line",
"digest": {
"threshold": 0.9,
"line_hashes": [
"99523203823368411311201593711916659956",
"229498193618087344744692836438114779587",
"53717573385078021959873719150254362788",
"61223343308454532161422648588855208334",
"164571552126595088268466859803239251556",
"308115998279277537066633186691749916285",
"253345738061101977139488777260225372964",
"36451409080638498428152252988085240574"
]
},
"target": {
"file": "drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c"
}
},
{
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@4cad27ba2e5a5843a7fab5aa30de2b8e8c3db3a8",
"deprecated": false,
"id": "CVE-2022-49134-82f726d3",
"signature_type": "Line",
"digest": {
"threshold": 0.9,
"line_hashes": [
"248271249655800611901729928994546397119",
"253095322547254888454120299496751504521",
"105189108993005570260853612702811816460",
"310854864234131059724644362911271246503"
]
},
"target": {
"file": "drivers/net/ethernet/mellanox/mlxsw/spectrum.h"
}
},
{
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@4cad27ba2e5a5843a7fab5aa30de2b8e8c3db3a8",
"deprecated": false,
"id": "CVE-2022-49134-903e8e4d",
"signature_type": "Line",
"digest": {
"threshold": 0.9,
"line_hashes": [
"227532353610971077145175281769811873830",
"87283010360188934665869169904421525672",
"186787851342262448022893564488052664468",
"288877115610081063366395543432958606836",
"116957221114617533821899800123005088153",
"25347534711727296066150014941704286242",
"110379464425269305478117182247352045228",
"134353815502811195360395463016505363108"
]
},
"target": {
"file": "drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c"
}
},
{
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@bcdfd615f83b4bd04678109bf18022d1476e4bbf",
"deprecated": false,
"id": "CVE-2022-49134-ae7115ff",
"signature_type": "Line",
"digest": {
"threshold": 0.9,
"line_hashes": [
"99523203823368411311201593711916659956",
"229498193618087344744692836438114779587",
"53717573385078021959873719150254362788",
"61223343308454532161422648588855208334",
"164571552126595088268466859803239251556",
"308115998279277537066633186691749916285",
"253345738061101977139488777260225372964",
"36451409080638498428152252988085240574"
]
},
"target": {
"file": "drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c"
}
},
{
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@bcdfd615f83b4bd04678109bf18022d1476e4bbf",
"deprecated": false,
"id": "CVE-2022-49134-b906b939",
"signature_type": "Function",
"digest": {
"length": 1327.0,
"function_hash": "207558388006782364475008455357520708720"
},
"target": {
"function": "mlxsw_sp_fdb_notify_mac_process",
"file": "drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c"
}
},
{
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@bcdfd615f83b4bd04678109bf18022d1476e4bbf",
"deprecated": false,
"id": "CVE-2022-49134-bbec36e9",
"signature_type": "Line",
"digest": {
"threshold": 0.9,
"line_hashes": [
"248271249655800611901729928994546397119",
"253095322547254888454120299496751504521",
"105189108993005570260853612702811816460",
"310854864234131059724644362911271246503"
]
},
"target": {
"file": "drivers/net/ethernet/mellanox/mlxsw/spectrum.h"
}
},
{
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@4cad27ba2e5a5843a7fab5aa30de2b8e8c3db3a8",
"deprecated": false,
"id": "CVE-2022-49134-e1b67e3c",
"signature_type": "Line",
"digest": {
"threshold": 0.9,
"line_hashes": [
"327051488013277705082273000784866796202",
"89375943220233722992252791701281854087",
"230010650447837090077195781425135752393",
"35066617467664606380863202859221795398",
"89164497611495474225680510277108282366",
"332296292692952844741238437322830725816",
"94087699895748840873293456888210456791",
"64445417612741508399193517416577971699"
]
},
"target": {
"file": "drivers/net/ethernet/mellanox/mlxsw/spectrum.c"
}
}
]