ath10k-ct: add security fixes
authorMichael Yartys <michael.yartys@protonmail.com>
Thu, 3 Jun 2021 21:50:12 +0000 (23:50 +0200)
committerPetr Štetiar <ynezz@true.cz>
Fri, 2 Jul 2021 15:15:44 +0000 (17:15 +0200)
This rebases -ct changes on top of upstream stable kernel's latest code.
Including the wifi security fixes that recently went in.

Removed upstreamed 203-ath10k-Limit-available-channels-via-DT-ieee80211-fre.patch
and refreshed patches.

Signed-off-by: Michael Yartys <michael.yartys@protonmail.com>
Signed-off-by: Petr Štetiar <ynezz@true.cz> [backport]
(backported from commit 2e10ed925e1e07c28570731a429efa5e7de3b826)

package/kernel/ath10k-ct/Makefile
package/kernel/ath10k-ct/patches/161-ath10k-add-support-for-configuring-management-packet.patch
package/kernel/ath10k-ct/patches/162-ath10k-fix-possible-out-of-bound-access-of-ath10k_ra.patch
package/kernel/ath10k-ct/patches/163-ath10k-fix-incorrect-multicast-broadcast-rate-settin.patch
package/kernel/ath10k-ct/patches/164-ath10k-commit-rates-from-mac80211.patch
package/kernel/ath10k-ct/patches/201-ath10k-4.16_add-LED-and-GPIO-controlling-support-for-various-chipsets.patch
package/kernel/ath10k-ct/patches/202-ath10k-4.16-use-tpt-trigger-by-default.patch
package/kernel/ath10k-ct/patches/203-ath10k-Limit-available-channels-via-DT-ieee80211-fre.patch [deleted file]

index c46c3a8..ef3c086 100644 (file)
@@ -8,9 +8,9 @@ PKG_LICENSE_FILES:=
 
 PKG_SOURCE_URL:=https://github.com/greearb/ath10k-ct.git
 PKG_SOURCE_PROTO:=git
-PKG_SOURCE_DATE:=2019-09-09
-PKG_SOURCE_VERSION:=5e8cd86f90dac966d12df6ece84ac41458d0e95f
-PKG_MIRROR_HASH:=dc1097f3a7b4b7e346918f206746d00a0b7df07ae3be9b89be55dfaef3cbbe45
+PKG_SOURCE_DATE:=2021-06-03
+PKG_SOURCE_VERSION:=b44cd7b2e7b0df5995ece18f358d4dfc40834ba1
+PKG_MIRROR_HASH:=59f961ad425eb1a48fa9c391a325cc0f23845daec9d12673445d3077f9756cf0
 
 # Build the 4.19 ath10k-ct driver version.  Other options are "-4.16", or
 # leave un-defined for 4.7 kernel.  Probably this should match as closely as
index e67003c..2b5ca52 100644 (file)
@@ -20,7 +20,7 @@ Origin: backport, https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux
 ---
 --- a/ath10k-4.19/mac.c
 +++ b/ath10k-4.19/mac.c
