1. 29 6月, 2019 2 次提交
  2. 01 6月, 2019 1 次提交
  3. 28 4月, 2019 1 次提交
    • J
      netlink: make validation more configurable for future strictness · 8cb08174
      Johannes Berg 提交于
      We currently have two levels of strict validation:
      
       1) liberal (default)
           - undefined (type >= max) & NLA_UNSPEC attributes accepted
           - attribute length >= expected accepted
           - garbage at end of message accepted
       2) strict (opt-in)
           - NLA_UNSPEC attributes accepted
           - attribute length >= expected accepted
      
      Split out parsing strictness into four different options:
       * TRAILING     - check that there's no trailing data after parsing
                        attributes (in message or nested)
       * MAXTYPE      - reject attrs > max known type
       * UNSPEC       - reject attributes with NLA_UNSPEC policy entries
       * STRICT_ATTRS - strictly validate attribute size
      
      The default for future things should be *everything*.
      The current *_strict() is a combination of TRAILING and MAXTYPE,
      and is renamed to _deprecated_strict().
      The current regular parsing has none of this, and is renamed to
      *_parse_deprecated().
      
      Additionally it allows us to selectively set one of the new flags
      even on old policies. Notably, the UNSPEC flag could be useful in
      this case, since it can be arranged (by filling in the policy) to
      not be an incompatible userspace ABI change, but would then going
      forward prevent forgetting attribute entries. Similar can apply
      to the POLICY flag.
      
      We end up with the following renames:
       * nla_parse           -> nla_parse_deprecated
       * nla_parse_strict    -> nla_parse_deprecated_strict
       * nlmsg_parse         -> nlmsg_parse_deprecated
       * nlmsg_parse_strict  -> nlmsg_parse_deprecated_strict
       * nla_parse_nested    -> nla_parse_nested_deprecated
       * nla_validate_nested -> nla_validate_nested_deprecated
      
      Using spatch, of course:
          @@
          expression TB, MAX, HEAD, LEN, POL, EXT;
          @@
          -nla_parse(TB, MAX, HEAD, LEN, POL, EXT)
          +nla_parse_deprecated(TB, MAX, HEAD, LEN, POL, EXT)
      
          @@
          expression NLH, HDRLEN, TB, MAX, POL, EXT;
          @@
          -nlmsg_parse(NLH, HDRLEN, TB, MAX, POL, EXT)
          +nlmsg_parse_deprecated(NLH, HDRLEN, TB, MAX, POL, EXT)
      
          @@
          expression NLH, HDRLEN, TB, MAX, POL, EXT;
          @@
          -nlmsg_parse_strict(NLH, HDRLEN, TB, MAX, POL, EXT)
          +nlmsg_parse_deprecated_strict(NLH, HDRLEN, TB, MAX, POL, EXT)
      
          @@
          expression TB, MAX, NLA, POL, EXT;
          @@
          -nla_parse_nested(TB, MAX, NLA, POL, EXT)
          +nla_parse_nested_deprecated(TB, MAX, NLA, POL, EXT)
      
          @@
          expression START, MAX, POL, EXT;
          @@
          -nla_validate_nested(START, MAX, POL, EXT)
          +nla_validate_nested_deprecated(START, MAX, POL, EXT)
      
          @@
          expression NLH, HDRLEN, MAX, POL, EXT;
          @@
          -nlmsg_validate(NLH, HDRLEN, MAX, POL, EXT)
          +nlmsg_validate_deprecated(NLH, HDRLEN, MAX, POL, EXT)
      
      For this patch, don't actually add the strict, non-renamed versions
      yet so that it breaks compile if I get it wrong.
      
      Also, while at it, make nla_validate and nla_parse go down to a
      common __nla_validate_parse() function to avoid code duplication.
      
      Ultimately, this allows us to have very strict validation for every
      new caller of nla_parse()/nlmsg_parse() etc as re-introduced in the
      next patch, while existing things will continue to work as is.
      
      In effect then, this adds fully strict validation for any new command.
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      8cb08174
  4. 03 4月, 2019 4 次提交
  5. 22 3月, 2019 10 次提交
  6. 22 2月, 2019 1 次提交
  7. 21 2月, 2019 3 次提交
  8. 14 2月, 2019 6 次提交
  9. 04 2月, 2019 4 次提交
    • L
      iwlwifi: mvm: config mac ctxt to HE before TLC · 9394662a
      Liad Kaufman 提交于
      If we have a station connecting HE, make sure that the
      MAC ctxt is updated with indication of this before
      setting the TLC rates via the TLC manager command.
      Signed-off-by: NLiad Kaufman <liad.kaufman@intel.com>
      Signed-off-by: NLuca Coelho <luciano.coelho@intel.com>
      9394662a
    • E
      iwlwifi: mvm: fix AP mode in WEP · 28916a16
      Emmanuel Grumbach 提交于
      Recently we started to send the WEP keys to the firmware so
      that we could use hardware Tx encryption also on newer
      devices that require the keys to be installed in the firmware
      for encryption (as opposed to older devices that can get
      the key in the Tx command for each Tx).
      
      When we implemented that, we forgot to remove the key when
      we remove a station leading to a situation where a station
      that connects and disconnects a lot of times exhausts the
      key database inside the firmware.
      
      A fix was made for that, but we always removed the same
      key: mvmvif->ap_wep_key which means that we removed the
      same key entry in the firmware. This can make sense since
      in WEP, the key is the same for all the stations, but the
      internal implementation of iwl_mvm_set_sta_key and
      iwl_mvm_remove_sta_key assumes that each station uses a
      different key in the firmware's key database.
      
      So now we got to the situation where we have a single
      ieee80211_key_conf instance that means, a single
      ieee80211_key_conf.hw_key_idx index for several stations
      and hence for several keys.
      ieee80211_key_conf.hw_key_idx is set to 0 when the first
      station associates, and then it is overwritten to 1 when
      the second station associates which is a buggy of course.
      This led to the following message upon the removal of the
      second station:
      
      iwlwifi 0000:00:03.0: offset 1 not used in fw key table.
      WARNING: CPU: 2 PID: 27883 at net/mac80211/sta_info.c:1122 __sta_info_destroy_part2+0x16b/0x180 [mac80211]
      RIP: 0010:__sta_info_destroy_part2+0x16b/0x180 [mac80211]
       Call Trace:
        __sta_info_destroy+0x2a/0x40 [mac80211]
        sta_info_destroy_addr_bss+0x38/0x60 [mac80211]
        ieee80211_del_station+0x1d/0x30 [mac80211]
        nl80211_del_station+0xe0/0x1f0 [cfg80211]
      
      Fix this by copying the ieee80211_key_conf structure for
      each and every station. This is the easiest way to properly
      remove the keys with the right index. Another solution
      would have been to allow several stations to use the same
      key offset in the firmware. That would require to change
      the way we track keys in iwlmvm and not really worth it.
      
      Also, maintain correctly fw_key_table when we add a key
      for the multicast station.
      Remove the key when we remove the multicast station.
      Signed-off-by: NEmmanuel Grumbach <emmanuel.grumbach@intel.com>
      Fixes: 337bfc98 ("iwlwifi: mvm: set wep key for all stations in soft ap mode")
      Signed-off-by: NLuca Coelho <luciano.coelho@intel.com>
      28916a16
    • L
      iwlwifi: mvm: add fall through comments where needed · 244726ec
      Luca Coelho 提交于
      Some switch-cases were missing a fall through comment, so the compiler
      may warn.  Fix that by adding the comments where needed.  In other
      cases there was more text in the comment, which the compiler doesn't
      recognize, so either remove the extra text or move it to a separate
      comment line as appropriate.
      Signed-off-by: NLuca Coelho <luciano.coelho@intel.com>
      244726ec
    • S
      iwlwifi: mvm: support CHANNEL_SWITCH_TIME_EVENT_CMD command · 74a10252
      Sara Sharon 提交于
      When we do channel switch, we used to schedule time events
      ourselves. This was offloaded to FW. Support the new command
      and flow.
      Signed-off-by: NSara Sharon <sara.sharon@intel.com>
      Signed-off-by: NLuca Coelho <luciano.coelho@intel.com>
      74a10252
  10. 29 1月, 2019 8 次提交