Skip to content
Snippets Groups Projects
  1. Feb 06, 2014
  2. Dec 05, 2013
    • Eliad Peller's avatar
      cfg80211: don't "leak" uncompleted scans · 4a58e7c3
      Eliad Peller authored
      
      ___cfg80211_scan_done() can be called in some cases
      (e.g. on NETDEV_DOWN) before the low level driver
      notified scan completion (which is indicated by
      passing leak=true).
      
      Clearing rdev->scan_req in this case is buggy, as
      scan_done_wk might have already being queued/running
      (and can't be flushed as it takes rtnl()).
      
      If a new scan will be requested at this stage, the
      scan_done_wk will try freeing it (instead of the
      previous scan), and this will later result in
      a use after free.
      
      Simply remove the "leak" option, and replace it with
      a standard WARN_ON.
      
      An example backtrace after such crash:
      Unable to handle kernel paging request at virtual address fffffee5
      pgd = c0004000
      [fffffee5] *pgd=9fdf6821, *pte=00000000, *ppte=00000000
      Internal error: Oops: 17 [#1] SMP ARM
      PC is at cfg80211_scan_done+0x28/0xc4 [cfg80211]
      LR is at __ieee80211_scan_completed+0xe4/0x2dc [mac80211]
      [<bf0077b0>] (cfg80211_scan_done+0x28/0xc4 [cfg80211])
      [<bf0973d4>] (__ieee80211_scan_completed+0xe4/0x2dc [mac80211])
      [<bf0982cc>] (ieee80211_scan_work+0x94/0x4f0 [mac80211])
      [<c005fd10>] (process_one_work+0x1b0/0x4a8)
      [<c0060404>] (worker_thread+0x138/0x37c)
      [<c0066d70>] (kthread+0xa4/0xb0)
      
      Signed-off-by: default avatarEliad Peller <eliad@wizery.com>
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      4a58e7c3
    • Barak Bercovitz's avatar
      cfg80211: stop sched scan only when needed · 24d584d7
      Barak Bercovitz authored
      
      cfg80211_leave stops sched scan when any station vif
      is leaving. Add an explicit check and call it only
      when the relevant vif (the one we scan on) is leaving.
      
      Signed-off-by: default avatarBarak Bercovitz <barak@wizery.com>
      [Eliad - changed the commit message a bit]
      Signed-off-by: default avatarEliad Peller <eliad@wizery.com>
      [Johannes - add ASSERT_RTNL since that protects the pointer]
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      24d584d7
  3. Dec 02, 2013
  4. Nov 25, 2013
    • Luis R. Rodriguez's avatar
      cfg80211: move regulatory flags to their own variable · a2f73b6c
      Luis R. Rodriguez authored
      
      We'll expand this later, this will make it easier to
      classify and review what things are related to regulatory
      or not.
      
      Coccinelle only missed 4 hits, which I had to do manually,
      supplying the SmPL in case of merge conflicts.
      
      @@
      struct wiphy *wiphy;
      @@
      -wiphy->flags |= WIPHY_FLAG_CUSTOM_REGULATORY
      +wiphy->regulatory_flags |= REGULATORY_CUSTOM_REG
      @@
      expression e;
      @@
      -e->flags |= WIPHY_FLAG_CUSTOM_REGULATORY
      +e->regulatory_flags |= REGULATORY_CUSTOM_REG
      @@
      struct wiphy *wiphy;
      @@
      -wiphy->flags &= ~WIPHY_FLAG_CUSTOM_REGULATORY
      +wiphy->regulatory_flags &= ~REGULATORY_CUSTOM_REG
      @@
      struct wiphy *wiphy;
      @@
      -wiphy->flags & WIPHY_FLAG_CUSTOM_REGULATORY
      +wiphy->regulatory_flags & REGULATORY_CUSTOM_REG
      
      @@
      struct wiphy *wiphy;
      @@
      -wiphy->flags |= WIPHY_FLAG_STRICT_REGULATORY
      +wiphy->regulatory_flags |= REGULATORY_STRICT_REG
      @@
      expression e;
      @@
      -e->flags |= WIPHY_FLAG_STRICT_REGULATORY
      +e->regulatory_flags |= REGULATORY_STRICT_REG
      @@
      struct wiphy *wiphy;
      @@
      -wiphy->flags &= ~WIPHY_FLAG_STRICT_REGULATORY
      +wiphy->regulatory_flags &= ~REGULATORY_STRICT_REG
      @@
      struct wiphy *wiphy;
      @@
      -wiphy->flags & WIPHY_FLAG_STRICT_REGULATORY
      +wiphy->regulatory_flags & REGULATORY_STRICT_REG
      
      @@
      struct wiphy *wiphy;
      @@
      -wiphy->flags |= WIPHY_FLAG_DISABLE_BEACON_HINTS
      +wiphy->regulatory_flags |= REGULATORY_DISABLE_BEACON_HINTS
      @@
      expression e;
      @@
      -e->flags |= WIPHY_FLAG_DISABLE_BEACON_HINTS
      +e->regulatory_flags |= REGULATORY_DISABLE_BEACON_HINTS
      @@
      struct wiphy *wiphy;
      @@
      -wiphy->flags &= ~WIPHY_FLAG_DISABLE_BEACON_HINTS
      +wiphy->regulatory_flags &= ~REGULATORY_DISABLE_BEACON_HINTS
      @@
      struct wiphy *wiphy;
      @@
      -wiphy->flags & WIPHY_FLAG_DISABLE_BEACON_HINTS
      +wiphy->regulatory_flags & REGULATORY_DISABLE_BEACON_HINTS
      
      Generated-by: Coccinelle SmPL
      Cc: Julia Lawall <julia.lawall@lip6.fr>
      Cc: Peter Senna Tschudin <peter.senna@gmail.com>
      Cc: Mihir Shete <smihir@qti.qualcomm.com>
      Cc: Henri Bahini <hbahini@qca.qualcomm.com>
      Cc: Tushnim Bhattacharyya <tushnimb@qca.qualcomm.com>
      Signed-off-by: default avatarLuis R. Rodriguez <mcgrof@do-not-panic.com>
      [fix up whitespace damage, overly long lines]
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      a2f73b6c
    • Johannes Berg's avatar
      cfg80211: don't allow drivers to unset NL80211_FEATURE_SCAN_FLUSH · 00c3a6ed
      Johannes Berg authored
      
      As the flag is entirely implemented in cfg80211, it should
      have been a global feature flag (which I believe didn't
      exist at the time). However, there's no reason to allow
      drivers to unset the flag, so don't allow it and remove
      the validation of NL80211_SCAN_FLAG_FLUSH.
      
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      00c3a6ed
    • Johannes Berg's avatar
      cfg80211: disable 5/10 MHz support for all drivers · 9f16d84a
      Johannes Berg authored
      
      Due to nl80211 API breakage, 5/10 MHz support is broken for
      all drivers. Fixing it requires adding new API, but that
      can't be done as a bugfix commit since that would require
      either updating all APIs in the trees needing the bugfix or
      cause different kernels to have incompatible API.
      
      Therefore, just disable 5/10 MHz support for all drivers.
      
      Cc: stable@vger.kernel.org [3.12]
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      9f16d84a
  5. Oct 09, 2013
  6. Sep 26, 2013
  7. Jul 31, 2013
  8. Jul 16, 2013
    • Amitkumar Karwar's avatar
      cfg80211/nl80211: Add packet coalesce support · be29b99a
      Amitkumar Karwar authored
      
      In most cases, host that receives IPv4 and IPv6 multicast/broadcast
      packets does not do anything with these packets. Therefore the
      reception of these unwanted packets causes unnecessary processing
      and power consumption.
      
      Packet coalesce feature helps to reduce number of received
      interrupts to host by buffering these packets in firmware/hardware
      for some predefined time. Received interrupt will be generated when
      one of the following events occur.
      a) Expiration of hardware timer whose expiration time is set to
      maximum coalescing delay of matching coalesce rule.
      b) Coalescing buffer in hardware reaches it's limit.
      c) Packet doesn't match any of the configured coalesce rules.
      
      This patch adds set/get configuration support for packet coalesce.
      User needs to configure following parameters for creating a coalesce
      rule.
      a) Maximum coalescing delay
      b) List of packet patterns which needs to be matched
      c) Condition for coalescence. pattern 'match' or 'no match'
      Multiple such rules can be created.
      
      This feature needs to be advertised during driver initialization.
      Drivers are supposed to do required firmware/hardware settings based
      on user configuration.
      
      Signed-off-by: default avatarAmitkumar Karwar <akarwar@marvell.com>
      Signed-off-by: default avatarBing Zhao <bzhao@marvell.com>
      [fix kernel-doc, change free function, fix copy/paste error]
      Signed-off-by: default avatarJohannes Berg <johannes@sipsolutions.net>
      be29b99a
  9. Jun 24, 2013
  10. Jun 04, 2013
    • Johannes Berg's avatar
      cfg80211: make wiphy index start at 0 again · 9b881963
      Johannes Berg authored
      
      The change to use atomic_inc_return() for assigning the wiphy
      index made the first wiphy index 1 instead of 0. This is fine,
      but we all habitually type "phy0" when we're testing, so make
      it go back to 0 instead of 1 by subtracting 1 from the index.
      
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      9b881963
    • Johannes Berg's avatar
      cfg80211: fix potential deadlock regression · 256c90de
      Johannes Berg authored
      
      My big locking cleanups caused a problem by registering the
      rfkill instance with the RTNL held, while the callback also
      acquires the RTNL. This potentially causes a deadlock since
      the two locks used (rfkill mutex and RTNL) can be acquired
      in two different orders. Fix this by (un)registering rfkill
      without holding the RTNL. This needs to be done after the
      device struct is registered, but that can also be done w/o
      holding the RTNL.
      
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      256c90de
    • Johannes Berg's avatar
      cfg80211: separate internal SME implementation · ceca7b71
      Johannes Berg authored
      
      The current internal SME implementation in cfg80211 is
      very mixed up with the MLME handling, which has been
      causing issues for a long time. There are three things
      that the implementation has to provide:
       * a basic SME implementation for nl80211's connect()
         call (for drivers implementing auth/assoc, which is
         really just mac80211) and wireless extensions
       * MLME events for the userspace SME
       * SME events (connected, disconnected etc.) for all
         different SME implementation possibilities (driver,
         cfg80211 and userspace)
      
      To achieve these goals it isn't necessary to track the
      software SME's connection status outside of it's state
      (which is the part that caused many issues.) Instead,
      track it only in the SME data (wdev->conn) and in the
      general case only track whether the wdev is connected
      or not (via wdev->current_bss.)
      
      Also separate the internal implementation to not have
      callbacks from the SME events, but rather call it from
      the API functions that the driver (or rather mac80211)
      calls. This separates the code better.
      
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      ceca7b71
  11. Jun 03, 2013
  12. May 28, 2013
  13. May 27, 2013
  14. May 24, 2013
  15. May 16, 2013
  16. Mar 24, 2013
    • Johannes Berg's avatar
      cfg80211: always check for scan end on P2P device · f9f47529
      Johannes Berg authored
      
      If a P2P device wdev is removed while it has a scan, then the
      scan completion might crash later as it is already freed by
      that time. To avoid the crash always check the scan completion
      when the P2P device is being removed for some reason. If the
      driver already canceled it, don't want and free it, otherwise
      warn and leak it to avoid later crashes.
      
      In order to do this, locking needs to be changed away from the
      rdev mutex (which can't always be guaranteed). For now, use
      the sched_scan_mtx instead, I'll rename it to just scan_mtx in
      a later patch.
      
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      f9f47529
  17. Mar 20, 2013
  18. Mar 06, 2013
    • Stanislaw Gruszka's avatar
      cfg80211/mac80211: disconnect on suspend · 81256969
      Stanislaw Gruszka authored
      
      If possible that after suspend, cfg80211 will receive request to
      disconnect what require action on interface that was removed during
      suspend.
      
      Problem can manifest itself by various warnings similar to below one:
      
      WARNING: at net/mac80211/driver-ops.h:12 ieee80211_bss_info_change_notify+0x2f9/0x300 [mac80211]()
      wlan0:  Failed check-sdata-in-driver check, flags: 0x4
      Call Trace:
       [<c043e0b3>] warn_slowpath_fmt+0x33/0x40
       [<f83707c9>] ieee80211_bss_info_change_notify+0x2f9/0x300 [mac80211]
       [<f83a660a>] ieee80211_recalc_ps_vif+0x2a/0x30 [mac80211]
       [<f83a6706>] ieee80211_set_disassoc+0xf6/0x500 [mac80211]
       [<f83a9441>] ieee80211_mgd_deauth+0x1f1/0x280 [mac80211]
       [<f8381b36>] ieee80211_deauth+0x16/0x20 [mac80211]
       [<f8261e70>] cfg80211_mlme_down+0x70/0xc0 [cfg80211]
       [<f8264de1>] __cfg80211_disconnect+0x1b1/0x1d0 [cfg80211]
      
      To fix the problem disconnect from any associated network before
      suspend. User space is responsible to establish connection again
      after resume. This basically need to be done by user space anyway,
      because associated stations can go away during suspend (for example
      NetworkManager disconnects on suspend and connect on resume by default).
      
      Patch also handle situation when driver refuse to suspend with wowlan
      configured and try to suspend again without it.
      
      Signed-off-by: default avatarStanislaw Gruszka <sgruszka@redhat.com>
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      81256969
  19. Feb 27, 2013
  20. Feb 15, 2013
  21. Feb 11, 2013
  22. Jan 25, 2013
  23. Jan 16, 2013
  24. Jan 11, 2013
  25. Jan 03, 2013
  26. Nov 05, 2012
  27. Oct 23, 2012
  28. Oct 18, 2012
    • Felix Fietkau's avatar
      cfg80211: fix antenna gain handling · c4a9fafc
      Felix Fietkau authored
      
      No driver initializes chan->max_antenna_gain to something sensible, and
      the only place where it is being used right now is inside ath9k. This
      leads to ath9k potentially using less tx power than it can use, which can
      decrease performance/range in some rare cases.
      
      Rather than going through every single driver, this patch initializes
      chan->orig_mag in wiphy_register(), ignoring whatever value the driver
      left in there. If a driver for some reason wishes to limit it independent
      from regulatory rulesets, it can do so internally.
      
      Signed-off-by: default avatarFelix Fietkau <nbd@openwrt.org>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      c4a9fafc
Loading