1. 01 3月, 2016 2 次提交
    • J
      mac80211: Fix Public Action frame RX in AP mode · 1ec7bae8
      Jouni Malinen 提交于
      Public Action frames use special rules for how the BSSID field (Address
      3) is set. A wildcard BSSID is used in cases where the transmitter and
      recipient are not members of the same BSS. As such, we need to accept
      Public Action frames with wildcard BSSID.
      
      Commit db8e1732 ("mac80211: ignore frames between TDLS peers when
      operating as AP") added a rule that drops Action frames to TDLS-peers
      based on an Action frame having different DA (Address 1) and BSSID
      (Address 3) values. This is not correct since it misses the possibility
      of BSSID being a wildcard BSSID in which case the Address 1 would not
      necessarily match.
      
      Fix this by allowing mac80211 to accept wildcard BSSID in an Action
      frame when in AP mode.
      
      Fixes: db8e1732 ("mac80211: ignore frames between TDLS peers when operating as AP")
      Cc: stable@vger.kernel.org
      Signed-off-by: NJouni Malinen <jouni@qca.qualcomm.com>
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      1ec7bae8
    • J
      mac80211: check PN correctly for GCMP-encrypted fragmented MPDUs · 9acc54be
      Johannes Berg 提交于
      Just like for CCMP we need to check that for GCMP the fragments
      have PNs that increment by one; the spec was updated to fix this
      security issue and now has the following text:
      
      	The receiver shall discard MSDUs and MMPDUs whose constituent
      	MPDU PN values are not incrementing in steps of 1.
      
      Adapt the code for CCMP to work for GCMP as well, luckily the
      relevant fields already alias each other so no code duplication
      is needed (just check the aliasing with BUILD_BUG_ON.)
      
      Cc: stable@vger.kernel.org
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      9acc54be
  2. 23 2月, 2016 1 次提交
  3. 02 2月, 2016 2 次提交
  4. 30 1月, 2016 1 次提交
    • C
      mac80211: fix use of uninitialised values in RX aggregation · f39ea269
      Chris Bainbridge 提交于
      Use kzalloc instead of kmalloc for struct tid_ampdu_rx to
      initialize the "removed" field (all others are initialized
      manually). That fixes:
      
      UBSAN: Undefined behaviour in net/mac80211/rx.c:932:29
      load of value 2 is not a valid value for type '_Bool'
      CPU: 3 PID: 1134 Comm: kworker/u16:7 Not tainted 4.5.0-rc1+ #265
      Workqueue: phy0 rt2x00usb_work_rxdone
       0000000000000004 ffff880254a7ba50 ffffffff8181d866 0000000000000007
       ffff880254a7ba78 ffff880254a7ba68 ffffffff8188422d ffffffff8379b500
       ffff880254a7bab8 ffffffff81884747 0000000000000202 0000000348620032
      Call Trace:
       [<ffffffff8181d866>] dump_stack+0x45/0x5f
       [<ffffffff8188422d>] ubsan_epilogue+0xd/0x40
       [<ffffffff81884747>] __ubsan_handle_load_invalid_value+0x67/0x70
       [<ffffffff82227b4d>] ieee80211_sta_reorder_release.isra.16+0x5ed/0x730
       [<ffffffff8222ca14>] ieee80211_prepare_and_rx_handle+0xd04/0x1c00
       [<ffffffff8222db03>] __ieee80211_rx_handle_packet+0x1f3/0x750
       [<ffffffff8222e4a7>] ieee80211_rx_napi+0x447/0x990
      
      While at it, convert to use sizeof(*tid_agg_rx) instead.
      
      Fixes: 788211d8 ("mac80211: fix RX A-MPDU session reorder timer deletion")
      Cc: stable@vger.kernel.org
      Signed-off-by: NChris Bainbridge <chris.bainbridge@gmail.com>
      [reword commit message, use sizeof(*tid_agg_rx)]
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      f39ea269
  5. 26 1月, 2016 1 次提交
  6. 14 1月, 2016 7 次提交
    • H
      mac80211: Don't buffer non-bufferable MMPDUs · da629cf1
      Helmut Schaa 提交于
      Non-bufferable MMPDUs are sent out to STAs even while in PS mode
      (for example probe responses). Applying filtered frame handling for
      these doesn't seem to make much sense and will only create more
      air utilization when the STA wakes up. Hence, apply filtered frame
      handling only for bufferable MMPDUs.
      
      Discovered while testing an old VOIP phone that started probing
      for APs while in PS mode. The mac80211/ath9k AP where the STA is
      associated would reply with a probe response but the phone sometimes
      moved to a new channel already and couldn't ack the probe response
      anymore. In that case mac80211 applied filtered frame handling
      for the un-acked probe response.
      Signed-off-by: NHelmut Schaa <helmut.schaa@googlemail.com>
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      da629cf1
    • E
      mac80211: handle sched_scan_stopped vs. hw restart race · 2bc533bd
      Eliad Peller 提交于
      On hw restart, mac80211 might try to reconfigure already
      stopped sched scan, if ieee80211_sched_scan_stopped_work()
      wasn't scheduled yet.
      
      This in turn will keep the device driver with scheduled scan
      configured, while both mac80211 and cfg80211 will clear
      their sched scan state once the work is scheduled.
      
      Fix it by ignoring ieee80211_sched_scan_stopped() calls
      while in hw restart, and flush the work before starting
      the reconfiguration.
      Signed-off-by: NEliad Peller <eliadx.peller@intel.com>
      Signed-off-by: NEmmanuel Grumbach <emmanuel.grumbach@intel.com>
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      2bc533bd
    • E
      mac80211: fix PS-Poll handling · 1a57081a
      Emmanuel Grumbach 提交于
      My commit below broken PS-Poll handling. In case the driver
      has no frames buffered, driver_release_tids will be 0, but
      calling find_highest_prio_tid() with 0 as a parameter is
      not a good idea:
      fls(0) - 1 = -1.
      This bug caused mac80211 to think that frames were buffered
      in the driver which in turn was confused because mac80211
      was asking to release frames that were not reported to
      exist.
      On iwlwifi, this led to the WARNING below:
      
      WARNING: CPU: 0 PID: 11230 at drivers/net/wireless/intel/iwlwifi/mvm/sta.c:1733 iwl_mvm_sta_modify_sleep_tx_count+0x2af/0x320 [iwlmvm]()
      ffffffffc0627c60 ffff8800069b7648 ffffffff81888913 0000000000000000
      0000000000000000 ffff8800069b7688 ffffffff81089d6a ffff8800069b7678
      0000000000000001 ffff88003b35abf0 ffff88000698b128 ffff8800069b76d4
      Call Trace:
      [<ffffffff81888913>] dump_stack+0x4c/0x65
      [<ffffffff81089d6a>] warn_slowpath_common+0x8a/0xc0
      [<ffffffff81089e5a>] warn_slowpath_null+0x1a/0x20
      [<ffffffffc05f36bf>] iwl_mvm_sta_modify_sleep_tx_count+0x2af/0x320 [iwlmvm]
      [<ffffffffc05dae41>] iwl_mvm_mac_release_buffered_frames+0x31/0x40 [iwlmvm]
      [<ffffffffc045d8b6>] ieee80211_sta_ps_deliver_response+0x6e6/0xd80 [mac80211]
      [<ffffffffc0461296>] ieee80211_sta_ps_deliver_poll_response+0x26/0x30 [mac80211]
      [<ffffffffc048f743>] ieee80211_rx_handlers+0xa83/0x2900 [mac80211]
      [<ffffffffc04917ad>] ieee80211_prepare_and_rx_handle+0x1ed/0xa70 [mac80211]
      [<ffffffffc045e3d5>] ? sta_info_get_bss+0x5/0x4a0 [mac80211]
      [<ffffffffc04925b6>] ieee80211_rx_napi+0x586/0xcd0 [mac80211]
      [<ffffffffc05eaa3e>] iwl_mvm_rx_rx_mpdu+0x59e/0xc60 [iwlmvm]
      
      Fixes: 0ead2510 ("mac80211: allow the driver to send EOSP when needed")
      Signed-off-by: NEmmanuel Grumbach <emmanuel.grumbach@intel.com>
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      1a57081a
    • E
      mac80211: clear local->sched_scan_req properly on reconfig · b9f628fc
      Eliad Peller 提交于
      On reconfig, in case of sched_scan_req->n_scan_plans > 1,
      local->sched_scan_req was never cleared, although
      cfg80211_sched_scan_stopped_rtnl() was called, resulting
      in local->sched_scan_req holding a stale and preventing
      further scheduled scan requests.
      
      Clear it explicitly in this case.
      
      Fixes: 42a7e82c6792 ("mac80211: Do not restart scheduled scan if multiple scan plans are set")
      Signed-off-by: NEliad Peller <eliadx.peller@intel.com>
      Signed-off-by: NEmmanuel Grumbach <emmanuel.grumbach@intel.com>
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      b9f628fc
    • E
      mac80211: avoid ROC during hw restart · 470f4d61
      Eliad Peller 提交于
      Defer ROC requests during hw restart, as the driver
      might not be fully configured in this stage (e.g.
      channel contexts were not added yet)
      Signed-off-by: NEliad Peller <eliadx.peller@intel.com>
      Signed-off-by: NEmmanuel Grumbach <emmanuel.grumbach@intel.com>
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      470f4d61
    • J
      mac80211: fix remain-on-channel cancellation · e6a8a3aa
      Johannes Berg 提交于
      Ilan's previous commit 1b894521 ("mac80211: handle HW
      ROC expired properly") neglected to take into account that
      hw_begun was now always set in the software implementation
      as well as the offloaded case.
      
      Fix hw_begun to only apply to the offloaded case to make
      the check in Ilan's commit safe and correct.
      Reported-by: NJouni Malinen <j@w1.fi>
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      e6a8a3aa
    • J
      mac80211: recalculate SW ROC only when needed · e9db4557
      Johannes Berg 提交于
      The current (new) code recalculates the new work timeout
      for software remain-on-channel whenever any item started.
      In two of the callers of ieee80211_handle_roc_started(),
      this is completely pointless since they're for hardware
      and will skip the recalculation entirely; it's necessary
      only in the case of having just added a new item to the
      list, as in the last remaining case the recalculation had
      just been done.
      
      This last case, however, is also problematic - if one of
      the items on the list actually expires during the recalc
      the list iteration outside becomes corrupted and crashes.
      
      Fix this by moving the recalculation to the only place
      where it's required.
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      e9db4557
  7. 15 12月, 2015 4 次提交
  8. 07 12月, 2015 1 次提交
    • I
      mac80211: handle HW ROC expired properly · 1b894521
      Ilan Peer 提交于
      In case of HW ROC, when the driver reports that the ROC expired,
      it is not sufficient to purge the ROCs based on the remaining
      time, as it possible that the device finished the ROC session
      before the actual requested duration.
      
      To handle such cases, in case of ROC expired notification from
      the driver, complete all the ROCs which are marked with hw_begun,
      regardless of the remaining duration.
      Signed-off-by: NIlan Peer <ilan.peer@intel.com>
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      1b894521
  9. 04 12月, 2015 18 次提交
  10. 03 12月, 2015 3 次提交
    • J
      mac80211: fix off-channel mgmt-tx uninitialized variable usage · c1df932c
      Johannes Berg 提交于
      In the last change here, I neglected to update the cookie in one code
      path: when a mgmt-tx has no real cookie sent to userspace as it doesn't
      wait for a response, but is off-channel. The original code used the SKB
      pointer as the cookie and always assigned the cookie to the TX SKB in
      ieee80211_start_roc_work(), but my change turned this around and made
      the code rely on a valid cookie being passed in.
      
      Unfortunately, the off-channel no-wait TX path wasn't assigning one at
      all, resulting in an uninitialized stack value being used. This wasn't
      handed back to userspace as a cookie (since in the no-wait case there
      isn't a cookie), but it was tested for non-zero to distinguish between
      mgmt-tx and off-channel.
      
      Fix this by assigning a dummy non-zero cookie unconditionally, and get
      rid of a misleading comment and some dead code while at it. I'll clean
      up the ACK SKB handling separately later.
      
      Fixes: 3b79af97 ("mac80211: stop using pointers as userspace cookies")
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      c1df932c
    • A
      mac80211: do not actively scan DFS channels · 4e39ccac
      Antonio Quartulli 提交于
      DFS channels should not be actively scanned as we can't be sure
      if we are allowed or not.
      
      If the current channel is in the DFS band, active scan might be
      performed after CSA, but we have no guarantee about other channels,
      therefore it is safer to prevent active scanning at all.
      
      Cc: stable@vger.kernel.org
      Signed-off-by: NAntonio Quartulli <antonio@open-mesh.com>
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      4e39ccac
    • E
      mac80211: don't teardown sdata on sdata stop · 835112b2
      Eliad Peller 提交于
      Interfaces are being initialized (setup) on addition,
      and torn down on removal.
      
      However, p2p device is being torn down when stopped,
      resulting in the next p2p start operation being done
      on uninitialized interface.
      
      Solve it by calling ieee80211_teardown_sdata() only
      on interface removal (for the non-netdev case).
      Signed-off-by: NEliad Peller <eliadx.peller@intel.com>
      Signed-off-by: NEmmanuel Grumbach <emmanuel.grumbach@intel.com>
      [squashed in fix to call teardown after unregister]
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      835112b2