diff options
| author | Kees Cook <[email protected]> | 2021-06-17 17:15:22 +0000 |
|---|---|---|
| committer | Kalle Valo <[email protected]> | 2021-06-22 15:24:50 +0000 |
| commit | 59c668d700be72bdf76932f5a7db0af947ee0539 (patch) | |
| tree | bb8ec24736e54be97336efb3f1e4c38e0fb9620c /net/switchdev/switchdev.c | |
| parent | rtlwifi: rtl8192de: Fully initialize curvecount_val (diff) | |
| download | kernel-59c668d700be72bdf76932f5a7db0af947ee0539.tar.gz kernel-59c668d700be72bdf76932f5a7db0af947ee0539.zip | |
mwifiex: Avoid memset() over-write of WEP key_material
In preparation for FORTIFY_SOURCE performing compile-time and run-time
field bounds checking for memset(), avoid intentionally writing across
neighboring array fields.
When preparing to call mwifiex_set_keyparamset_wep(), key_material is
treated very differently from its structure layout (which has only a
single struct mwifiex_ie_type_key_param_set). Instead, add a new type to
the union so memset() can correctly reason about the size of the
structure.
Note that the union ("params", 196 bytes) containing key_material was
not large enough to hold the target of this memset(): sizeof(struct
mwifiex_ie_type_key_param_set) == 60, NUM_WEP_KEYS = 4, so 240
bytes, or 44 bytes past the end of "params". The good news is that
it appears that the command buffer, as allocated, is 2048 bytes
(MWIFIEX_SIZE_OF_CMD_BUFFER), so no neighboring memory appears to be
getting clobbered.
Signed-off-by: Kees Cook <[email protected]>
Reviewed-by: Brian Norris <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Diffstat (limited to 'net/switchdev/switchdev.c')
0 files changed, 0 insertions, 0 deletions
