1. 09 8月, 2016 4 次提交
  2. 05 7月, 2016 2 次提交
  3. 04 7月, 2016 1 次提交
  4. 30 6月, 2016 4 次提交
  5. 18 5月, 2016 1 次提交
    • L
      batman-adv: Avoid duplicate neigh_node additions · e123705e
      Linus Lüssing 提交于
      Two parallel calls to batadv_neigh_node_new() might race for creating
      and adding the same neig_node. Fix this by including the check for any
      already existing, identical neigh_node within the spin-lock.
      
      This fixes splats like the following:
      
      [  739.535069] ------------[ cut here ]------------
      [  739.535079] WARNING: CPU: 0 PID: 0 at /usr/src/batman-adv/git/batman-adv/net/batman-adv/bat_iv_ogm.c:1004 batadv_iv_ogm_process_per_outif+0xe3f/0xe60 [batman_adv]()
      [  739.535092] too many matching neigh_nodes
      [  739.535094] Modules linked in: dm_mod tun ip6table_filter ip6table_mangle ip6table_nat nf_nat_ipv6 ip6_tables xt_nat iptable_nat nf_nat_ipv4 nf_nat xt_TCPMSS xt_mark iptable_mangle xt_tcpudp xt_conntrack iptable_filter ip_tables x_tables ip_gre ip_tunnel gre bridge stp llc thermal_sys kvm_intel kvm crct10dif_pclmul crc32_pclmul sha256_ssse3 sha256_generic hmac drbg ansi_cprng aesni_intel aes_x86_64 lrw gf128mul glue_helper ablk_helper cryptd evdev pcspkr ip6_gre ip6_tunnel tunnel6 batman_adv(O) libcrc32c nf_conntrack_ipv6 nf_defrag_ipv6 nf_conntrack_ipv4 nf_defrag_ipv4 nf_conntrack autofs4 ext4 crc16 mbcache jbd2 xen_netfront xen_blkfront crc32c_intel
      [  739.535177] CPU: 0 PID: 0 Comm: swapper/0 Tainted: G        W  O    4.2.0-0.bpo.1-amd64 #1 Debian 4.2.6-3~bpo8+2
      [  739.535186]  0000000000000000 ffffffffa013b050 ffffffff81554521 ffff88007d003c18
      [  739.535201]  ffffffff8106fa01 0000000000000000 ffff8800047a087a ffff880079c3a000
      [  739.735602]  ffff88007b82bf40 ffff88007bc2d1c0 ffffffff8106fa7a ffffffffa013aa8e
      [  739.735624] Call Trace:
      [  739.735639]  <IRQ>  [<ffffffff81554521>] ? dump_stack+0x40/0x50
      [  739.735677]  [<ffffffff8106fa01>] ? warn_slowpath_common+0x81/0xb0
      [  739.735692]  [<ffffffff8106fa7a>] ? warn_slowpath_fmt+0x4a/0x50
      [  739.735715]  [<ffffffffa012448f>] ? batadv_iv_ogm_process_per_outif+0xe3f/0xe60 [batman_adv]
      [  739.735740]  [<ffffffffa0124813>] ? batadv_iv_ogm_receive+0x363/0x380 [batman_adv]
      [  739.735762]  [<ffffffffa0124813>] ? batadv_iv_ogm_receive+0x363/0x380 [batman_adv]
      [  739.735783]  [<ffffffff810b0841>] ? __raw_callee_save___pv_queued_spin_unlock+0x11/0x20
      [  739.735804]  [<ffffffffa012cb39>] ? batadv_batman_skb_recv+0xc9/0x110 [batman_adv]
      [  739.735825]  [<ffffffff81464891>] ? __netif_receive_skb_core+0x841/0x9a0
      [  739.735838]  [<ffffffff810b0841>] ? __raw_callee_save___pv_queued_spin_unlock+0x11/0x20
      [  739.735853]  [<ffffffff81465681>] ? process_backlog+0xa1/0x140
      [  739.735864]  [<ffffffff81464f1a>] ? net_rx_action+0x20a/0x320
      [  739.735878]  [<ffffffff81073aa7>] ? __do_softirq+0x107/0x270
      [  739.735891]  [<ffffffff81073d82>] ? irq_exit+0x92/0xa0
      [  739.735905]  [<ffffffff8137e0d1>] ? xen_evtchn_do_upcall+0x31/0x40
      [  739.735924]  [<ffffffff8155b8fe>] ? xen_do_hypervisor_callback+0x1e/0x40
      [  739.735939]  <EOI>  [<ffffffff810013aa>] ? xen_hypercall_sched_op+0xa/0x20
      [  739.735965]  [<ffffffff810013aa>] ? xen_hypercall_sched_op+0xa/0x20
      [  739.735979]  [<ffffffff8100a39c>] ? xen_safe_halt+0xc/0x20
      [  739.735991]  [<ffffffff8101da6c>] ? default_idle+0x1c/0xa0
      [  739.736004]  [<ffffffff810abf6b>] ? cpu_startup_entry+0x2eb/0x350
      [  739.736019]  [<ffffffff81b2af5e>] ? start_kernel+0x480/0x48b
      [  739.736032]  [<ffffffff81b2d116>] ? xen_start_kernel+0x507/0x511
      [  739.736048] ---[ end trace c106bb901244bc8c ]---
      
      Fixes: f987ed6e ("batman-adv: protect neighbor list with rcu locks")
      Reported-by: NMartin Weinelt <martin@darmstadt.freifunk.net>
      Signed-off-by: NLinus Lüssing <linus.luessing@c0d3.blue>
      Signed-off-by: NMarek Lindner <mareklindner@neomailbox.ch>
      Signed-off-by: NAntonio Quartulli <a@unstable.cc>
      e123705e
  6. 10 5月, 2016 3 次提交
  7. 04 5月, 2016 2 次提交
  8. 29 4月, 2016 1 次提交
    • S
      batman-adv: Fix reference counting of hardif_neigh_node object for neigh_node · abe59c65
      Sven Eckelmann 提交于
      The batadv_neigh_node was specific to a batadv_hardif_neigh_node and held
      an implicit reference to it. But this reference was never stored in form of
      a pointer in the batadv_neigh_node itself. Instead
      batadv_neigh_node_release depends on a consistent state of
      hard_iface->neigh_list and that batadv_hardif_neigh_get always returns the
      batadv_hardif_neigh_node object which it has a reference for. But
      batadv_hardif_neigh_get cannot guarantee that because it is working only
      with rcu_read_lock on this list. It can therefore happen that a neigh_addr
      is in this list twice or that batadv_hardif_neigh_get cannot find the
      batadv_hardif_neigh_node for an neigh_addr due to some other list
      operations taking place at the same time.
      
      Instead add a batadv_hardif_neigh_node pointer directly in
      batadv_neigh_node which will be used for the reference counter decremented
      on release of batadv_neigh_node.
      
      Fixes: cef63419 ("batman-adv: add list of unique single hop neighbors per hard-interface")
      Signed-off-by: NSven Eckelmann <sven@narfation.org>
      Signed-off-by: NMarek Lindner <mareklindner@neomailbox.ch>
      Signed-off-by: NAntonio Quartulli <a@unstable.cc>
      abe59c65
  9. 24 4月, 2016 1 次提交
  10. 23 2月, 2016 7 次提交
  11. 10 2月, 2016 7 次提交
  12. 02 2月, 2016 4 次提交
  13. 16 1月, 2016 3 次提交
    • S
      batman-adv: Drop immediate orig_node free function · 42eff6a6
      Sven Eckelmann 提交于
      It is not allowed to free the memory of an object which is part of a list
      which is protected by rcu-read-side-critical sections without making sure
      that no other context is accessing the object anymore. This usually happens
      by removing the references to this object and then waiting until the rcu
      grace period is over and no one (allowedly) accesses it anymore.
      
      But the _now functions ignore this completely. They free the object
      directly even when a different context still tries to access it. This has
      to be avoided and thus these functions must be removed and all functions
      have to use batadv_orig_node_free_ref.
      
      Fixes: 72822225 ("batman-adv: Fix rcu_barrier() miss due to double call_rcu() in TT code")
      Signed-off-by: NSven Eckelmann <sven@narfation.org>
      Signed-off-by: NMarek Lindner <mareklindner@neomailbox.ch>
      Signed-off-by: NAntonio Quartulli <a@unstable.cc>
      42eff6a6
    • S
      batman-adv: Drop immediate batadv_hard_iface free function · b4d922cf
      Sven Eckelmann 提交于
      It is not allowed to free the memory of an object which is part of a list
      which is protected by rcu-read-side-critical sections without making sure
      that no other context is accessing the object anymore. This usually happens
      by removing the references to this object and then waiting until the rcu
      grace period is over and no one (allowedly) accesses it anymore.
      
      But the _now functions ignore this completely. They free the object
      directly even when a different context still tries to access it. This has
      to be avoided and thus these functions must be removed and all functions
      have to use batadv_hardif_free_ref.
      
      Fixes: 89652331 ("batman-adv: split tq information in neigh_node struct")
      Signed-off-by: NSven Eckelmann <sven@narfation.org>
      Signed-off-by: NMarek Lindner <mareklindner@neomailbox.ch>
      Signed-off-by: NAntonio Quartulli <a@unstable.cc>
      b4d922cf
    • S
      batman-adv: Drop immediate neigh_ifinfo free function · ae3e1e36
      Sven Eckelmann 提交于
      It is not allowed to free the memory of an object which is part of a list
      which is protected by rcu-read-side-critical sections without making sure
      that no other context is accessing the object anymore. This usually happens
      by removing the references to this object and then waiting until the rcu
      grace period is over and no one (allowedly) accesses it anymore.
      
      But the _now functions ignore this completely. They free the object
      directly even when a different context still tries to access it. This has
      to be avoided and thus these functions must be removed and all functions
      have to use batadv_neigh_ifinfo_free_ref.
      
      Fixes: 89652331 ("batman-adv: split tq information in neigh_node struct")
      Signed-off-by: NSven Eckelmann <sven@narfation.org>
      Signed-off-by: NMarek Lindner <mareklindner@neomailbox.ch>
      Signed-off-by: NAntonio Quartulli <a@unstable.cc>
      ae3e1e36