diff options
author | 2023-02-15 14:41:14 -0800 | |
---|---|---|
committer | 2023-02-16 09:33:25 +0100 | |
commit | 1a30a6b25f263686dbf2028d56041ac012b10dcb (patch) | |
tree | d2542e74dc9636b0a55886828a5e3286e025dda5 /net/ipv6 | |
parent | wifi: mac80211: add documentation for amsdu_mesh_control (diff) | |
download | linux-1a30a6b25f263686dbf2028d56041ac012b10dcb.tar.gz linux-1a30a6b25f263686dbf2028d56041ac012b10dcb.tar.bz2 linux-1a30a6b25f263686dbf2028d56041ac012b10dcb.zip |
wifi: brcmfmac: p2p: Introduce generic flexible array frame member
Silence run-time memcpy() false positive warning when processing
management frames:
memcpy: detected field-spanning write (size 27) of single field "&mgmt_frame->u" at drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c:1469 (size 26)
Due to this (soon to be fixed) GCC bug[1], FORTIFY_SOURCE (via
__builtin_dynamic_object_size) doesn't recognize that the union may end
with a flexible array, and returns "26" (the fixed size of the union),
rather than the remaining size of the allocation. Add an explicit
flexible array member and set it as the destination here, so that we
get the correct coverage for the memcpy().
[1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101832
Reported-by: Ard Biesheuvel <ardb@kernel.org>
Cc: Arend van Spriel <aspriel@gmail.com>
Cc: Franky Lin <franky.lin@broadcom.com>
Cc: Hante Meuleman <hante.meuleman@broadcom.com>
Cc: Kalle Valo <kvalo@kernel.org>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Eric Dumazet <edumazet@google.com>
Cc: Jakub Kicinski <kuba@kernel.org>
Cc: Paolo Abeni <pabeni@redhat.com>
Cc: Johannes Berg <johannes@sipsolutions.net>
Cc: "Jason A. Donenfeld" <Jason@zx2c4.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: "Darrick J. Wong" <djwong@kernel.org>
Cc: Colin Ian King <colin.i.king@gmail.com>
Cc: Brian Henriquez <brian.henriquez@cypress.com>
Cc: linux-wireless@vger.kernel.org
Cc: brcm80211-dev-list.pdl@broadcom.com
Cc: SHA-cyfmac-dev-list@infineon.com
Cc: netdev@vger.kernel.org
Signed-off-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/20230215224110.never.022-kees@kernel.org
[rename 'frame' to 'body']
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/ipv6')
0 files changed, 0 insertions, 0 deletions