In the Linux kernel, the following vulnerability has been resolved:
mlxsw: spectrumacltcam: Fix NULL pointer dereference in error path
When calling mlxswspacltcamregion_destroy() from an error path after failing to attach the region to an ACL group, we hit a NULL pointer dereference upon 'region->group->tcam' [1].
Fix by retrieving the 'tcam' pointer using mlxswspacltotcam().
[1] BUG: kernel NULL pointer dereference, address: 0000000000000000 [...] RIP: 0010:mlxswspacltcamregiondestroy+0xa0/0xd0 [...] Call Trace: mlxswspacltcamvchunkget+0x88b/0xa20 mlxswspacltcamventryadd+0x25/0xe0 mlxswspaclruleadd+0x47/0x240 mlxswspflowerreplace+0x1a9/0x1d0 tcsetupcbadd+0xdc/0x1c0 flhwreplacefilter+0x146/0x1f0 flchange+0xc17/0x1360 tcnewtfilter+0x472/0xb90 rtnetlinkrcvmsg+0x313/0x3b0 netlinkrcvskb+0x58/0x100 netlinkunicast+0x244/0x390 netlinksendmsg+0x1e4/0x440 syssendmsg+0x164/0x260 syssendmsg+0x9a/0xe0 _syssendmsg+0x7a/0xc0 dosyscall64+0x40/0xe0 entrySYSCALL64afterhwframe+0x63/0x6b
[
{
"signature_type": "Function",
"digest": {
"function_hash": "104097629979135092274317188317871538573",
"length": 281.0
},
"target": {
"file": "drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c",
"function": "mlxsw_sp_acl_tcam_region_destroy"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@817840d125a370626895df269c50c923b79b0a39",
"id": "CVE-2024-26595-0862e49f",
"deprecated": false,
"signature_version": "v1"
},
{
"signature_type": "Line",
"digest": {
"threshold": 0.9,
"line_hashes": [
"948282901695979400109057717598778433",
"2176816689356933138583178309976026593",
"205949498010248468255645142528668180345",
"75088672559733697563139860707780620118",
"100230548128459456994477374670658440296",
"285178938922680014862994306082384521340",
"56892082230934400500719868511438764683",
"172917209542558552141520346525876674079",
"15552772683463728382351677523525868605",
"68914525265303577504020206844060142457"
]
},
"target": {
"file": "drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_tcam.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@817840d125a370626895df269c50c923b79b0a39",
"id": "CVE-2024-26595-5c9851d2",
"deprecated": false,
"signature_version": "v1"
}
]