In the Linux kernel, the following vulnerability has been resolved:
wifi: iwlwifi: mvm: Fix a memory corruption issue
A few lines above, space is kzalloc()'ed for: sizeof(struct iwlnvmdata) + sizeof(struct ieee80211channel) + sizeof(struct ieee80211rate)
'mvm->nvmdata' is a 'struct iwlnvm_data', so it is fine.
At the end of this structure, there is the 'channels' flex array. Each element is of type 'struct ieee80211_channel'. So only 1 element is allocated in this array.
When doing: mvm->nvmdata->bands[0].channels = mvm->nvmdata->channels; We point at the first element of the 'channels' flex array. So this is fine.
However, when doing: mvm->nvmdata->bands[0].bitrates = (void *)((u8 *)mvm->nvmdata->channels + 1); because of the "(u8 *)" cast, we add only 1 to the address of the beginning of the flex array.
It is likely that we want point at the 'struct ieee80211_rate' allocated just after.
Remove the spurious casting so that the pointer arithmetic works as expected.
[
{
"signature_type": "Function",
"digest": {
"function_hash": "220564749763964178439385184495769103228",
"length": 2513.0
},
"target": {
"file": "drivers/net/wireless/intel/iwlwifi/mvm/fw.c",
"function": "iwl_run_init_mvm_ucode"
},
"signature_version": "v1",
"id": "CVE-2023-52531-0124f1a5",
"deprecated": false,
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@7c8faa31080342aec4903c9acb20caf82fcca1ef"
},
{
"signature_type": "Line",
"digest": {
"threshold": 0.9,
"line_hashes": [
"306802612460921039217630756723816487417",
"238492194518333962249134797602854353710",
"257415161375341900845654612022072383447",
"35341635930149660604975135688422129475"
]
},
"target": {
"file": "drivers/net/wireless/intel/iwlwifi/mvm/fw.c"
},
"signature_version": "v1",
"id": "CVE-2023-52531-52d20632",
"deprecated": false,
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@7c8faa31080342aec4903c9acb20caf82fcca1ef"
},
{
"signature_type": "Function",
"digest": {
"function_hash": "220564749763964178439385184495769103228",
"length": 2513.0
},
"target": {
"file": "drivers/net/wireless/intel/iwlwifi/mvm/fw.c",
"function": "iwl_run_init_mvm_ucode"
},
"signature_version": "v1",
"id": "CVE-2023-52531-a046b9b0",
"deprecated": false,
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@6b3223449c959a8be94a1f042288059e40fcccb0"
},
{
"signature_type": "Function",
"digest": {
"function_hash": "220564749763964178439385184495769103228",
"length": 2513.0
},
"target": {
"file": "drivers/net/wireless/intel/iwlwifi/mvm/fw.c",
"function": "iwl_run_init_mvm_ucode"
},
"signature_version": "v1",
"id": "CVE-2023-52531-a8499380",
"deprecated": false,
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@8ba438ef3cacc4808a63ed0ce24d4f0942cfe55d"
},
{
"signature_type": "Line",
"digest": {
"threshold": 0.9,
"line_hashes": [
"306802612460921039217630756723816487417",
"238492194518333962249134797602854353710",
"257415161375341900845654612022072383447",
"35341635930149660604975135688422129475"
]
},
"target": {
"file": "drivers/net/wireless/intel/iwlwifi/mvm/fw.c"
},
"signature_version": "v1",
"id": "CVE-2023-52531-a9a4b340",
"deprecated": false,
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@8ba438ef3cacc4808a63ed0ce24d4f0942cfe55d"
},
{
"signature_type": "Line",
"digest": {
"threshold": 0.9,
"line_hashes": [
"306802612460921039217630756723816487417",
"238492194518333962249134797602854353710",
"257415161375341900845654612022072383447",
"35341635930149660604975135688422129475"
]
},
"target": {
"file": "drivers/net/wireless/intel/iwlwifi/mvm/fw.c"
},
"signature_version": "v1",
"id": "CVE-2023-52531-ccf74a0e",
"deprecated": false,
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@6b3223449c959a8be94a1f042288059e40fcccb0"
},
{
"signature_type": "Line",
"digest": {
"threshold": 0.9,
"line_hashes": [
"306802612460921039217630756723816487417",
"238492194518333962249134797602854353710",
"257415161375341900845654612022072383447",
"35341635930149660604975135688422129475"
]
},
"target": {
"file": "drivers/net/wireless/intel/iwlwifi/mvm/fw.c"
},
"signature_version": "v1",
"id": "CVE-2023-52531-de985fb1",
"deprecated": false,
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@f06cdd8d4ba5252986f51f80cc30263636397128"
},
{
"signature_type": "Function",
"digest": {
"function_hash": "220564749763964178439385184495769103228",
"length": 2513.0
},
"target": {
"file": "drivers/net/wireless/intel/iwlwifi/mvm/fw.c",
"function": "iwl_run_init_mvm_ucode"
},
"signature_version": "v1",
"id": "CVE-2023-52531-fd1b35f0",
"deprecated": false,
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@f06cdd8d4ba5252986f51f80cc30263636397128"
}
]