1. 24 4月, 2020 1 次提交
    • J
      mac80211_hwsim: notify wmediumd of used MAC addresses · 5cc58a9e
      Johannes Berg 提交于
      Currently, wmediumd requires each used MAC address to be configured
      as a station in the virtual air, but that doesn't make sense as any
      station could have multiple MAC addresses, and even have randomized
      ones in scanning, etc.
      
      Add some code here to tell wmediumd of used MAC addresses, binding
      them to the hardware address. Combined with a wmediumd patch that
      makes it track the addresses this allows configuring just the radio
      address (42:00:00:00:nn:00 unless the radio was manually created)
      in wmediumd as a station, and all addresses that the station uses
      are added/removed dynamically.
      
      Tested with random scan, which without this and the corresponding
      wmediumd change doesn't get anything through as the sender doesn't
      exist as far as wmediumd is concerned (it's random).
      
      Link: https://lore.kernel.org/r/20200323162358.b397b1a1acef.Ice0536e34e5d96c51f97c374ea8af9551347c7e8@changeidSigned-off-by: NJohannes Berg <johannes.berg@intel.com>
      5cc58a9e
  2. 14 4月, 2020 1 次提交
    • T
      mac80211_hwsim: Use kstrndup() in place of kasprintf() · 7ea86204
      Tuomas Tynkkynen 提交于
      syzbot reports a warning:
      
      precision 33020 too large
      WARNING: CPU: 0 PID: 9618 at lib/vsprintf.c:2471 set_precision+0x150/0x180 lib/vsprintf.c:2471
       vsnprintf+0xa7b/0x19a0 lib/vsprintf.c:2547
       kvasprintf+0xb2/0x170 lib/kasprintf.c:22
       kasprintf+0xbb/0xf0 lib/kasprintf.c:59
       hwsim_del_radio_nl+0x63a/0x7e0 drivers/net/wireless/mac80211_hwsim.c:3625
       genl_family_rcv_msg_doit net/netlink/genetlink.c:672 [inline]
       ...
       entry_SYSCALL_64_after_hwframe+0x49/0xbe
      
      Thus it seems that kasprintf() with "%.*s" format can not be used for
      duplicating a string with arbitrary length. Replace it with kstrndup().
      
      Note that later this string is limited to NL80211_WIPHY_NAME_MAXLEN == 64,
      but the code is simpler this way.
      
      Reported-by: syzbot+6693adf1698864d21734@syzkaller.appspotmail.com
      Reported-by: syzbot+a4aee3f42d7584d76761@syzkaller.appspotmail.com
      Cc: stable@kernel.org
      Signed-off-by: NTuomas Tynkkynen <tuomas.tynkkynen@iki.fi>
      Link: https://lore.kernel.org/r/20200410123257.14559-1-tuomas.tynkkynen@iki.fi
      [johannes: add note about length limit]
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      7ea86204
  3. 20 3月, 2020 1 次提交
  4. 24 2月, 2020 1 次提交
  5. 15 1月, 2020 2 次提交
  6. 08 11月, 2019 1 次提交
  7. 11 10月, 2019 2 次提交
  8. 04 10月, 2019 2 次提交
  9. 02 10月, 2019 1 次提交
    • F
      netfilter: drop bridge nf reset from nf_reset · 895b5c9f
      Florian Westphal 提交于
      commit 174e2381
      ("sk_buff: drop all skb extensions on free and skb scrubbing") made napi
      recycle always drop skb extensions.  The additional skb_ext_del() that is
      performed via nf_reset on napi skb recycle is not needed anymore.
      
      Most nf_reset() calls in the stack are there so queued skb won't block
      'rmmod nf_conntrack' indefinitely.
      
      This removes the skb_ext_del from nf_reset, and renames it to a more
      fitting nf_reset_ct().
      
      In a few selected places, add a call to skb_ext_reset to make sure that
      no active extensions remain.
      
      I am submitting this for "net", because we're still early in the release
      cycle.  The patch applies to net-next too, but I think the rename causes
      needless divergence between those trees.
      Suggested-by: NEric Dumazet <edumazet@google.com>
      Signed-off-by: NFlorian Westphal <fw@strlen.de>
      Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
      895b5c9f
  10. 11 9月, 2019 1 次提交
  11. 31 7月, 2019 1 次提交
  12. 29 7月, 2019 1 次提交
  13. 26 7月, 2019 3 次提交
  14. 22 6月, 2019 1 次提交
  15. 19 6月, 2019 1 次提交
  16. 14 6月, 2019 1 次提交
    • J
      nl80211: require and validate vendor command policy · 901bb989
      Johannes Berg 提交于
      Require that each vendor command give a policy of its sub-attributes
      in NL80211_ATTR_VENDOR_DATA, and then (stricly) check the contents,
      including the NLA_F_NESTED flag that we couldn't check on the outer
      layer because there we don't know yet.
      
      It is possible to use VENDOR_CMD_RAW_DATA for raw data, but then no
      nested data can be given (NLA_F_NESTED flag must be clear) and the
      data is just passed as is to the command.
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      901bb989
  17. 24 5月, 2019 1 次提交
    • G
      mac80211_hwsim: mark expected switch fall-through · 85a55ff2
      Gustavo A. R. Silva 提交于
      In preparation to enabling -Wimplicit-fallthrough, mark switch
      cases where we are expecting to fall through.
      
      This patch fixes the following warning:
      
      drivers/net/wireless/mac80211_hwsim.c: In function ‘init_mac80211_hwsim’:
      drivers/net/wireless/mac80211_hwsim.c:3853:21: warning: this statement may fall through [-Wimplicit-fallthrough=]
          param.reg_strict = true;
          ~~~~~~~~~~~~~~~~~^~~~~~
      drivers/net/wireless/mac80211_hwsim.c:3854:3: note: here
         case HWSIM_REGTEST_DRIVER_REG_ALL:
         ^~~~
      
      Warning level 3 was used: -Wimplicit-fallthrough=3
      
      This patch is part of the ongoing efforts to enable
      -Wimplicit-fallthrough.
      Signed-off-by: NGustavo A. R. Silva <gustavo@embeddedor.com>
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      85a55ff2
  18. 28 4月, 2019 2 次提交
    • J
      genetlink: optionally validate strictly/dumps · ef6243ac
      Johannes Berg 提交于
      Add options to strictly validate messages and dump messages,
      sometimes perhaps validating dump messages non-strictly may
      be required, so add an option for that as well.
      
      Since none of this can really be applied to existing commands,
      set the options everwhere using the following spatch:
      
          @@
          identifier ops;
          expression X;
          @@
          struct genl_ops ops[] = {
          ...,
           {
                  .cmd = X,
          +       .validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
                  ...
           },
          ...
          };
      
      For new commands one should just not copy the .validate 'opt-out'
      flags and thus get strict validation.
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ef6243ac
    • 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
  19. 26 4月, 2019 2 次提交
  20. 08 4月, 2019 1 次提交
  21. 22 3月, 2019 2 次提交
  22. 22 2月, 2019 1 次提交
  23. 08 2月, 2019 1 次提交
  24. 06 2月, 2019 1 次提交
    • J
      mac80211_hwsim: Support boottime in scan results · 341203e7
      Jouni Malinen 提交于
      This makes the age information for cfg80211 scan results more accurate
      and fixes issues with wpa_supplicant dropping "old" scan results (e.g.,
      "wlan0: Own scan request started a scan in 0.000456 seconds") that
      looked like would have been received before a scan started due to the
      inaccuracy of the default timing mechanism for calculating the BSS entry
      age. This makes hwsim test cases significantly more robust to run.
      Signed-off-by: NJouni Malinen <j@w1.fi>
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      341203e7
  25. 19 1月, 2019 1 次提交
  26. 18 12月, 2018 1 次提交
  27. 05 12月, 2018 1 次提交
  28. 09 11月, 2018 5 次提交