漏洞标题
无线网络:iwlwifi:mvm:修复一个内存腐败问题。
漏洞描述信息
在Linux内核中,已经修复了以下漏洞:
```
wifi: iwlwifi: mvm: Fix a memory corruption issue
```
在这段代码的几行上方,空间是通过`kzalloc()`分配给:
```c
sizeof(struct iwl_nvm_data) +
sizeof(struct ieee80211_channel) +
sizeof(struct ieee80211_rate)
```
`mvm->nvm_data`是一个`struct iwl_nvm_data`类型的结构,所以这里没问题。
在这个结构的末尾,有一个名为`channels`的可变长度数组(flex array)。
每个元素都是类型为`struct ieee80211_channel`的结构。因此,在这个数组中只分配了一个元素的空间。
在执行以下代码时:
```c
mvm->nvm_data->bands[0].channels = mvm->nvm_data->channels;
```
我们指向了`channels`可变长度数组的第一个元素。所以这里没问题。
然而,在执行以下代码时:
```c
mvm->nvm_data->bands[0].bitrates =
(void *)((u8 *)mvm->nvm_data->channels + 1));
```
因为 `(u8 *)` 转换,我们只向数组开始的地址加了1。
很可能,我们想要指向紧接着分配的`struct ieee80211_rate`结构。
要解决这个问题,需要删除多余的转换,使指针运算按预期工作。
CVSS信息
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:H
漏洞类别
跨界内存写
漏洞标题
wifi: iwlwifi: mvm: Fix a memory corruption issue
漏洞描述信息
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.
CVSS信息
N/A
漏洞类别
N/A
漏洞标题
Linux kernel 安全漏洞
漏洞描述信息
Linux kernel是美国Linux基金会的开源操作系统Linux所使用的内核。 Linux kernel存在安全漏洞,该漏洞源于存在内存损坏问题。
CVSS信息
N/A
漏洞类别
其他