An error occurred fetching the project authors.
  1. 25 Feb, 2018 1 commit
    • Sven Eckelmann's avatar
      batman-adv: Fix internal interface indices types · f22e0893
      Sven Eckelmann authored
      batman-adv uses internal indices for each enabled and active interface.
      It is currently used by the B.A.T.M.A.N. IV algorithm to identifify the
      correct position in the ogm_cnt bitmaps.
      
      The type for the number of enabled interfaces (which defines the next
      interface index) was set to char. This type can be (depending on the
      architecture) either signed (limiting batman-adv to 127 active slave
      interfaces) or unsigned (limiting batman-adv to 255 active slave
      interfaces).
      
      This limit was not correctly checked when an interface was enabled and thus
      an overflow happened. This was only catched on systems with the signed char
      type when the B.A.T.M.A.N. IV code tried to resize its counter arrays with
      a negative size.
      
      The if_num interface index was only a s16 and therefore significantly
      smaller than the ifindex (int) used by the code net code.
      
      Both &batadv_hard_iface->if_num and &batadv_priv->num_ifaces must be
      (unsigned) int to support the same number of slave interfaces as the net
      core code. And the interface activation code must check the number of
      active slave interfaces to avoid integer overflows.
      
      Fixes: c6c8fea2 ("net: Add batman-adv meshing protocol")
      Signed-off-by: default avatarSven Eckelmann <sven@narfation.org>
      Signed-off-by: default avatarSimon Wunderlich <sw@simonwunderlich.de>
      f22e0893
  2. 21 Dec, 2017 1 commit
  3. 15 Dec, 2017 4 commits
  4. 05 Oct, 2017 1 commit
  5. 28 Sep, 2017 1 commit
  6. 26 Jan, 2017 1 commit
  7. 08 Nov, 2016 6 commits
  8. 04 Nov, 2016 1 commit
  9. 30 Oct, 2016 1 commit
    • Linus Lüssing's avatar
      batman-adv: Simple (re)broadcast avoidance · 3111beed
      Linus Lüssing authored
      With this patch, (re)broadcasting on a specific interfaces is avoided:
      
      * No neighbor: There is no need to broadcast on an interface if there
        is no node behind it.
      
      * Single neighbor is source: If there is just one neighbor on an
        interface and if this neighbor is the one we actually got this
        broadcast packet from, then we do not need to echo it back.
      
      * Single neighbor is originator: If there is just one neighbor on
        an interface and if this neighbor is the originator of this
        broadcast packet, then we do not need to echo it back.
      
      Goodies for BATMAN V:
      
      ("Upgrade your BATMAN IV network to V now to get these for free!")
      
      Thanks to the split of OGMv1 into two packet types, OGMv2 and ELP
      that is, we can now apply the same optimizations stated above to OGMv2
      packets, too.
      
      Furthermore, with BATMAN V, rebroadcasts can be reduced in certain
      multi interface cases, too, where BATMAN IV cannot. This is thanks to
      the removal of the "secondary interface originator" concept in BATMAN V.
      Signed-off-by: default avatarLinus Lüssing <linus.luessing@c0d3.blue>
      Signed-off-by: default avatarSven Eckelmann <sven@narfation.org>
      Signed-off-by: default avatarSimon Wunderlich <sw@simonwunderlich.de>
      3111beed
  10. 21 Oct, 2016 1 commit
    • Linus Lüssing's avatar
      batman-adv: fix splat on disabling an interface · 9799c503
      Linus Lüssing authored
      As long as there is still a reference for a hard interface held, there might
      still be a forwarding packet relying on its attributes.
      
      Therefore avoid setting hard_iface->soft_iface to NULL when disabling a hard
      interface.
      
      This fixes the following, potential splat:
      
          batman_adv: bat0: Interface deactivated: eth1
          batman_adv: bat0: Removing interface: eth1
          cgroup: new mount options do not match the existing superblock, will be ignored
          batman_adv: bat0: Interface deactivated: eth3
          batman_adv: bat0: Removing interface: eth3
          ------------[ cut here ]------------
          WARNING: CPU: 3 PID: 1986 at ./net/batman-adv/bat_iv_ogm.c:549 batadv_iv_send_outstanding_bat_ogm_packet+0x145/0x643 [batman_adv]
          Modules linked in: batman_adv(O-) <...>
          CPU: 3 PID: 1986 Comm: kworker/u8:2 Tainted: G        W  O    4.6.0-rc6+ #1
          Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.7.5-20140531_083030-gandalf 04/01/2014
          Workqueue: bat_events batadv_iv_send_outstanding_bat_ogm_packet [batman_adv]
           0000000000000000 ffff88001d93bca0 ffffffff8126c26b 0000000000000000
           0000000000000000 ffff88001d93bcf0 ffffffff81051615 ffff88001f19f818
           000002251d93bd68 0000000000000046 ffff88001dc04a00 ffff88001becbe48
          Call Trace:
           [<ffffffff8126c26b>] dump_stack+0x67/0x90
           [<ffffffff81051615>] __warn+0xc7/0xe5
           [<ffffffff8105164b>] warn_slowpath_null+0x18/0x1a
           [<ffffffffa0356f24>] batadv_iv_send_outstanding_bat_ogm_packet+0x145/0x643 [batman_adv]
           [<ffffffff8108b01f>] ? __lock_is_held+0x32/0x54
           [<ffffffff810689a2>] process_one_work+0x2a8/0x4f5
           [<ffffffff81068856>] ? process_one_work+0x15c/0x4f5
           [<ffffffff81068df2>] worker_thread+0x1d5/0x2c0
           [<ffffffff81068c1d>] ? process_scheduled_works+0x2e/0x2e
           [<ffffffff81068c1d>] ? process_scheduled_works+0x2e/0x2e
           [<ffffffff8106dd90>] kthread+0xc0/0xc8
           [<ffffffff8144de82>] ret_from_fork+0x22/0x40
           [<ffffffff8106dcd0>] ? __init_kthread_worker+0x55/0x55
          ---[ end trace 647f9f325123dc05 ]---
      
      What happened here is, that there was still a forw_packet (here: a BATMAN IV
      OGM) in the queue of eth3 with the forw_packet->if_incoming set to eth1 and the
      forw_packet->if_outgoing set to eth3.
      
      When eth3 is to be deactivated and removed, then this thread waits for the
      forw_packet queued on eth3 to finish. Because eth1 was deactivated and removed
      earlier and by that had forw_packet->if_incoming->soft_iface, set to NULL, the
      splat when trying to send/flush the OGM on eth3 occures.
      
      Fixes: c6c8fea2 ("net: Add batman-adv meshing protocol")
      Signed-off-by: default avatarLinus Lüssing <linus.luessing@c0d3.blue>
      [sven@narfation.org: Reduced size of Oops message]
      Signed-off-by: default avatarSven Eckelmann <sven@narfation.org>
      Signed-off-by: default avatarSimon Wunderlich <sw@simonwunderlich.de>
      9799c503
  11. 09 Aug, 2016 4 commits
  12. 04 Jul, 2016 1 commit
  13. 30 Jun, 2016 5 commits
  14. 10 May, 2016 4 commits
  15. 29 Apr, 2016 1 commit
    • Antonio Quartulli's avatar
      batman-adv: B.A.T.M.A.N V - make sure iface is reactivated upon NETDEV_UP event · b6cf5d49
      Antonio Quartulli authored
      At the moment there is no explicit reactivation of an hard-interface
      upon NETDEV_UP event. In case of B.A.T.M.A.N. IV the interface is
      reactivated as soon as the next OGM is scheduled for sending, but this
      mechanism does not work with B.A.T.M.A.N. V. The latter does not rely
      on the same scheduling mechanism as its predecessor and for this reason
      the hard-interface remains deactivated forever after being brought down
      once.
      
      This patch fixes the reactivation mechanism by adding a new routing API
      which explicitly allows each algorithm to perform any needed operation
      upon interface re-activation.
      
      Such API is optional and is implemented by B.A.T.M.A.N. V only and it
      just takes care of setting the iface status to ACTIVE
      Signed-off-by: default avatarAntonio Quartulli <a@unstable.cc>
      Signed-off-by: default avatarMarek Lindner <mareklindner@neomailbox.ch>
      b6cf5d49
  16. 24 Apr, 2016 1 commit
  17. 23 Feb, 2016 1 commit
  18. 16 Feb, 2016 1 commit
    • Andrew Lunn's avatar
      batman-adv: Avoid endless loop in bat-on-bat netdevice check · 1bc4e2b0
      Andrew Lunn authored
      batman-adv checks in different situation if a new device is already on top
      of a different batman-adv device. This is done by getting the iflink of a
      device and all its parent. It assumes that this iflink is always a parent
      device in an acyclic graph. But this assumption is broken by devices like
      veth which are actually a pair of two devices linked to each other. The
      recursive check would therefore get veth0 when calling dev_get_iflink on
      veth1. And it gets veth0 when calling dev_get_iflink with veth1.
      
      Creating a veth pair and loading batman-adv freezes parts of the system
      
          ip link add veth0 type veth peer name veth1
          modprobe batman-adv
      
      An RCU stall will be detected on the system which cannot be fixed.
      
          INFO: rcu_sched self-detected stall on CPU
                  1: (5264 ticks this GP) idle=3e9/140000000000001/0
          softirq=144683/144686 fqs=5249
                   (t=5250 jiffies g=46 c=45 q=43)
          Task dump for CPU 1:
          insmod          R  running task        0   247    245 0x00000008
           ffffffff8151f140 ffffffff8107888e ffff88000fd141c0 ffffffff8151f140
           0000000000000000 ffffffff81552df0 ffffffff8107b420 0000000000000001
           ffff88000e3fa700 ffffffff81540b00 ffffffff8107d667 0000000000000001
          Call Trace:
           <IRQ>  [<ffffffff8107888e>] ? rcu_dump_cpu_stacks+0x7e/0xd0
           [<ffffffff8107b420>] ? rcu_check_callbacks+0x3f0/0x6b0
           [<ffffffff8107d667>] ? hrtimer_run_queues+0x47/0x180
           [<ffffffff8107cf9d>] ? update_process_times+0x2d/0x50
           [<ffffffff810873fb>] ? tick_handle_periodic+0x1b/0x60
           [<ffffffff810290ae>] ? smp_trace_apic_timer_interrupt+0x5e/0x90
           [<ffffffff813bbae2>] ? apic_timer_interrupt+0x82/0x90
           <EOI>  [<ffffffff812c3fd7>] ? __dev_get_by_index+0x37/0x40
           [<ffffffffa0031f3e>] ? batadv_hard_if_event+0xee/0x3a0 [batman_adv]
           [<ffffffff812c5801>] ? register_netdevice_notifier+0x81/0x1a0
          [...]
      
      This can be avoided by checking if two devices are each others parent and
      stopping the check in this situation.
      
      Fixes: b7eddd0b ("batman-adv: prevent using any virtual device created on batman-adv as hard-interface")
      Signed-off-by: default avatarAndrew Lunn <andrew@lunn.ch>
      [sven@narfation.org: rewritten description, extracted fix]
      Signed-off-by: default avatarSven Eckelmann <sven@narfation.org>
      Signed-off-by: default avatarMarek Lindner <mareklindner@neomailbox.ch>
      Signed-off-by: default avatarAntonio Quartulli <a@unstable.cc>
      1bc4e2b0
  19. 10 Feb, 2016 2 commits
  20. 02 Feb, 2016 2 commits