25 Aug, 2015

7 commits


22 Aug, 2015

1 commit


19 Aug, 2015

1 commit

  • The object tt_local is allocated with kmalloc and not initialized when the
    function batadv_tt_local_add checks for the vlan. But this function can
    only cleanup the object when the (not yet initialized) reference counter of
    the object is 1. This is unlikely and thus the object would leak when the
    vlan could not be found.

    Instead the uninitialized object tt_local has to be freed manually and the
    pointer has to set to NULL to avoid calling the function which would try to
    decrement the reference counter of the not existing object.

    CID: 1316518
    Fixes: 354136bcc3c4 ("batman-adv: fix kernel crash due to missing NULL checks")
    Signed-off-by: Sven Eckelmann
    Signed-off-by: David S. Miller

    Sven Eckelmann
     

18 Aug, 2015

1 commit

  • Antonio Quartulli says:

    ====================
    Included changes:
    - avoid integer overflow in GW selection routine
    - prevent race condition by making capability bit changes atomic (use
    clear/set/test_bit)
    - fix synchronization issue in mcast tvlv handler
    - fix crash on double list removal of TT Request objects
    - fix leak by puring packets enqueued for sending upon iface removal
    - ensure network header pointer is set in skb
    ====================

    Signed-off-by: David S. Miller

    David S. Miller
     

15 Aug, 2015

2 commits

  • The list_del() calls were changed to list_del_init() to prevent
    an accidental double deletion in batadv_tt_req_node_new().

    Signed-off-by: Marek Lindner
    Signed-off-by: Antonio Quartulli

    Marek Lindner
     
  • Bitwise OR/AND assignments in C aren't guaranteed to be atomic. One
    OGM handler might undo the set/clear of a specific bit from another
    handler run in between.

    Fix this by using the atomic set_bit()/clear_bit()/test_bit() functions.

    Fixes: e17931d1a61d ("batman-adv: introduce capability initialization bitfield")
    Signed-off-by: Linus Lüssing
    Signed-off-by: Marek Lindner
    Signed-off-by: Antonio Quartulli

    Linus Lüssing
     

05 Aug, 2015

2 commits

  • The tt_local_entry deletion performed in batadv_tt_local_remove() was neither
    protecting against simultaneous deletes nor checking whether the element was
    still part of the list before calling hlist_del_rcu().

    Replacing the hlist_del_rcu() call with batadv_hash_remove() provides adequate
    protection via hash spinlocks as well as an is-element-still-in-hash check to
    avoid 'blind' hash removal.

    Fixes: 068ee6e204e1 ("batman-adv: roaming handling mechanism redesign")
    Reported-by: alfonsname@web.de
    Signed-off-by: Marek Lindner
    Signed-off-by: Antonio Quartulli

    Marek Lindner
     
  • batadv_softif_vlan_get() may return NULL which has to be verified
    by the caller.

    Fixes: 35df3b298fc8 ("batman-adv: fix TT VLAN inconsistency on VLAN re-add")
    Reported-by: Ryan Thompson
    Signed-off-by: Marek Lindner
    Signed-off-by: Antonio Quartulli

    Marek Lindner
     

07 Jun, 2015

3 commits

  • Signed-off-by: Sven Eckelmann
    Signed-off-by: Marek Lindner

    Sven Eckelmann
     
  • The header files could not be build indepdent from each other. This is
    happened because headers didn't include the files for things they've used.
    This was problematic because the success of a build depended on the
    knowledge about the right order of local includes.

    Also source files were not including everything they've used explicitly.
    Instead they required that transitive includes are always stable. This is
    problematic because some transitive includes are not obvious, depend on
    config settings and may not be stable in the future.

    The order for include blocks are:

    * primary headers (main.h and the *.h file of a *.c file)
    * global linux headers
    * required local headers
    * extra forward declarations for pointers in function/struct declarations

    The only exceptions are linux/bitops.h and linux/if_ether.h in packet.h.
    This header file is shared with userspace applications like batctl and must
    therefore build together with userspace applications. The header
    linux/bitops.h is not part of the uapi headers and linux/if_ether.h
    conflicts with the musl implementation of netinet/if_ether.h. The
    maintainers rejected the use of __KERNEL__ preprocessor checks and thus
    these two headers are only in main.h. All files using packet.h first have
    to include main.h to work correctly.

    Reported-by: Markus Pargmann
    Signed-off-by: Sven Eckelmann
    Signed-off-by: Marek Lindner

    Sven Eckelmann
     
  • An unoptimized version of the Jenkins one-at-a-time hash function is used
    and partially copied all over the code wherever an hashtable is used.
    Instead the optimized version shared between the whole kernel should be
    used to reduce code duplication and use better optimized code.

    Only the DAT code must use the old implementation because it is used as
    distributed hash function which has to be common for all nodes.

    Signed-off-by: Sven Eckelmann
    Signed-off-by: Marek Lindner

    Sven Eckelmann
     

29 May, 2015

1 commit


08 Jan, 2015

3 commits


21 Jul, 2014

