CVE-2023-52531
JSON

7.8high

wifi: iwlwifi: mvm: Fix a memory corruption issue

Severity
7.8high CVSS:3.1 by NVD
Exploit likelihood
0.24% (higher than 15% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
Linux

Description

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 iwl_nvm_data) + sizeof(struct ieee80211_channel) + sizeof(struct ieee80211_rate) 'mvm->nvm_data' is a 'struct iwl_nvm_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->nvm_data->bands[0].channels = mvm->nvm_data->channels; We point at the first element of the 'channels' flex array. So this is fine. However, when doing: mvm->nvm_data->bands[0].bitrates = (void *)((u8 *)mvm->nvm_data->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.

Affected

Product or packageVersionsReported by
Linux Linuxfrom 8ca151b568b67a7b72dcfc6ee6ea7c107ddd795c before 7c8faa31080342aec4903c9acb20caf82fcca1ef, from 8ca151b568b67a7b72dcfc6ee6ea7c107ddd795c before 6b3223449c959a8be94a1f042288059e40fcccb0, from 8ca151b568b67a7b72dcfc6ee6ea7c107ddd795c before f06cdd8d4ba5252986f51f80cc30263636397128, from 8ca151b568b67a7b72dcfc6ee6ea7c107ddd795c before 8ba438ef3cacc4808a63ed0ce24d4f0942cfe55d, 3.9
Not affected: before 3.9, from 5.15.135 up to 5.15.*, from 6.1.57 up to 6.1.*, from 6.5.7 up to 6.5.*, from 6.6 up to *
CVE List
linux linux_kernelfrom 3.9 before 5.15.135, from 5.16 before 6.1.57, from 6.2 before 6.5.7, 6.6NVD

Classification

CWE-787

SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial.

What each source says

CVE List

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 iwl_nvm_data) + sizeof(struct ieee80211_channel) + sizeof(struct ieee80211_rate) 'mvm->nvm_data' is a 'struct iwl_nvm_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->nvm_data->bands[0].channels = mvm->nvm_data->channels; We point at the first element of the 'channels' flex array. So this is fine. However, when doing: mvm->nvm_data->bands[0].bitrates = (void *)((u8 *)mvm->nvm_data->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.

NVD (es)

En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: wifi: iwlwifi: mvm: soluciona un problema de corrupción de memoria Unas pocas líneas arriba, se kzalloc()'ed espacio para: sizeof(struct iwl_nvm_data) + sizeof(struct ieee80211_channel) + sizeof (struct ieee80211_rate) 'mvm->nvm_data' es una 'struct iwl_nvm_data', por lo que está bien. Al final de esta estructura, se encuentra la matriz flexible de 'canales'. Cada elemento es de tipo 'struct ieee80211_channel'. Entonces solo se asigna 1 elemento en esta matriz. Al hacer: mvm->nvm_data->bands[0].channels = mvm->nvm_data->channels; Apuntamos al primer elemento de la matriz flexible 'canales'. Entonces esto está bien. Sin embargo, al hacer: mvm->nvm_data->bands[0].bitrates = (void *)((u8 *)mvm->nvm_data->channels + 1); debido a la conversión "(u8 *)", agregamos solo 1 a la dirección del comienzo de la matriz flexible. Es probable que queramos apuntar a la 'estructura ieee80211_rate' asignada justo después. Retire la fundición espuria para que la aritmética del puntero funcione como se esperaba.

References

Sources

SourceRecordLicence
CVE ListCVE-2023-52531 changed 2026-05-11CVE Terms of Use
NVDCVE-2023-52531 changed 2026-06-17Public domain