0070-wifi-ath-work-around-false-positive-stringop-overrea.patch 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. From 695df2f417d25202bdac9cde3c82d2acb6492b4d Mon Sep 17 00:00:00 2001
  2. From: Arnd Bergmann <arnd@arndb.de>
  3. Date: Fri, 5 May 2023 16:11:25 +0300
  4. Subject: [PATCH] wifi: ath: work around false-positive stringop-overread
  5. warning
  6. In a rare arm64 randconfig build, I got multiple warnings for ath11k
  7. and ath12k:
  8. In function 'ath11k_peer_assoc_h_ht',
  9. inlined from 'ath11k_peer_assoc_prepare' at drivers/net/wireless/ath/ath11k/mac.c:2665:2:
  10. drivers/net/wireless/ath/ath11k/mac.c:1709:13: error: 'ath11k_peer_assoc_h_ht_masked' reading 10 bytes from a region of size 0 [-Werror=stringop-overread]
  11. 1709 | if (ath11k_peer_assoc_h_ht_masked(ht_mcs_mask))
  12. | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  13. This happens whenever gcc-13 fails to inline one of the functions
  14. that take a fixed-length array argument but gets passed a pointer.
  15. Change these functions to all take a regular pointer argument
  16. instead.
  17. Signed-off-by: Arnd Bergmann <arnd@arndb.de>
  18. Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
  19. Link: https://lore.kernel.org/r/20230417205447.1800912-1-arnd@kernel.org
  20. ---
  21. drivers/net/wireless/ath/ath11k/mac.c | 12 ++++++------
  22. 1 file changed, 6 insertions(+), 6 deletions(-)
  23. --- a/drivers/net/wireless/ath/ath11k/mac.c
  24. +++ b/drivers/net/wireless/ath/ath11k/mac.c
  25. @@ -433,7 +433,7 @@ u8 ath11k_mac_bitrate_to_idx(const struc
  26. }
  27. static u32
  28. -ath11k_mac_max_ht_nss(const u8 ht_mcs_mask[IEEE80211_HT_MCS_MASK_LEN])
  29. +ath11k_mac_max_ht_nss(const u8 *ht_mcs_mask)
  30. {
  31. int nss;
  32. @@ -445,7 +445,7 @@ ath11k_mac_max_ht_nss(const u8 ht_mcs_ma
  33. }
  34. static u32
  35. -ath11k_mac_max_vht_nss(const u16 vht_mcs_mask[NL80211_VHT_NSS_MAX])
  36. +ath11k_mac_max_vht_nss(const u16 *vht_mcs_mask)
  37. {
  38. int nss;
  39. @@ -457,7 +457,7 @@ ath11k_mac_max_vht_nss(const u16 vht_mcs
  40. }
  41. static u32
  42. -ath11k_mac_max_he_nss(const u16 he_mcs_mask[NL80211_HE_NSS_MAX])
  43. +ath11k_mac_max_he_nss(const u16 *he_mcs_mask)
  44. {
  45. int nss;
  46. @@ -1658,7 +1658,7 @@ static void ath11k_peer_assoc_h_rates(st
  47. }
  48. static bool
  49. -ath11k_peer_assoc_h_ht_masked(const u8 ht_mcs_mask[IEEE80211_HT_MCS_MASK_LEN])
  50. +ath11k_peer_assoc_h_ht_masked(const u8 *ht_mcs_mask)
  51. {
  52. int nss;
  53. @@ -1670,7 +1670,7 @@ ath11k_peer_assoc_h_ht_masked(const u8 h
  54. }
  55. static bool
  56. -ath11k_peer_assoc_h_vht_masked(const u16 vht_mcs_mask[])
  57. +ath11k_peer_assoc_h_vht_masked(const u16 *vht_mcs_mask)
  58. {
  59. int nss;
  60. @@ -2065,7 +2065,7 @@ static u16 ath11k_peer_assoc_h_he_limit(
  61. }
  62. static bool
  63. -ath11k_peer_assoc_h_he_masked(const u16 he_mcs_mask[NL80211_HE_NSS_MAX])
  64. +ath11k_peer_assoc_h_he_masked(const u16 *he_mcs_mask)
  65. {
  66. int nss;