1
0
Fork 0
mirror of synced 2025-03-06 20:59:54 +01:00
linux/drivers/net/wireless/ath/ath6kl
Kees Cook e3128a9d48 ath6kl: Use struct_group() to avoid size-mismatched casting
In builds with -Warray-bounds, casts from smaller objects to larger
objects will produce warnings. These can be overly conservative, but since
-Warray-bounds has been finding legitimate bugs, it is desirable to turn
it on globally. Instead of casting a u32 to a larger object, redefine
the u32 portion of the header to a separate struct that can be used for
both u32 operations and the distinct header fields. Silences this warning:

drivers/net/wireless/ath/ath6kl/htc_mbox.c: In function 'htc_wait_for_ctrl_msg':
drivers/net/wireless/ath/ath6kl/htc_mbox.c:2275:20: error: array subscript 'struct htc_frame_hdr[0]' is partly outside array bounds of 'u32[1]' {aka 'unsigned int[1]'} [-Werror=array-bounds]
 2275 |         if (htc_hdr->eid != ENDPOINT_0)
      |                    ^~
drivers/net/wireless/ath/ath6kl/htc_mbox.c:2264:13: note: while referencing 'look_ahead'
 2264 |         u32 look_ahead;
      |             ^~~~~~~~~~

This change results in no executable instruction differences.

Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
Link: https://lore.kernel.org/r/20211207063538.2767954-1-keescook@chromium.org
2021-12-09 10:00:12 +02:00
..
bmi.c
bmi.h
cfg80211.c ath6kl: use eth_hw_addr_set() 2021-10-20 12:39:43 +03:00
cfg80211.h
common.h ath6kl: add ath6kl_ prefix to crypto_type 2018-12-13 09:58:52 +01:00
core.c cfg80211: avoid holding the RTNL when calling the driver 2021-01-26 11:55:50 +01:00
core.h ath6kl: Replace zero-length array with flexible-array 2020-05-06 09:21:30 +03:00
debug.c ath6kl: return error code in ath6kl_wmi_set_roam_lrssi_cmd() 2021-05-13 18:32:15 +02:00
debug.h
hif-ops.h
hif.c
hif.h Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next 2020-06-03 16:27:18 -07:00
htc-ops.h
htc.h ath6kl: Use struct_group() to avoid size-mismatched casting 2021-12-09 10:00:12 +02:00
htc_mbox.c ath6kl: Use struct_group() to avoid size-mismatched casting 2021-12-09 10:00:12 +02:00
htc_pipe.c ath6kl: remove redundant check of status != 0 2019-04-29 17:50:10 +03:00
init.c cfg80211: avoid holding the RTNL when calling the driver 2021-01-26 11:55:50 +01:00
Kconfig treewide: replace '---help---' in Kconfig files with 'help' 2020-06-14 01:57:21 +09:00
main.c ath6kl: prevent potential array overflow in ath6kl_add_new_sta() 2020-08-17 13:22:08 +03:00
Makefile
recovery.c
sdio.c mmc: sdio: Move SDIO IDs from ath6kl driver to common include file 2020-05-29 12:37:59 +02:00
target.h
testmode.c wireless: remove unneeded break 2020-11-07 13:34:22 +02:00
testmode.h
trace.c
trace.h ath: fix SPDX tags 2019-06-26 18:11:06 +03:00
txrx.c
usb.c ath6kl: fix division by zero in send path 2021-10-28 10:34:20 +03:00
wmi.c ath6kl: wmi: fix an error code in ath6kl_wmi_sync_point() 2021-08-29 10:12:50 +03:00
wmi.h ath6kl: add ath6kl_ prefix to crypto_type 2018-12-13 09:58:52 +01:00