mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-14 12:37:32 +00:00
staging: rtl8723bs: Avoid field-overflowing memcpy()
In preparation for FORTIFY_SOURCE performing compile-time and run-time field bounds checking for memcpy(), memmove(), and memset(), avoid intentionally writing across neighboring fields. Adjust memcpy() destination to be the named structure itself, rather than the first member, allowing memcpy() to correctly reason about the size. "objdump -d" shows no object code changes. Cc: Ross Schmidt <ross.schm.dev@gmail.com> Cc: Joe Perches <joe@perches.com> Cc: devel@driverdev.osuosl.org Signed-off-by: Kees Cook <keescook@chromium.org> Link: https://lore.kernel.org/r/20210806201422.2871679-1-keescook@chromium.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
1b3c6cccda
commit
859c57f606
1 changed files with 1 additions and 1 deletions
|
@ -2389,7 +2389,7 @@ unsigned int rtw_restructure_ht_ie(struct adapter *padapter, u8 *in_ie, u8 *out_
|
|||
}
|
||||
|
||||
/* fill default supported_mcs_set */
|
||||
memcpy(ht_capie.mcs.rx_mask, pmlmeext->default_supported_mcs_set, 16);
|
||||
memcpy(&ht_capie.mcs, pmlmeext->default_supported_mcs_set, 16);
|
||||
|
||||
/* update default supported_mcs_set */
|
||||
rtw_hal_get_hwreg(padapter, HW_VAR_RF_TYPE, (u8 *)(&rf_type));
|
||||
|
|
Loading…
Reference in a new issue