1. 26 6月, 2020 2 次提交
  2. 10 6月, 2020 1 次提交
    • C
      net: change addr_list_lock back to static key · 845e0ebb
      Cong Wang 提交于
      The dynamic key update for addr_list_lock still causes troubles,
      for example the following race condition still exists:
      
      CPU 0:				CPU 1:
      (RCU read lock)			(RTNL lock)
      dev_mc_seq_show()		netdev_update_lockdep_key()
      				  -> lockdep_unregister_key()
       -> netif_addr_lock_bh()
      
      because lockdep doesn't provide an API to update it atomically.
      Therefore, we have to move it back to static keys and use subclass
      for nest locking like before.
      
      In commit 1a33e10e ("net: partially revert dynamic lockdep key
      changes"), I already reverted most parts of commit ab92d68f
      ("net: core: add generic lockdep keys").
      
      This patch reverts the rest and also part of commit f3b0a18b
      ("net: remove unnecessary variables and callback"). After this
      patch, addr_list_lock changes back to using static keys and
      subclasses to satisfy lockdep. Thanks to dev->lower_level, we do
      not have to change back to ->ndo_get_lock_subclass().
      
      And hopefully this reduces some syzbot lockdep noises too.
      
      Reported-by: syzbot+f3a0e80c34b3fc28ac5e@syzkaller.appspotmail.com
      Cc: Taehee Yoo <ap420073@gmail.com>
      Cc: Dmitry Vyukov <dvyukov@google.com>
      Signed-off-by: NCong Wang <xiyou.wangcong@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      845e0ebb
  3. 26 5月, 2020 1 次提交
    • S
      batman-adv: Revert "disable ethtool link speed detection when auto negotiation off" · 9ad346c9
      Sven Eckelmann 提交于
      The commit 8c46fcd7 ("batman-adv: disable ethtool link speed detection
      when auto negotiation off") disabled the usage of ethtool's link_ksetting
      when auto negotation was enabled due to invalid values when used with
      tun/tap virtual net_devices. According to the patch, automatic measurements
      should be used for these kind of interfaces.
      
      But there are major flaws with this argumentation:
      
      * automatic measurements are not implemented
      * auto negotiation has nothing to do with the validity of the retrieved
        values
      
      The first point has to be fixed by a longer patch series. The "validity"
      part of the second point must be addressed in the same patch series by
      dropping the usage of ethtool's link_ksetting (thus always doing automatic
      measurements over ethernet).
      
      Drop the patch again to have more default values for various net_device
      types/configurations. The user can still overwrite them using the
      batadv_hardif's BATADV_ATTR_THROUGHPUT_OVERRIDE.
      Reported-by: NMatthias Schiffer <mschiffer@universe-factory.net>
      Signed-off-by: NSven Eckelmann <sven@narfation.org>
      Signed-off-by: NSimon Wunderlich <sw@simonwunderlich.de>
      9ad346c9
  4. 22 5月, 2020 2 次提交
  5. 21 5月, 2020 1 次提交
  6. 05 5月, 2020 1 次提交
  7. 24 4月, 2020 1 次提交
  8. 21 4月, 2020 8 次提交
  9. 18 2月, 2020 2 次提交
  10. 17 2月, 2020 1 次提交
    • S
      batman-adv: Avoid RCU list-traversal in spinlock · 3b2582c7
      Sven Eckelmann 提交于
      The new CONFIG_PROVE_RCU_LIST requires a condition statement in
      (h)list_for_each_entry_rcu when the code might be executed in a non RCU
      non-reader section with the writer lock. Otherwise lockdep might cause a
      false positive warning like
      
        =============================
        WARNING: suspicious RCU usage
        -----------------------------
        translation-table.c:940 RCU-list traversed in non-reader section!!
      
      batman-adv is (mostly) following the examples from the RCU documentation
      and is using the normal list-traversal primitives instead of the RCU
      list-traversal primitives when the writer (spin)lock is held.
      
      The remaining users of RCU list-traversal primitives with writer spinlock
      have to be converted to the same style as the rest of the code.
      Reported-by: NMadhuparna Bhowmik <madhuparnabhowmik10@gmail.com>
      Signed-off-by: NSven Eckelmann <sven@narfation.org>
      Signed-off-by: NSimon Wunderlich <sw@simonwunderlich.de>
      3b2582c7
  11. 16 2月, 2020 1 次提交
  12. 01 1月, 2020 2 次提交
  13. 10 12月, 2019 1 次提交
  14. 09 12月, 2019 2 次提交
  15. 28 11月, 2019 1 次提交
    • S
      batman-adv: Fix DAT candidate selection on little endian systems · 4cc4a170
      Sven Eckelmann 提交于
      The distributed arp table is using a DHT to store and retrieve MAC address
      information for an IP address. This is done using unicast messages to
      selected peers. The potential peers are looked up using the IP address and
      the VID.
      
      While the IP address is always stored in big endian byte order, this is not
      the case of the VID. It can (depending on the host system) either be big
      endian or little endian. The host must therefore always convert it to big
      endian to ensure that all devices calculate the same peers for the same
      lookup data.
      
      Fixes: be1db4f6 ("batman-adv: make the Distributed ARP Table vlan aware")
      Signed-off-by: NSven Eckelmann <sven@narfation.org>
      Signed-off-by: NSimon Wunderlich <sw@simonwunderlich.de>
      4cc4a170
  16. 25 11月, 2019 3 次提交
  17. 03 11月, 2019 5 次提交
  18. 25 10月, 2019 1 次提交
    • T
      net: core: add generic lockdep keys · ab92d68f
      Taehee Yoo 提交于
      Some interface types could be nested.
      (VLAN, BONDING, TEAM, MACSEC, MACVLAN, IPVLAN, VIRT_WIFI, VXLAN, etc..)
      These interface types should set lockdep class because, without lockdep
      class key, lockdep always warn about unexisting circular locking.
      
      In the current code, these interfaces have their own lockdep class keys and
      these manage itself. So that there are so many duplicate code around the
      /driver/net and /net/.
      This patch adds new generic lockdep keys and some helper functions for it.
      
      This patch does below changes.
      a) Add lockdep class keys in struct net_device
         - qdisc_running, xmit, addr_list, qdisc_busylock
         - these keys are used as dynamic lockdep key.
      b) When net_device is being allocated, lockdep keys are registered.
         - alloc_netdev_mqs()
      c) When net_device is being free'd llockdep keys are unregistered.
         - free_netdev()
      d) Add generic lockdep key helper function
         - netdev_register_lockdep_key()
         - netdev_unregister_lockdep_key()
         - netdev_update_lockdep_key()
      e) Remove unnecessary generic lockdep macro and functions
      f) Remove unnecessary lockdep code of each interfaces.
      
      After this patch, each interface modules don't need to maintain
      their lockdep keys.
      Signed-off-by: NTaehee Yoo <ap420073@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ab92d68f
  19. 14 10月, 2019 2 次提交
    • S
      batman-adv: Avoid free/alloc race when handling OGM buffer · 40e220b4
      Sven Eckelmann 提交于
      Each slave interface of an B.A.T.M.A.N. IV virtual interface has an OGM
      packet buffer which is initialized using data from netdevice notifier and
      other rtnetlink related hooks. It is sent regularly via various slave
      interfaces of the batadv virtual interface and in this process also
      modified (realloced) to integrate additional state information via TVLV
      containers.
      
      It must be avoided that the worker item is executed without a common lock
      with the netdevice notifier/rtnetlink helpers. Otherwise it can either
      happen that half modified/freed data is sent out or functions modifying the
      OGM buffer try to access already freed memory regions.
      
      Reported-by: syzbot+0cc629f19ccb8534935b@syzkaller.appspotmail.com
      Fixes: c6c8fea2 ("net: Add batman-adv meshing protocol")
      Signed-off-by: NSven Eckelmann <sven@narfation.org>
      Signed-off-by: NSimon Wunderlich <sw@simonwunderlich.de>
      40e220b4
    • S
      batman-adv: Avoid free/alloc race when handling OGM2 buffer · a8d23cbb
      Sven Eckelmann 提交于
      A B.A.T.M.A.N. V virtual interface has an OGM2 packet buffer which is
      initialized using data from the netdevice notifier and other rtnetlink
      related hooks. It is sent regularly via various slave interfaces of the
      batadv virtual interface and in this process also modified (realloced) to
      integrate additional state information via TVLV containers.
      
      It must be avoided that the worker item is executed without a common lock
      with the netdevice notifier/rtnetlink helpers. Otherwise it can either
      happen that half modified data is sent out or the functions modifying the
      OGM2 buffer try to access already freed memory regions.
      
      Fixes: 0da00359 ("batman-adv: OGMv2 - add basic infrastructure")
      Signed-off-by: NSven Eckelmann <sven@narfation.org>
      Signed-off-by: NSimon Wunderlich <sw@simonwunderlich.de>
      a8d23cbb
  20. 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
  21. 26 9月, 2019 1 次提交