1 commit

  • When a VLAN interface (on top of batX) is removed and
    re-added within a short timeframe TT does not have enough
    time to properly cleanup. This creates an internal TT state
    mismatch as the newly created softif_vlan will be
    initialized from scratch with a TT client count of zero
    (even if TT entries for this VLAN still exist). The
    resulting TT messages are bogus due to the counter / tt
    client listing mismatch, thus creating inconsistencies on
    every node in the network

    To fix this issue destroy_vlan() has to not free the VLAN
    object immediately but it has to be kept alive until all the
    TT entries for this VLAN have been removed. destroy_vlan()
    still removes the sysfs folder so that the user has the
    feeling that everything went fine.

    If the same VLAN is re-added before the old object is free'd,
    then the latter is resurrected and re-used.

    Implement such behaviour by increasing the reference counter
    of a softif_vlan object every time a new local TT entry for
    such VLAN is created and remove the object from the list
    only when all the TT entries have been destroyed.

    Signed-off-by: Antonio Quartulli
    Signed-off-by: Marek Lindner

    Antonio Quartulli
     

22 Mar, 2014

4 commits

  • With this patch a multicast packet is not always simply flooded anymore,
    the behaviour for the following cases is changed to reduce
    unnecessary overhead:

    If all nodes within the horizon of a certain node have signalized
    multicast listener announcement capability then an IPv6 multicast packet
    with a destination of IPv6 link-local scope (excluding ff02::1) coming
    from the upstream of this node...

    * ...is dropped if there is no according multicast listener in the
    translation table,
    * ...is forwarded via unicast if there is a single node with interested
    multicast listeners
    * ...and otherwise still gets flooded.

    Signed-off-by: Linus Lüssing
    Signed-off-by: Marek Lindner
    Signed-off-by: Antonio Quartulli

    Linus Lüssing
     
  • The new bitfield allows us to keep track whether capability subsets of
    an originator have gone through their initialization phase yet.

    The translation table is the only user right now, but a new one will be
    added soon.

    Signed-off-by: Linus Lüssing
    Signed-off-by: Marek Lindner
    Signed-off-by: Antonio Quartulli

    Linus Lüssing
     
  • With this patch a node which has no bridge interface on top of its soft
    interface announces its local multicast listeners via the translation
    table.

    Signed-off-by: Linus Lüssing
    Signed-off-by: Marek Lindner
    Signed-off-by: Antonio Quartulli

    Linus Lüssing
     
  • On some architectures ether_addr_copy() is slightly faster
    than memcpy() therefore use the former when possible.

    Signed-off-by: Antonio Quartulli
    Signed-off-by: Marek Lindner

    Antonio Quartulli
     

18 Feb, 2014

3 commits

  • When computing the CRC on a 2byte variable the order of
    the bytes obviously alters the final result. This means
    that computing the CRC over the same value on two archs
    having different endianess leads to different numbers.

    The global and local translation table CRC computation
    routine makes this mistake while processing the clients
    VIDs. The result is a continuous CRC mismatching between
    nodes having different endianess.

    Fix this by converting the VID to Network Order before
    processing it. This guarantees that every node uses the same
    byte order.

    Introduced by 7ea7b4a142758deaf46c1af0ca9ceca6dd55138b
    ("batman-adv: make the TT CRC logic VLAN specific")

    Reported-by: Russel Senior
    Signed-off-by: Antonio Quartulli
    Tested-by: Russell Senior
    Signed-off-by: Marek Lindner

    Antonio Quartulli
     
  • There is a refcounter unbalance in the CRC checking routine
    invoked on OGM reception. A vlan object is retrieved (thus
    its refcounter is increased by one) but it is never properly
    released. This leads to a memleak because the vlan object
    will never be free'd.

    Fix this by releasing the vlan object after having read the
    CRC.

    Reported-by: Russell Senior
    Reported-by: Daniel
    Reported-by: cmsv
    Signed-off-by: Antonio Quartulli
    Signed-off-by: Marek Lindner

    Antonio Quartulli
     
  • When accessing a TT-TVLV container in the OGM RX path
    the variable pointing to the list of changes to apply is
    altered by mistake.

    This makes the TT component read data at the wrong position
    in the OGM packet buffer.

    Fix it by removing the bogus pointer alteration.

    Signed-off-by: Antonio Quartulli
    Signed-off-by: Marek Lindner

    Antonio Quartulli
     

16 Jan, 2014

1 commit


12 Jan, 2014

3 commits

  • Signed-off-by: Simon Wunderlich
    Signed-off-by: Marek Lindner
    Signed-off-by: Antonio Quartulli

    Simon Wunderlich
     
  • For the network wide multi interface optimization there are different
    routers for each outgoing interface (outgoing from the OGM perspective,
    incoming for payload traffic). To reflect this, change the router and
    associated data to a list of routers.

    While at it, rename batadv_orig_node_get_router() to
    batadv_orig_router_get() to follow the new naming scheme.

    Signed-off-by: Simon Wunderlich
    Signed-off-by: Marek Lindner
    Signed-off-by: Antonio Quartulli

    Simon Wunderlich
     
  • For the network wide multi interface optimization it is required to save
    metrics per outgoing interface in one neighbor. Therefore a new type is
    introduced to keep interface-specific information. This also requires
    some changes in access and list management.

    The compare and equiv_or_better API calls are changed to take the
    outgoing interface into consideration.

    Signed-off-by: Simon Wunderlich
    Signed-off-by: Marek Lindner
    Signed-off-by: Antonio Quartulli

    Simon Wunderlich
     

09 Jan, 2014

6 commits


07 Jan, 2014

1 commit