1. 30 3月, 2023 1 次提交
    • G
      wifi: iwlwifi: mvm: vif preparation for MLO · 650cadb7
      Gregory Greenman 提交于
      In MLO, some fields of iwl_mvm_vif should be defined in the
      context of a link. Define a separate structure for these fields and
      add a deflink object to hold it as part of iwl_mvm_vif. Non-MLO legacy
      code will use only deflink object while MLO related code will use the
      corresponding link from the link array.
      
      It follows the strategy applied in mac80211 for introducing MLO
      changes.
      
      The below spatch takes care of updating all driver code to access
      fields separated into MLD specific data structure via deflink (need
      to convert all references to the fields listed in var to deflink.var
      and also to take care of calls like iwl_mvm_vif_from_mac80211(vif)->field).
      
        @iwl_mld_vif@
        struct iwl_mvm_vif *v;
        struct ieee80211_vif *vv;
        identifier fn;
        identifier var = {bssid, ap_sta_id, bcast_sta, mcast_sta,
                          beacon_stats, smps_requests, probe_resp_data,
      		    he_ru_2mhz_block, cab_queue, phy_ctxt,
                          queue_params};
        @@
      
        (
          v->
        -    var
        +    deflink.var
        |
          fn(vv)->
        -    var
        +    deflink.var
        )
      Signed-off-by: NGregory Greenman <gregory.greenman@intel.com>
      Link: https://lore.kernel.org/r/20230328104948.4896576f0a9f.Ifaf0187c96b9fe52b24bd629331165831a877691@changeidSigned-off-by: NJohannes Berg <johannes.berg@intel.com>
      650cadb7
  2. 22 3月, 2023 1 次提交
  3. 08 3月, 2023 1 次提交
  4. 30 1月, 2023 1 次提交
  5. 28 11月, 2022 1 次提交
    • B
      wifi: iwlwifi: mvm: fix double free on tx path. · 0473cbae
      Ben Greear 提交于
      We see kernel crashes and lockups and KASAN errors related to ax210
      firmware crashes.  One of the KASAN dumps pointed at the tx path,
      and it appears there is indeed a way to double-free an skb.
      
      If iwl_mvm_tx_skb_sta returns non-zero, then the 'skb' sent into the
      method will be freed.  But, in case where we build TSO skb buffer,
      the skb may also be freed in error case.  So, return 0 in that particular
      error case and do cleanup manually.
      
      BUG: KASAN: use-after-free in __list_del_entry_valid+0x12/0x90
      iwlwifi 0000:06:00.0: 0x00000000 | tsf hi
      Read of size 8 at addr ffff88813cfa4ba0 by task btserver/9650
      
      CPU: 4 PID: 9650 Comm: btserver Tainted: G        W         5.19.8+ #5
      iwlwifi 0000:06:00.0: 0x00000000 | time gp1
      Hardware name: Default string Default string/SKYBAY, BIOS 5.12 02/19/2019
      Call Trace:
       <TASK>
       dump_stack_lvl+0x55/0x6d
       print_report.cold.12+0xf2/0x684
      iwlwifi 0000:06:00.0: 0x1D0915A8 | time gp2
       ? __list_del_entry_valid+0x12/0x90
       kasan_report+0x8b/0x180
      iwlwifi 0000:06:00.0: 0x00000001 | uCode revision type
       ? __list_del_entry_valid+0x12/0x90
       __list_del_entry_valid+0x12/0x90
      iwlwifi 0000:06:00.0: 0x00000048 | uCode version major
       tcp_update_skb_after_send+0x5d/0x170
       __tcp_transmit_skb+0xb61/0x15c0
      iwlwifi 0000:06:00.0: 0xDAA05125 | uCode version minor
       ? __tcp_select_window+0x490/0x490
      iwlwifi 0000:06:00.0: 0x00000420 | hw version
       ? trace_kmalloc_node+0x29/0xd0
       ? __kmalloc_node_track_caller+0x12a/0x260
       ? memset+0x1f/0x40
       ? __build_skb_around+0x125/0x150
       ? __alloc_skb+0x1d4/0x220
       ? skb_zerocopy_clone+0x55/0x230
      iwlwifi 0000:06:00.0: 0x00489002 | board version
       ? kmalloc_reserve+0x80/0x80
       ? rcu_read_lock_bh_held+0x60/0xb0
       tcp_write_xmit+0x3f1/0x24d0
      iwlwifi 0000:06:00.0: 0x034E001C | hcmd
       ? __check_object_size+0x180/0x350
      iwlwifi 0000:06:00.0: 0x24020000 | isr0
       tcp_sendmsg_locked+0x8a9/0x1520
      iwlwifi 0000:06:00.0: 0x01400000 | isr1
       ? tcp_sendpage+0x50/0x50
      iwlwifi 0000:06:00.0: 0x48F0000A | isr2
       ? lock_release+0xb9/0x400
       ? tcp_sendmsg+0x14/0x40
      iwlwifi 0000:06:00.0: 0x00C3080C | isr3
       ? lock_downgrade+0x390/0x390
       ? do_raw_spin_lock+0x114/0x1d0
      iwlwifi 0000:06:00.0: 0x00200000 | isr4
       ? rwlock_bug.part.2+0x50/0x50
      iwlwifi 0000:06:00.0: 0x034A001C | last cmd Id
       ? rwlock_bug.part.2+0x50/0x50
       ? lockdep_hardirqs_on_prepare+0xe/0x200
      iwlwifi 0000:06:00.0: 0x0000C2F0 | wait_event
       ? __local_bh_enable_ip+0x87/0xe0
       ? inet_send_prepare+0x220/0x220
      iwlwifi 0000:06:00.0: 0x000000C4 | l2p_control
       tcp_sendmsg+0x22/0x40
       sock_sendmsg+0x5f/0x70
      iwlwifi 0000:06:00.0: 0x00010034 | l2p_duration
       __sys_sendto+0x19d/0x250
      iwlwifi 0000:06:00.0: 0x00000007 | l2p_mhvalid
       ? __ia32_sys_getpeername+0x40/0x40
      iwlwifi 0000:06:00.0: 0x00000000 | l2p_addr_match
       ? rcu_read_lock_held_common+0x12/0x50
       ? rcu_read_lock_sched_held+0x5a/0xd0
       ? rcu_read_lock_bh_held+0xb0/0xb0
       ? rcu_read_lock_sched_held+0x5a/0xd0
       ? rcu_read_lock_sched_held+0x5a/0xd0
       ? lock_release+0xb9/0x400
       ? lock_downgrade+0x390/0x390
       ? ktime_get+0x64/0x130
       ? ktime_get+0x8d/0x130
       ? rcu_read_lock_held_common+0x12/0x50
       ? rcu_read_lock_sched_held+0x5a/0xd0
       ? rcu_read_lock_held_common+0x12/0x50
       ? rcu_read_lock_sched_held+0x5a/0xd0
       ? rcu_read_lock_bh_held+0xb0/0xb0
       ? rcu_read_lock_bh_held+0xb0/0xb0
       __x64_sys_sendto+0x6f/0x80
       do_syscall_64+0x34/0xb0
       entry_SYSCALL_64_after_hwframe+0x46/0xb0
      RIP: 0033:0x7f1d126e4531
      Code: 00 00 00 00 0f 1f 44 00 00 f3 0f 1e fa 48 8d 05 35 80 0c 00 41 89 ca 8b 00 85 c0 75 1c 45 31 c9 45 31 c0 b8 2c 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 67 c3 66 0f 1f 44 00 00 55 48 83 ec 20 48 89
      RSP: 002b:00007ffe21a679d8 EFLAGS: 00000246 ORIG_RAX: 000000000000002c
      RAX: ffffffffffffffda RBX: 000000000000ffdc RCX: 00007f1d126e4531
      RDX: 0000000000010000 RSI: 000000000374acf0 RDI: 0000000000000014
      RBP: 00007ffe21a67ac0 R08: 0000000000000000 R09: 0000000000000000
      R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000010
      R13: 0000000000000000 R14: 0000000000000001 R15: 0000000000000000
       </TASK>
      
      Allocated by task 9650:
       kasan_save_stack+0x1c/0x40
       __kasan_slab_alloc+0x6d/0x90
       kmem_cache_alloc_node+0xf3/0x2b0
       __alloc_skb+0x191/0x220
       tcp_stream_alloc_skb+0x3f/0x330
       tcp_sendmsg_locked+0x67c/0x1520
       tcp_sendmsg+0x22/0x40
       sock_sendmsg+0x5f/0x70
       __sys_sendto+0x19d/0x250
       __x64_sys_sendto+0x6f/0x80
       do_syscall_64+0x34/0xb0
       entry_SYSCALL_64_after_hwframe+0x46/0xb0
      
      Freed by task 9650:
       kasan_save_stack+0x1c/0x40
       kasan_set_track+0x21/0x30
       kasan_set_free_info+0x20/0x30
       __kasan_slab_free+0x102/0x170
       kmem_cache_free+0xc8/0x3e0
       iwl_mvm_mac_itxq_xmit+0x124/0x270 [iwlmvm]
       ieee80211_queue_skb+0x874/0xd10 [mac80211]
       ieee80211_xmit_fast+0xf80/0x1180 [mac80211]
       __ieee80211_subif_start_xmit+0x287/0x680 [mac80211]
       ieee80211_subif_start_xmit+0xcd/0x730 [mac80211]
       dev_hard_start_xmit+0xf6/0x420
       __dev_queue_xmit+0x165b/0x1b50
       ip_finish_output2+0x66e/0xfb0
       __ip_finish_output+0x487/0x6d0
       ip_output+0x11c/0x350
       __ip_queue_xmit+0x36b/0x9d0
       __tcp_transmit_skb+0xb35/0x15c0
       tcp_write_xmit+0x3f1/0x24d0
       tcp_sendmsg_locked+0x8a9/0x1520
       tcp_sendmsg+0x22/0x40
       sock_sendmsg+0x5f/0x70
       __sys_sendto+0x19d/0x250
       __x64_sys_sendto+0x6f/0x80
       do_syscall_64+0x34/0xb0
       entry_SYSCALL_64_after_hwframe+0x46/0xb0
      
      The buggy address belongs to the object at ffff88813cfa4b40
       which belongs to the cache skbuff_fclone_cache of size 472
      The buggy address is located 96 bytes inside of
       472-byte region [ffff88813cfa4b40, ffff88813cfa4d18)
      
      The buggy address belongs to the physical page:
      page:ffffea0004f3e900 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff88813cfa6c40 pfn:0x13cfa4
      head:ffffea0004f3e900 order:2 compound_mapcount:0 compound_pincount:0
      flags: 0x5fff8000010200(slab|head|node=0|zone=2|lastcpupid=0x3fff)
      raw: 005fff8000010200 ffffea0004656b08 ffffea0008e8cf08 ffff8881081a5240
      raw: ffff88813cfa6c40 0000000000170015 00000001ffffffff 0000000000000000
      page dumped because: kasan: bad access detected
      
      Memory state around the buggy address:
       ffff88813cfa4a80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
       ffff88813cfa4b00: fc fc fc fc fc fc fc fc fa fb fb fb fb fb fb fb
      >ffff88813cfa4b80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                                     ^
       ffff88813cfa4c00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
       ffff88813cfa4c80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
      ==================================================================
      
      Fixes: 08f7d8b6 ("iwlwifi: mvm: bring back mvm GSO code")
      Link: https://lore.kernel.org/linux-wireless/20220928193057.16132-1-greearb@candelatech.com/Tested-by: NAmol Jawale <amol.jawale@candelatech.com>
      Signed-off-by: NBen Greear <greearb@candelatech.com>
      Link: https://lore.kernel.org/r/20221123225313.21b1ee31d666.I3b3ba184433dd2a544d91eeeda29b467021824ae@changeidSigned-off-by: NGregory Greenman <gregory.greenman@intel.com>
      0473cbae
  6. 10 11月, 2022 2 次提交
  7. 06 9月, 2022 1 次提交
  8. 20 6月, 2022 1 次提交
    • J
      wifi: mac80211: move some future per-link data to bss_conf · d0a9123e
      Johannes Berg 提交于
      To add MLD, reuse the bss_conf structure later for per-link
      information, so move some things into it that are per link.
      
      Most transformations were done with the following spatch:
      
          @@
          expression sdata;
          identifier var = { chanctx_conf, mu_mimo_owner, csa_active, color_change_active, color_change_color };
          @@
          -sdata->vif.var
          +sdata->vif.bss_conf.var
      
          @@
          struct ieee80211_vif *vif;
          identifier var = { chanctx_conf, mu_mimo_owner, csa_active, color_change_active, color_change_color };
          @@
          -vif->var
          +vif->bss_conf.var
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      d0a9123e
  9. 11 4月, 2022 1 次提交
    • S
      mac80211: prepare sta handling for MLO support · 046d2e7c
      Sriram R 提交于
      Currently in mac80211 each STA object is represented
      using sta_info datastructure with the associated
      STA specific information and drivers access ieee80211_sta
      part of it.
      
      With MLO (Multi Link Operation) support being added
      in 802.11be standard, though the association is logically
      with a single Multi Link capable STA, at the physical level
      communication can happen via different advertised
      links (uniquely identified by Channel, operating class,
      BSSID) and hence the need to handle multiple link
      STA parameters within a composite sta_info object
      called the MLD STA. The different link STA part of
      MLD STA are identified using the link address which can
      be same or different as the MLD STA address and unique
      link id based on the link vif.
      
      To support extension of such a model, the sta_info
      datastructure is modified to hold multiple link STA
      objects with link specific params currently within
      sta_info moved to this new structure. Similarly this is
      done for ieee80211_sta as well which will be accessed
      within mac80211 as well as by drivers, hence trivial
      driver changes are expected to support this.
      
      For current non MLO supported drivers, only one link STA
      is present and link information is accessed via 'deflink'
      member.
      
      For MLO drivers, we still need to define the APIs etc. to
      get the correct link ID and access the correct part of
      the station info.
      
      Currently in mac80211, all link STA info are accessed directly
      via deflink. These will be updated to access via link pointers
      indexed by link id with MLO support patches, with link id
      being 0 for non MLO supported cases.
      
      Except for couple of macro related changes, below spatch takes
      care of updating mac80211 and driver code to access to the
      link STA info via deflink.
      
        @ieee80211_sta@
        struct ieee80211_sta *s;
        struct sta_info *si;
        identifier var = {supp_rates, ht_cap, vht_cap, he_cap, he_6ghz_capa, eht_cap, rx_nss, bandwidth, txpwr};
        @@
      
        (
          s->
        -    var
        +    deflink.var
        |
         si->sta.
        -    var
        +    deflink.var
        )
      
        @sta_info@
        struct sta_info *si;
        identifier var = {gtk, pcpu_rx_stats, rx_stats, rx_stats_avg, status_stats, tx_stats, cur_max_bandwidth};
        @@
      
        (
          si->
        -    var
        +    deflink.var
        )
      Signed-off-by: NSriram R <quic_srirrama@quicinc.com>
      Link: https://lore.kernel.org/r/1649086883-13246-1-git-send-email-quic_srirrama@quicinc.com
      [remove MLO-drivers notes from commit message, not clear yet; run spatch]
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      046d2e7c
  10. 18 2月, 2022 4 次提交
  11. 03 2月, 2022 1 次提交
  12. 21 12月, 2021 2 次提交
  13. 09 12月, 2021 1 次提交
  14. 27 11月, 2021 1 次提交
    • E
      iwlwifi: integrate with iwlmei · 6d19a5eb
      Emmanuel Grumbach 提交于
      iwlmei needs to know about the follwing events:
      
      * Association
      * De-association
      * Country Code change
      * SW Rfkill change
      * SAR table changes
      
      iwlmei can take the device away from us, so report the new
      rfkill type when this happens.
      Advertise the required data from the CSME firmware to the
      usersapce: mostly, the AP that the CSME firmware is currently
      associated to in case there is an active link protection
      session.
      Generate the HOST_ASSOC / HOST_DISSASSOC messages.
      
      Don't support WPA1 (non-RSNA) for now.
      Don't support shared wep either.
      We can then determine the AUTH parameter by checking the AKM.
      Feed the cipher from the key installation.
      
      SW Rfkill will be implemented later when cfg80211 will
      allow us to read the SW Rfkill state.
      Co-Developed-by: NAyala Beker <ayala.beker@intel.com>
      Signed-off-by: NAyala Beker <ayala.beker@intel.com>
      Signed-off-by: NEmmanuel Grumbach <emmanuel.grumbach@intel.com>
      
      v7: Ayala added her signed-off
          remove pointless function declaration
          fix a bug due to merge conflict in the HOST_ASSOC message
      v8: leave a print if we have a SAP connection on a device we do
          not support (yet)
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      Link: https://lore.kernel.org/r/20211112062814.7502-4-emmanuel.grumbach@intel.com
      6d19a5eb
  15. 22 10月, 2021 5 次提交
  16. 23 6月, 2021 1 次提交
  17. 10 2月, 2021 1 次提交
  18. 05 2月, 2021 4 次提交
  19. 27 1月, 2021 1 次提交
  20. 12 12月, 2020 1 次提交
  21. 10 12月, 2020 2 次提交
  22. 09 10月, 2020 3 次提交
  23. 08 10月, 2020 1 次提交
    • L
      iwlwifi: mvm: tx: Demote misuse of kernel-doc headers · 91b4780f
      Lee Jones 提交于
      Fixes the following W=1 kernel build warning(s):
      
       drivers/net/wireless/intel/iwlwifi/mvm/tx.c:1379: warning: Function parameter or member 'rate_n_flags' not described in 'iwl_mvm_hwrate_to_tx_status'
       drivers/net/wireless/intel/iwlwifi/mvm/tx.c:1379: warning: Function parameter or member 'info' not described in 'iwl_mvm_hwrate_to_tx_status'
       drivers/net/wireless/intel/iwlwifi/mvm/tx.c:1431: warning: Function parameter or member 'mvm' not described in 'iwl_mvm_get_scd_ssn'
      
      Cc: Johannes Berg <johannes.berg@intel.com>
      Cc: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
      Cc: Luca Coelho <luciano.coelho@intel.com>
      Cc: Intel Linux Wireless <linuxwifi@intel.com>
      Cc: Kalle Valo <kvalo@codeaurora.org>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Jakub Kicinski <kuba@kernel.org>
      Cc: linux-wireless@vger.kernel.org
      Cc: netdev@vger.kernel.org
      Signed-off-by: NLee Jones <lee.jones@linaro.org>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      Link: https://lore.kernel.org/r/20200910065431.657636-14-lee.jones@linaro.org
      91b4780f
  24. 02 10月, 2020 1 次提交
  25. 08 5月, 2020 1 次提交