1. 09 11月, 2018 2 次提交
    • J
      cfg80211: add peer measurement with FTM initiator API · 9bb7e0f2
      Johannes Berg 提交于
      Add a new "peer measurement" API, that can be used to measure
      certain things related to a peer. Right now, only implement
      FTM (flight time measurement) over it, but the idea is that
      it'll be extensible to also support measuring the necessary
      things to calculate e.g. angle-of-arrival for WiGig.
      
      The API is structured to have a generic list of peers and
      channels to measure with/on, and then for each of those a
      set of measurements (again, only FTM right now) to perform.
      
      Results are sent to the requesting socket, including a final
      complete message.
      
      Closing the controlling netlink socket will abort a running
      measurement.
      
      v3:
       - add a bit to report "final" for partial results
       - remove list keeping etc. and just unicast out the results
         to the requester (big code reduction ...)
       - also send complete message unicast, and as a result
         remove the multicast group
       - separate out struct cfg80211_pmsr_ftm_request_peer
         from struct cfg80211_pmsr_request_peer
       - document timeout == 0 if no timeout
       - disallow setting timeout nl80211 attribute to 0,
         must not include attribute for no timeout
       - make MAC address randomization optional
       - change num bursts exponent default to 0 (1 burst, rather
         rather than the old default of 15==don't care)
      
      v4:
       - clarify NL80211_ATTR_TIMEOUT documentation
      
      v5:
       - remove unnecessary nl80211 multicast/family changes
       - remove partial results bit/flag, final is sufficient
       - add max_bursts_exponent, max_ftms_per_burst to capability
       - rename "frames per burst" -> "FTMs per burst"
      
      v6:
       - rename cfg80211_pmsr_free_wdev() to cfg80211_pmsr_wdev_down()
         and call it in leave, so the device can't go down with any
         pending measurements
      
      v7:
       - wording fixes (Lior)
       - fix ftm.max_bursts_exponent to allow having the limit of 0 (Lior)
      
      v8:
       - copyright statements
       - minor coding style fixes
       - fix error path leak
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      9bb7e0f2
    • J
      cfg80211: tracing: avoid 'idx' variable · aaaa10e0
      Johannes Berg 提交于
      This variable shadows something that gets generated inside
      the tracing macros, which causes sparse to warn. Avoid it
      so sparse output is more readable, even if it doesn't seem
      to cause any trouble.
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      aaaa10e0
  2. 12 10月, 2018 1 次提交
    • A
      nl80211: Add per peer statistics to compute FCS error rate · 0d4e14a3
      Ankita Bajaj 提交于
      Add support for drivers to report the total number of MPDUs received
      and the number of MPDUs received with an FCS error from a specific
      peer. These counters will be incremented only when the TA of the
      frame matches the MAC address of the peer irrespective of FCS
      error.
      
      It should be noted that the TA field in the frame might be corrupted
      when there is an FCS error and TA matching logic would fail in such
      cases. Hence, FCS error counter might not be fully accurate, but it can
      provide help in detecting bad RX links in significant number of cases.
      This FCS error counter without full accuracy can be used, e.g., to
      trigger a kick-out of a connected client with a bad link in AP mode to
      force such a client to roam to another AP.
      Signed-off-by: NAnkita Bajaj <bankita@codeaurora.org>
      Signed-off-by: NJouni Malinen <jouni@codeaurora.org>
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      0d4e14a3
  3. 11 10月, 2018 2 次提交
  4. 10 10月, 2018 1 次提交
  5. 02 10月, 2018 13 次提交
  6. 01 10月, 2018 2 次提交
    • Y
      cfg80211: fix use-after-free in reg_process_hint() · 1db58529
      Yu Zhao 提交于
      reg_process_hint_country_ie() can free regulatory_request and return
      REG_REQ_ALREADY_SET. We shouldn't use regulatory_request after it's
      called. KASAN error was observed when this happens.
      
      BUG: KASAN: use-after-free in reg_process_hint+0x839/0x8aa [cfg80211]
      Read of size 4 at addr ffff8800c430d434 by task kworker/1:3/89
      <snipped>
      Workqueue: events reg_todo [cfg80211]
      Call Trace:
       dump_stack+0xc1/0x10c
       ? _atomic_dec_and_lock+0x1ad/0x1ad
       ? _raw_spin_lock_irqsave+0xa0/0xd2
       print_address_description+0x86/0x26f
       ? reg_process_hint+0x839/0x8aa [cfg80211]
       kasan_report+0x241/0x29b
       reg_process_hint+0x839/0x8aa [cfg80211]
       reg_todo+0x204/0x5b9 [cfg80211]
       process_one_work+0x55f/0x8d0
       ? worker_detach_from_pool+0x1b5/0x1b5
       ? _raw_spin_unlock_irq+0x65/0xdd
       ? _raw_spin_unlock_irqrestore+0xf3/0xf3
       worker_thread+0x5dd/0x841
       ? kthread_parkme+0x1d/0x1d
       kthread+0x270/0x285
       ? pr_cont_work+0xe3/0xe3
       ? rcu_read_unlock_sched_notrace+0xca/0xca
       ret_from_fork+0x22/0x40
      
      Allocated by task 2718:
       set_track+0x63/0xfa
       __kmalloc+0x119/0x1ac
       regulatory_hint_country_ie+0x38/0x329 [cfg80211]
       __cfg80211_connect_result+0x854/0xadd [cfg80211]
       cfg80211_rx_assoc_resp+0x3bc/0x4f0 [cfg80211]
      smsc95xx v1.0.6
       ieee80211_sta_rx_queued_mgmt+0x1803/0x7ed5 [mac80211]
       ieee80211_iface_work+0x411/0x696 [mac80211]
       process_one_work+0x55f/0x8d0
       worker_thread+0x5dd/0x841
       kthread+0x270/0x285
       ret_from_fork+0x22/0x40
      
      Freed by task 89:
       set_track+0x63/0xfa
       kasan_slab_free+0x6a/0x87
       kfree+0xdc/0x470
       reg_process_hint+0x31e/0x8aa [cfg80211]
       reg_todo+0x204/0x5b9 [cfg80211]
       process_one_work+0x55f/0x8d0
       worker_thread+0x5dd/0x841
       kthread+0x270/0x285
       ret_from_fork+0x22/0x40
      <snipped>
      Signed-off-by: NYu Zhao <yuzhao@google.com>
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      1db58529
    • S
      cfg80211: fix wext-compat memory leak · 848e616e
      Stefan Seyfried 提交于
      cfg80211_wext_giwrate and sinfo.pertid might allocate sinfo.pertid via
      rdev_get_station(), but never release it. Fix that.
      
      Fixes: 8689c051 ("cfg80211: dynamically allocate per-tid stats for station info")
      Signed-off-by: NStefan Seyfried <seife+kernel@b1-systems.com>
      [johannes: fix error path, use cfg80211_sinfo_release_content(), add Fixes]
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      848e616e
  7. 28 9月, 2018 1 次提交
  8. 27 9月, 2018 1 次提交
  9. 26 9月, 2018 1 次提交
  10. 10 9月, 2018 1 次提交
    • J
      cfg80211: Address some corner cases in scan result channel updating · 119f94a6
      Jouni Malinen 提交于
      cfg80211_get_bss_channel() is used to update the RX channel based on the
      available frame payload information (channel number from DSSS Parameter
      Set element or HT Operation element). This is needed on 2.4 GHz channels
      where frames may be received on neighboring channels due to overlapping
      frequency range.
      
      This might of some use on the 5 GHz band in some corner cases, but
      things are more complex there since there is no n:1 or 1:n mapping
      between channel numbers and frequencies due to multiple different
      starting frequencies in different operating classes. This could result
      in ieee80211_channel_to_frequency() returning incorrect frequency and
      ieee80211_get_channel() returning incorrect channel information (or
      indication of no match). In the previous implementation, this could
      result in some scan results being dropped completely, e.g., for the 4.9
      GHz channels. That prevented connection to such BSSs.
      
      Fix this by using the driver-provided channel pointer if
      ieee80211_get_channel() does not find matching channel data for the
      channel number in the frame payload and if the scan is done with 5 MHz
      or 10 MHz channel bandwidth. While doing this, also add comments
      describing what the function is trying to achieve to make it easier to
      understand what happens here and why.
      Signed-off-by: NJouni Malinen <jouni@codeaurora.org>
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      119f94a6
  11. 05 9月, 2018 4 次提交
  12. 03 9月, 2018 1 次提交
    • D
      cfg80211: fix a type issue in ieee80211_chandef_to_operating_class() · 8442938c
      Dan Carpenter 提交于
      The "chandef->center_freq1" variable is a u32 but "freq" is a u16 so we
      are truncating away the high bits.  I noticed this bug because in commit
      9cf0a0b4 ("cfg80211: Add support for 60GHz band channels 5 and 6")
      we made "freq <= 56160 + 2160 * 6" a valid requency when before it was
      only "freq <= 56160 + 2160 * 4" that was valid.  It introduces a static
      checker warning:
      
          net/wireless/util.c:1571 ieee80211_chandef_to_operating_class()
          warn: always true condition '(freq <= 56160 + 2160 * 6) => (0-u16max <= 69120)'
      
      But really we probably shouldn't have been truncating the high bits
      away to begin with.
      Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      8442938c
  13. 30 8月, 2018 1 次提交
  14. 29 8月, 2018 1 次提交
    • B
      cfg80211: clarify frames covered by average ACK signal report · 9c06602b
      Balaji Pothunoori 提交于
      Modify the API to include all ACK frames in average ACK
      signal strength reporting, not just ACKs for data frames.
      Make exposing the data conditional on implementing the
      extended feature flag.
      
      This is how it was really implemented in mac80211, update
      the code there to use the new defines and clean up some of
      the setting code.
      
      Keep nl80211.h source compatibility by keeping the old names.
      Signed-off-by: NBalaji Pothunoori <bpothuno@codeaurora.org>
      [rewrite commit log, change compatibility to be old=new
       instead of the other way around, update kernel-doc,
       roll in mac80211 changes, make mac80211 depend on valid
       bit instead of HW flag]
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      9c06602b
  15. 28 8月, 2018 6 次提交
  16. 20 8月, 2018 1 次提交
  17. 24 7月, 2018 1 次提交