1. 20 3月, 2014 6 次提交
    • E
      cfg80211/mac80211: ignore signal if the frame was heard on wrong channel · 3afc2167
      Emmanuel Grumbach 提交于
      On 2.4Ghz band, the channels overlap since the delta
      between different channels is 5Mhz while the width of the
      receiver is 20Mhz (at least).
      
      This means that we can hear beacons or probe responses from
      adjacent channels. These frames will have a significant
      lower RSSI which will feed all kinds of logic with inaccurate
      data. An obvious example is the roaming algorithm that will
      think our AP is getting weak and will try to move to another
      AP.
      
      In order to avoid this, update the signal only if the frame
      has been heard on the same channel as the one advertised by
      the AP in its DS / HT IEs.
      We refrain from updating the values only if the AP is
      already in the BSS list so that we will still have a valid
      (but inaccurate) value if the AP was heard on an adjacent
      channel only.
      
      To achieve this, stop taking the channel from DS / HT IEs
      in mac80211. The DS / HT IEs is taken into account to
      discard the frame if it was received on a disabled channel.
      This can happen due to the same phenomenon: the frame is
      sent on channel 12, but heard on channel 11 while channel
      12 can be disabled on certain devices. Since this check
      is done in cfg80211, stop even checking this in mac80211.
      Signed-off-by: NEmmanuel Grumbach <emmanuel.grumbach@intel.com>
      [remove unused rx_freq variable]
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      3afc2167
    • A
      mac80211: release sched_scan_sdata when stopping sched scan · 71228a1e
      Alexander Bondar 提交于
      Assuming sched_scan_stop operation is synchronous the driver may not
      necessary call ieee80211_sched_scan_stopped_work. Since this work is
      the only place where sched_scan_sdata is released we can possibly run
      into situation when it is never released. Fix this by releasing it
      just after calling drv_sched_scan_stop.
      Signed-off-by: NAlexander Bondar <alexander.bondar@intel.com>
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      71228a1e
    • M
      mac80211: fix WPA with VLAN on AP side with ps-sta again · 112c44b2
      Michael Braun 提交于
      commit de74a1d9
        "mac80211: fix WPA with VLAN on AP side with ps-sta"
      fixed an issue where queued multicast packets would
      be sent out encrypted with the key of an other bss.
      
      commit "7cbf9d01"
        "mac80211: fix oops on mesh PS broadcast forwarding"
      essentially reverted it, because vif.type cannot be AP_VLAN
      due to the check to vif.type in ieee80211_get_buffered_bc before.
      
      As the later commit intended to fix the MESH case, fix it
      by checking for IFTYPE_AP instead of IFTYPE_AP_VLAN.
      
      Cc: stable@vger.kernel.org
      Fixes: 7cbf9d01 ("mac80211: fix oops on mesh PS broadcast forwarding")
      Signed-off-by: NMichael Braun <michael-dev@fami-braun.de>
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      112c44b2
    • J
      mac80211: fix suspend vs. authentication race · 1a1cb744
      Johannes Berg 提交于
      Since Stanislaw's patch removing the quiescing code, mac80211 had
      a race regarding suspend vs. authentication: as cfg80211 doesn't
      track authentication attempts, it can't abort them. Therefore the
      attempts may be kept running while suspending, which can lead to
      all kinds of issues, in at least some cases causing an error in
      iwlmvm firmware.
      
      Fix this by aborting the authentication attempt when suspending.
      
      Cc: stable@vger.kernel.org
      Fixes: 12e7f517 ("mac80211: cleanup generic suspend/resume procedures")
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      1a1cb744
    • J
      mac80211: verify deauthentication and return error on failure · c9c3a060
      Johannes Berg 提交于
      When still authenticating the mac80211 code handling a deauthentication
      requests from userspace doesn't verify that the request is valid in any
      way, fix that. Additionally, it never returns an error, even if there's
      no connection or authentication attempt, fix that as well.
      
      While at it, move the message to not print a message in the error case
      and to distinguish between the two cases.
      
      Also simplify the code by duplicating the cfg80211 call.
      Reviewed-by: NLuciano Coelho <luciano.coelho@intel.com>
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      c9c3a060
    • J
      mac80211: fix potential use-after-free · d2722f8b
      Johannes Berg 提交于
      The bss struct might be freed in ieee80211_rx_bss_put(),
      so we shouldn't use it afterwards.
      
      Cc: stable@vger.kernel.org (3.10+)
      Fixes: 817cee76 ("mac80211: track AP's beacon rate and give it to the driver")
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      d2722f8b
  2. 03 3月, 2014 2 次提交
  3. 26 2月, 2014 1 次提交
  4. 21 2月, 2014 2 次提交
  5. 20 2月, 2014 2 次提交
  6. 13 2月, 2014 1 次提交
    • J
      mac80211: add NAPI support back · 06d181a8
      Johannes Berg 提交于
      NAPI was originally added to mac80211 a long time ago (by John in
      commit 4e6cbfd0 in July 2010), but then removed years later
      (by Stanislaw in commit 30c97120 in February 2013). No driver
      ever used it, so that was fine.
      
      Now I'm adding support for NAPI to our driver, so add some code
      to mac80211 again  to support NAPI. John was originally wrapping
      some (but not nearly all NAPI-related functions), but that doesn't
      scale very well with the number of functions that are there, some
      of which are even only inlines. Thus, instead of doing that, let
      the drivers manage the NAPI struct, except for napi_add() which is
      needed so mac80211 knows how to call napi_gro_receive().
      
      Also remove some no longer needed definitions that were left when
      NAPI support was removed.
      Reviewed-by: NEmmanuel Grumbach <emmanuel.grumbach@intel.com>
      Reviewed-by: NEyal Shapira <eyal@wizery.com>
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      06d181a8
  7. 12 2月, 2014 2 次提交
  8. 11 2月, 2014 3 次提交
  9. 06 2月, 2014 10 次提交
    • J
      mac80211: remove superfluous band variable · 4bf332c7
      Johannes Berg 提交于
      We already have a band variable, so the new one is just
      shadowing it, but the existing one already holds the
      same value so just remove the inner one.
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      4bf332c7
    • J
      mac80211: fix virtual monitor interface iteration · fab57a6c
      Johannes Berg 提交于
      During channel context assignment, the interface should
      be found by interface iteration, so we need to assign the
      pointer before the channel context.
      Reported-by: NEmmanuel Grumbach <emmanuel.grumbach@intel.com>
      Tested-by: NEmmanuel Grumbach <emmanuel.grumbach@intel.com>
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      fab57a6c
    • J
      mac80211: fix fragmentation code, particularly for encryption · 338f977f
      Johannes Berg 提交于
      The "new" fragmentation code (since my rewrite almost 5 years ago)
      erroneously sets skb->len rather than using skb_trim() to adjust
      the length of the first fragment after copying out all the others.
      This leaves the skb tail pointer pointing to after where the data
      originally ended, and thus causes the encryption MIC to be written
      at that point, rather than where it belongs: immediately after the
      data.
      
      The impact of this is that if software encryption is done, then
       a) encryption doesn't work for the first fragment, the connection
          becomes unusable as the first fragment will never be properly
          verified at the receiver, the MIC is practically guaranteed to
          be wrong
       b) we leak up to 8 bytes of plaintext (!) of the packet out into
          the air
      
      This is only mitigated by the fact that many devices are capable
      of doing encryption in hardware, in which case this can't happen
      as the tail pointer is irrelevant in that case. Additionally,
      fragmentation is not used very frequently and would normally have
      to be configured manually.
      
      Fix this by using skb_trim() properly.
      
      Cc: stable@vger.kernel.org
      Fixes: 2de8e0d9 ("mac80211: rewrite fragmentation")
      Reported-by: NJouni Malinen <j@w1.fi>
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      338f977f
    • S
      mac80211: Fix IBSS disconnect · d4c80d9d
      Sujith Manoharan 提交于
      Currently, when a station leaves an IBSS network, the
      corresponding BSS is not dropped from cfg80211 if there are
      other active stations in the network. But, the small
      window that is present when trying to determine a station's
      status based on IEEE80211_IBSS_MERGE_INTERVAL introduces
      a race.
      
      Instead of trying to keep the BSS, always remove it when
      leaving an IBSS network. There is not much benefit to retain
      the BSS entry since it will be added with a subsequent join
      operation.
      
      This fixes an issue where a dangling BSS entry causes ath9k
      to wait for a beacon indefinitely.
      
      Cc: <stable@vger.kernel.org>
      Reported-by: NSimon Wunderlich <sw@simonwunderlich.de>
      Signed-off-by: NSujith Manoharan <c_manoha@qca.qualcomm.com>
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      d4c80d9d
    • E
      mac80211: release the channel in error path in start_ap · 0297ea17
      Emmanuel Grumbach 提交于
      When the driver cannot start the AP or when the assignement
      of the beacon goes wrong, we need to unassign the vif.
      
      Cc: stable@vger.kernel.org
      Signed-off-by: NEmmanuel Grumbach <emmanuel.grumbach@intel.com>
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      0297ea17
    • E
      mac80211: avoid deadlock revealed by lockdep · 8ffcc704
      Emmanuel Grumbach 提交于
      sdata->u.ap.request_smps_work can’t be flushed synchronously
      under wdev_lock(wdev) since ieee80211_request_smps_ap_work
      itself locks the same lock.
      While at it, reset the driver_smps_mode when the ap is
      stopped to its default: OFF.
      
      This solves:
      
      ======================================================
      [ INFO: possible circular locking dependency detected ]
      3.12.0-ipeer+ #2 Tainted: G           O
      -------------------------------------------------------
      rmmod/2867 is trying to acquire lock:
        ((&sdata->u.ap.request_smps_work)){+.+...}, at: [<c105b8d0>] flush_work+0x0/0x90
      
      but task is already holding lock:
        (&wdev->mtx){+.+.+.}, at: [<f9b32626>] cfg80211_stop_ap+0x26/0x230 [cfg80211]
      
      which lock already depends on the new lock.
      
      the existing dependency chain (in reverse order) is:
      
      -> #1 (&wdev->mtx){+.+.+.}:
              [<c10aefa9>] lock_acquire+0x79/0xe0
              [<c1607a1a>] mutex_lock_nested+0x4a/0x360
              [<fb06288b>] ieee80211_request_smps_ap_work+0x2b/0x50 [mac80211]
              [<c105cdd8>] process_one_work+0x198/0x450
              [<c105d469>] worker_thread+0xf9/0x320
              [<c10669ff>] kthread+0x9f/0xb0
              [<c1613397>] ret_from_kernel_thread+0x1b/0x28
      
      -> #0 ((&sdata->u.ap.request_smps_work)){+.+...}:
              [<c10ae9df>] __lock_acquire+0x183f/0x1910
              [<c10aefa9>] lock_acquire+0x79/0xe0
              [<c105b917>] flush_work+0x47/0x90
              [<c105d867>] __cancel_work_timer+0x67/0xe0
              [<c105d90f>] cancel_work_sync+0xf/0x20
              [<fb0765cc>] ieee80211_stop_ap+0x8c/0x340 [mac80211]
              [<f9b3268c>] cfg80211_stop_ap+0x8c/0x230 [cfg80211]
              [<f9b0d8f9>] cfg80211_leave+0x79/0x100 [cfg80211]
              [<f9b0da72>] cfg80211_netdev_notifier_call+0xf2/0x4f0 [cfg80211]
              [<c160f2c9>] notifier_call_chain+0x59/0x130
              [<c106c6de>] __raw_notifier_call_chain+0x1e/0x30
              [<c106c70f>] raw_notifier_call_chain+0x1f/0x30
              [<c14f8213>] call_netdevice_notifiers_info+0x33/0x70
              [<c14f8263>] call_netdevice_notifiers+0x13/0x20
              [<c14f82a4>] __dev_close_many+0x34/0xb0
              [<c14f83fe>] dev_close_many+0x6e/0xc0
              [<c14f9c77>] rollback_registered_many+0xa7/0x1f0
              [<c14f9dd4>] unregister_netdevice_many+0x14/0x60
              [<fb06f4d9>] ieee80211_remove_interfaces+0xe9/0x170 [mac80211]
              [<fb055116>] ieee80211_unregister_hw+0x56/0x110 [mac80211]
              [<fa3e9396>] iwl_op_mode_mvm_stop+0x26/0xe0 [iwlmvm]
              [<f9b9d8ca>] _iwl_op_mode_stop+0x3a/0x70 [iwlwifi]
              [<f9b9d96f>] iwl_opmode_deregister+0x6f/0x90 [iwlwifi]
              [<fa405179>] __exit_compat+0xd/0x19 [iwlmvm]
              [<c10b8bf9>] SyS_delete_module+0x179/0x2b0
              [<c1613421>] sysenter_do_call+0x12/0x32
      
      Fixes: 687da132 ("mac80211: implement SMPS for AP")
      Cc: <stable@vger.kernel.org> [3.13]
      Reported-by: NIlan Peer <ilan.peer@intel.com>
      Signed-off-by: NEmmanuel Grumbach <emmanuel.grumbach@intel.com>
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      8ffcc704
    • E
      mac80211: move roc cookie assignment earlier · 2f617435
      Eliad Peller 提交于
      ieee80211_start_roc_work() might add a new roc
      to existing roc, and tell cfg80211 it has already
      started.
      
      However, this might happen before the roc cookie
      was set, resulting in REMAIN_ON_CHANNEL (started)
      event with null cookie. Consequently, it can make
      wpa_supplicant go out of sync.
      
      Fix it by setting the roc cookie earlier.
      
      Cc: stable@vger.kernel.org
      Signed-off-by: NEliad Peller <eliad@wizery.com>
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      2f617435
    • E
      mac80211: propagate STBC / LDPC flags to radiotap · 63c361f5
      Emmanuel Grumbach 提交于
      This capabilities weren't propagated to the radiotap header.
      We don't set here the VHT_KNOWN / MCS_HAVE flag because not
      all the low level drivers will know how to properly flag
      the frames, hence the low level driver will be in charge
      of setting IEEE80211_RADIOTAP_MCS_HAVE_FEC,
      IEEE80211_RADIOTAP_MCS_HAVE_STBC and / or
      IEEE80211_RADIOTAP_VHT_KNOWN_STBC according to its
      capabilities.
      Signed-off-by: NEmmanuel Grumbach <emmanuel.grumbach@intel.com>
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      63c361f5
    • E
      mac80211: move VHT related RX_FLAG to another variable · 1b8d242a
      Emmanuel Grumbach 提交于
      ieee80211_rx_status.flags is full. Define a new vht_flag
      variable to be able to set more VHT related flags and make
      room in flags.
      Signed-off-by: NEmmanuel Grumbach <emmanuel.grumbach@intel.com>
      Acked-by: Kalle Valo <kvalo@qca.qualcomm.com> [ath10k]
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      1b8d242a
    • E
      mac80211: remove unused radiotap vendor fields in ieee80211_rx_status · 0059b2b1
      Emmanuel Grumbach 提交于
      The purpose of this housekeeping is to make some room for
      VHT flags. The radiotap vendor fields weren't in use.
      Signed-off-by: NEmmanuel Grumbach <emmanuel.grumbach@intel.com>
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      0059b2b1
  10. 05 2月, 2014 11 次提交