-@@ -157,6 +157,22 @@ u8 ath10k_mac_bitrate_to_idx(const struc
+@@ -158,6 +158,22 @@ u8 ath10k_mac_bitrate_to_idx(const struc
        return 0;
  }
  
@@ -43,7 +43,7 @@ Origin: backport, https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux
  static int ath10k_mac_get_max_vht_mcs_map(u16 mcs_map, int nss)
  {
        switch ((mcs_map >> (2 * nss)) & 0x3) {
-@@ -6405,9 +6421,10 @@ static void ath10k_bss_info_changed(stru
+@@ -6423,9 +6439,10 @@ static void ath10k_bss_info_changed(stru
        struct cfg80211_chan_def def;
        u32 vdev_param, pdev_param, slottime, preamble;
        u16 bitrate, hw_value;
@@ -56,7 +56,7 @@ Origin: backport, https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux
  
        mutex_lock(&ar->conf_mutex);
  
-@@ -6613,6 +6630,30 @@ static void ath10k_bss_info_changed(stru
+@@ -6631,6 +6648,30 @@ static void ath10k_bss_info_changed(stru
                                    arvif->vdev_id,  ret);
        }
  
index a240299..4e8b79f 100644 (file)
@@ -17,7 +17,7 @@ Origin: backport, https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux
 ---
 --- a/ath10k-4.19/mac.c
 +++ b/ath10k-4.19/mac.c
-@@ -165,7 +165,7 @@ static int ath10k_mac_get_rate_hw_value(
+@@ -166,7 +166,7 @@ static int ath10k_mac_get_rate_hw_value(
        if (ath10k_mac_bitrate_is_cck(bitrate))
                hw_value_prefix = WMI_RATE_PREAMBLE_CCK << 6;
  
@@ -26,7 +26,7 @@ Origin: backport, https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux
                if (ath10k_rates[i].bitrate == bitrate)
                        return hw_value_prefix | ath10k_rates[i].hw_value;
        }
-@@ -6636,22 +6636,22 @@ static void ath10k_bss_info_changed(stru
+@@ -6654,22 +6654,22 @@ static void ath10k_bss_info_changed(stru
                        return;
                }
  
index f6fd75b..5460bf7 100644 (file)
@@ -17,7 +17,7 @@ Origin: other, https://patchwork.kernel.org/patch/10723033/
 
 --- a/ath10k-4.19/mac.c
 +++ b/ath10k-4.19/mac.c
-@@ -6421,8 +6421,8 @@ static void ath10k_bss_info_changed(stru
+@@ -6439,8 +6439,8 @@ static void ath10k_bss_info_changed(stru
        struct cfg80211_chan_def def;
        u32 vdev_param, pdev_param, slottime, preamble;
        u16 bitrate, hw_value;
@@ -28,9 +28,9 @@ Origin: other, https://patchwork.kernel.org/patch/10723033/
        enum nl80211_band band;
        const struct ieee80211_supported_band *sband;
  
-@@ -6595,7 +6595,11 @@ static void ath10k_bss_info_changed(stru
+@@ -6613,7 +6613,11 @@ static void ath10k_bss_info_changed(stru
        if (changed & BSS_CHANGED_MCAST_RATE &&
-           !WARN_ON(ath10k_mac_vif_chan(arvif->vif, &def))) {
+           !ath10k_mac_vif_chan(arvif->vif, &def)) {
                band = def.chan->band;
 -              rateidx = vif->bss_conf.mcast_rate[band] - 1;
 +              mcast_rate = vif->bss_conf.mcast_rate[band];
index cd570a1..5696672 100644 (file)
@@ -11,7 +11,7 @@ Signed-off-by: Sven Eckelmann <sven@narfation.org>
 
 --- a/ath10k-4.19/mac.c
 +++ b/ath10k-4.19/mac.c
-@@ -6617,6 +6617,7 @@ static void ath10k_bss_info_changed(stru
+@@ -6635,6 +6635,7 @@ static void ath10k_bss_info_changed(stru
                           "mac vdev %d mcast_rate %x\n",
                           arvif->vdev_id, rate);
  
@@ -19,7 +19,7 @@ Signed-off-by: Sven Eckelmann <sven@narfation.org>
                vdev_param = ar->wmi.vdev_param->mcast_data_rate;
                ret = ath10k_wmi_vdev_set_param(ar, arvif->vdev_id,
                                                vdev_param, rate);
-@@ -6625,6 +6626,7 @@ static void ath10k_bss_info_changed(stru
+@@ -6643,6 +6644,7 @@ static void ath10k_bss_info_changed(stru
                                    "failed to set mcast rate on vdev %i: %d\n",
                                    arvif->vdev_id,  ret);
  
@@ -27,7 +27,7 @@ Signed-off-by: Sven Eckelmann <sven@narfation.org>
                vdev_param = ar->wmi.vdev_param->bcast_data_rate;
                ret = ath10k_wmi_vdev_set_param(ar, arvif->vdev_id,
                                                vdev_param, rate);
-@@ -6651,6 +6653,7 @@ static void ath10k_bss_info_changed(stru
+@@ -6669,6 +6671,7 @@ static void ath10k_bss_info_changed(stru
                        return;
                }
  
index b454796..779d8d0 100644 (file)
@@ -129,7 +129,7 @@ v13:
                .patch_load_addr = QCA988X_HW_2_0_PATCH_LOAD_ADDR,
                .uart_pin = 7,
                .cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_ALL,
-@@ -137,6 +139,7 @@ static const struct ath10k_hw_params ath
+@@ -139,6 +141,7 @@ static const struct ath10k_hw_params ath
                .id = QCA9887_HW_1_0_VERSION,
                .dev_id = QCA9887_1_0_DEVICE_ID,
                .name = "qca9887 hw1.0",
@@ -137,7 +137,7 @@ v13:
                .patch_load_addr = QCA9887_HW_1_0_PATCH_LOAD_ADDR,
                .uart_pin = 7,
                .cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_ALL,
-@@ -301,6 +304,7 @@ static const struct ath10k_hw_params ath
+@@ -308,6 +311,7 @@ static const struct ath10k_hw_params ath
                .id = QCA99X0_HW_2_0_DEV_VERSION,
                .dev_id = QCA99X0_2_0_DEVICE_ID,
                .name = "qca99x0 hw2.0",
@@ -145,7 +145,7 @@ v13:
                .patch_load_addr = QCA99X0_HW_2_0_PATCH_LOAD_ADDR,
                .uart_pin = 7,
                .otp_exe_param = 0x00000700,
-@@ -339,6 +343,7 @@ static const struct ath10k_hw_params ath
+@@ -347,6 +351,7 @@ static const struct ath10k_hw_params ath
                .id = QCA9984_HW_1_0_DEV_VERSION,
                .dev_id = QCA9984_1_0_DEVICE_ID,
                .name = "qca9984/qca9994 hw1.0",
@@ -153,7 +153,7 @@ v13:
                .patch_load_addr = QCA9984_HW_1_0_PATCH_LOAD_ADDR,
                .uart_pin = 7,
                .cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_EACH,
-@@ -382,6 +387,7 @@ static const struct ath10k_hw_params ath
+@@ -391,6 +396,7 @@ static const struct ath10k_hw_params ath
                .id = QCA9888_HW_2_0_DEV_VERSION,
                .dev_id = QCA9888_2_0_DEVICE_ID,
                .name = "qca9888 hw2.0",
@@ -161,7 +161,7 @@ v13:
                .patch_load_addr = QCA9888_HW_2_0_PATCH_LOAD_ADDR,
                .uart_pin = 7,
                .cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_EACH,
-@@ -3167,6 +3173,10 @@ int ath10k_core_start(struct ath10k *ar,
+@@ -3238,6 +3244,10 @@ int ath10k_core_start(struct ath10k *ar,
                        ath10k_wmi_check_apply_board_power_ctl_table(ar);
        }
  
@@ -172,7 +172,7 @@ v13:
        return 0;
  
  err_hif_stop:
-@@ -3421,9 +3431,18 @@ static void ath10k_core_register_work(st
+@@ -3492,9 +3502,18 @@ static void ath10k_core_register_work(st
                goto err_spectral_destroy;
        }
  
@@ -191,7 +191,7 @@ v13:
  err_spectral_destroy:
        ath10k_spectral_destroy(ar);
  err_debug_destroy:
-@@ -3481,6 +3500,8 @@ void ath10k_core_unregister(struct ath10
+@@ -3552,6 +3571,8 @@ void ath10k_core_unregister(struct ath10
        if (!test_bit(ATH10K_FLAG_CORE_REGISTERED, &ar->dev_flags))
                return;
  
@@ -210,7 +210,7 @@ v13:
  
  #include "htt.h"
  #include "htc.h"
-@@ -1138,7 +1139,6 @@ struct ath10k {
+@@ -1141,7 +1142,6 @@ struct ath10k {
        u32 low_5ghz_chan;
        u32 high_5ghz_chan;
        bool ani_enabled;
@@ -218,7 +218,7 @@ v13:
        bool p2p;
        bool ct_all_pkts_htt; /* CT firmware only: native-wifi for all pkts */
  
-@@ -1389,6 +1389,13 @@ struct ath10k {
+@@ -1400,6 +1400,13 @@ struct ath10k {
        } testmode;
  
        struct {
@@ -394,7 +394,7 @@ v13:
 +#endif /* _LEDS_H_ */
 --- a/ath10k-4.19/mac.c
 +++ b/ath10k-4.19/mac.c
-@@ -34,6 +34,7 @@
+@@ -35,6 +35,7 @@
  #include "wmi-tlv.h"
  #include "wmi-ops.h"
  #include "wow.h"
@@ -404,7 +404,7 @@ v13:
  /* Rates */
 --- a/ath10k-4.19/wmi-ops.h
 +++ b/ath10k-4.19/wmi-ops.h
-@@ -218,7 +218,10 @@ struct wmi_ops {
+@@ -219,7 +219,10 @@ struct wmi_ops {
        struct sk_buff *(*gen_echo)(struct ath10k *ar, u32 value);
        struct sk_buff *(*gen_pdev_get_tpc_table_cmdid)(struct ath10k *ar,
                                                        u32 param);
@@ -415,7 +415,7 @@ v13:
  };
  
  int ath10k_wmi_cmd_send(struct ath10k *ar, struct sk_buff *skb, u32 cmd_id);
-@@ -1079,6 +1082,35 @@ ath10k_wmi_force_fw_hang(struct ath10k *
+@@ -1089,6 +1092,35 @@ ath10k_wmi_force_fw_hang(struct ath10k *
        return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->force_fw_hang_cmdid);
  }
  
@@ -453,7 +453,7 @@ v13:
  {
 --- a/ath10k-4.19/wmi-tlv.c
 +++ b/ath10k-4.19/wmi-tlv.c
-@@ -3976,6 +3976,8 @@ static const struct wmi_ops wmi_tlv_ops
+@@ -3999,6 +3999,8 @@ static const struct wmi_ops wmi_tlv_ops
        .gen_echo = ath10k_wmi_tlv_op_gen_echo,
        .gen_vdev_spectral_conf = ath10k_wmi_tlv_op_gen_vdev_spectral_conf,
        .gen_vdev_spectral_enable = ath10k_wmi_tlv_op_gen_vdev_spectral_enable,
@@ -464,7 +464,7 @@ v13:
  static const struct wmi_peer_flags_map wmi_tlv_peer_flags_map = {
 --- a/ath10k-4.19/wmi.c
 +++ b/ath10k-4.19/wmi.c
-@@ -8070,6 +8070,49 @@ ath10k_wmi_op_gen_peer_set_param(struct
+@@ -8112,6 +8112,49 @@ ath10k_wmi_op_gen_peer_set_param(struct
        return skb;
  }
  
@@ -514,7 +514,7 @@ v13:
  static struct sk_buff *
  ath10k_wmi_op_gen_set_psmode(struct ath10k *ar, u32 vdev_id,
                             enum wmi_sta_ps_mode psmode)
-@@ -9821,6 +9864,9 @@ static const struct wmi_ops wmi_ops = {
+@@ -9865,6 +9908,9 @@ static const struct wmi_ops wmi_ops = {
        .fw_stats_fill = ath10k_wmi_main_op_fw_stats_fill,
        .get_vdev_subtype = ath10k_wmi_op_get_vdev_subtype,
        .gen_echo = ath10k_wmi_op_gen_echo,
@@ -524,7 +524,7 @@ v13:
        /* .gen_bcn_tmpl not implemented */
        /* .gen_prb_tmpl not implemented */
        /* .gen_p2p_go_bcn_ie not implemented */
-@@ -9891,6 +9937,8 @@ static const struct wmi_ops wmi_10_1_ops
+@@ -9935,6 +9981,8 @@ static const struct wmi_ops wmi_10_1_ops
        .fw_stats_fill = ath10k_wmi_10x_op_fw_stats_fill,
        .get_vdev_subtype = ath10k_wmi_op_get_vdev_subtype,
        .gen_echo = ath10k_wmi_op_gen_echo,
@@ -533,7 +533,7 @@ v13:
        /* .gen_bcn_tmpl not implemented */
        /* .gen_prb_tmpl not implemented */
        /* .gen_p2p_go_bcn_ie not implemented */
-@@ -9969,6 +10017,8 @@ static const struct wmi_ops wmi_10_2_ops
+@@ -10013,6 +10061,8 @@ static const struct wmi_ops wmi_10_2_ops
        .gen_delba_send = ath10k_wmi_op_gen_delba_send,
        .fw_stats_fill = ath10k_wmi_10x_op_fw_stats_fill,
        .get_vdev_subtype = ath10k_wmi_op_get_vdev_subtype,
@@ -542,7 +542,7 @@ v13:
        /* .gen_pdev_enable_adaptive_cca not implemented */
  };
  
-@@ -10039,6 +10089,8 @@ static const struct wmi_ops wmi_10_2_4_o
+@@ -10083,6 +10133,8 @@ static const struct wmi_ops wmi_10_2_4_o
        .gen_pdev_enable_adaptive_cca =
                ath10k_wmi_op_gen_pdev_enable_adaptive_cca,
        .get_vdev_subtype = ath10k_wmi_10_2_4_op_get_vdev_subtype,
@@ -551,7 +551,7 @@ v13:
        /* .gen_bcn_tmpl not implemented */
        /* .gen_prb_tmpl not implemented */
        /* .gen_p2p_go_bcn_ie not implemented */
-@@ -10119,6 +10171,8 @@ static const struct wmi_ops wmi_10_4_ops
+@@ -10163,6 +10215,8 @@ static const struct wmi_ops wmi_10_4_ops
        .gen_pdev_bss_chan_info_req = ath10k_wmi_10_2_op_gen_pdev_bss_chan_info,
        .gen_echo = ath10k_wmi_op_gen_echo,
        .gen_pdev_get_tpc_config = ath10k_wmi_10_2_4_op_gen_pdev_get_tpc_config,
index 562137f..a1dd584 100644 (file)
@@ -16,7 +16,7 @@ Signed-off-by: Mathias Kresin <dev@kresin.me>
 
 --- a/ath10k-4.19/core.h
 +++ b/ath10k-4.19/core.h
-@@ -1488,6 +1488,10 @@ struct ath10k {
+@@ -1500,6 +1500,10 @@ struct ath10k {
        u8 csi_data[4096];
        u16 csi_data_len;
  
@@ -42,7 +42,7 @@ Signed-off-by: Mathias Kresin <dev@kresin.me>
        if (ret)
 --- a/ath10k-4.19/mac.c
 +++ b/ath10k-4.19/mac.c
-@@ -9982,7 +9982,7 @@ int ath10k_mac_register(struct ath10k *a
+@@ -9998,7 +9998,7 @@ int ath10k_mac_register(struct ath10k *a
        wiphy_ext_feature_set(ar->hw->wiphy, NL80211_EXT_FEATURE_CQM_RSSI_LIST);
  
  #ifdef CPTCFG_MAC80211_LEDS
diff --git a/package/kernel/ath10k-ct/patches/203-ath10k-Limit-available-channels-via-DT-ieee80211-fre.patch b/package/kernel/ath10k-ct/patches/203-ath10k-Limit-available-channels-via-DT-ieee80211-fre.patch
deleted file mode 100644 (file)
index d770948..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-From bbf0a8af2261bc7ae39b227ff6a1e9f45a008c27 Mon Sep 17 00:00:00 2001
-From: Sven Eckelmann <sven.eckelmann@openmesh.com>
-Date: Mon, 30 Jul 2018 17:31:41 +0200
-Subject: [PATCH] ath10k: Limit available channels via DT ieee80211-freq-limit
-
-Tri-band devices (1x 2.4GHz + 2x 5GHz) often incorporate special filters in
-the RX and TX path. These filtered channel can in theory still be used by
-the hardware but the signal strength is reduced so much that it makes no
-sense.
-
-There is already a DT property to limit the available channels but ath10k
-has to manually call this functionality to limit the currrently set wiphy
-channels further.
-
-Signed-off-by: Sven Eckelmann <sven.eckelmann@openmesh.com>
-
-Forwarded: https://patchwork.kernel.org/patch/10549245/
----
- drivers/net/wireless/ath/ath10k/mac.c | 2 ++
- 1 file changed, 2 insertions(+)
-
---- a/ath10k-4.19/mac.c
-+++ b/ath10k-4.19/mac.c
-@@ -18,6 +18,7 @@
- #include "mac.h"
-+#include <net/cfg80211.h>
- #include <net/mac80211.h>
- #include <linux/etherdevice.h>
- #include <linux/acpi.h>
-@@ -9706,6 +9707,7 @@ int ath10k_mac_register(struct ath10k *a
-               ar->hw->wiphy->bands[NL80211_BAND_5GHZ] = band;
-       }
-+      wiphy_read_of_freq_limits(ar->hw->wiphy);
-       ath10k_mac_setup_ht_vht_cap(ar);
-       ar->hw->wiphy->interface_modes =