1. 29 5月, 2015 2 次提交
  2. 03 4月, 2015 1 次提交
  3. 23 2月, 2015 1 次提交
  4. 21 2月, 2015 1 次提交
  5. 08 1月, 2015 15 次提交
  6. 06 1月, 2015 6 次提交
  7. 24 12月, 2014 3 次提交
    • A
      batman-adv: avoid NULL dereferences and fix if check · 0d164491
      Antonio Quartulli 提交于
      Gateway having bandwidth_down equal to zero are not accepted
      at all and so never added to the Gateway list.
      For this reason checking the bandwidth_down member in
      batadv_gw_out_of_range() is useless.
      
      This is probably a copy/paste error and this check was supposed
      to be "!gw_node" only. Moreover, the way the check is written
      now may also lead to a NULL dereference.
      
      Fix this by rewriting the if-condition properly.
      
      Introduced by 414254e3
      ("batman-adv: tvlv - gateway download/upload bandwidth container")
      Signed-off-by: NAntonio Quartulli <antonio@meshcoding.com>
      Reported-by: NDavid Binderman <dcb314@hotmail.com>
      Signed-off-by: NMarek Lindner <mareklindner@neomailbox.ch>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      0d164491
    • S
      batman-adv: Unify fragment size calculation · 0402e444
      Sven Eckelmann 提交于
      The fragmentation code was replaced in 610bfc6b
      ("batman-adv: Receive fragmented packets and merge") by an implementation which
      can handle up to 16 fragments of a packet. The packet is prepared for the split
      in fragments by the function batadv_frag_send_packet and the actual split is
      done by batadv_frag_create.
      
      Both functions calculate the size of a fragment themself. But their calculation
      differs because batadv_frag_send_packet also subtracts ETH_HLEN. Therefore,
      the check in batadv_frag_send_packet "can a full fragment can be created?" may
      return true even when batadv_frag_create cannot create a full fragment.
      
      The function batadv_frag_create doesn't check the size of the skb before
      splitting it and therefore might try to create a larger fragment than the
      remaining buffer. This creates an integer underflow and an invalid len is given
      to skb_split.
      Signed-off-by: NSven Eckelmann <sven@narfation.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      0402e444
    • S
      batman-adv: Calculate extra tail size based on queued fragments · 5b6698b0
      Sven Eckelmann 提交于
      The fragmentation code was replaced in 610bfc6b
      ("batman-adv: Receive fragmented packets and merge"). The new code provided a
      mostly unused parameter skb for the merging function. It is used inside the
      function to calculate the additionally needed skb tailroom. But instead of
      increasing its own tailroom, it is only increasing the tailroom of the first
      queued skb. This is not correct in some situations because the first queued
      entry can be a different one than the parameter.
      
      An observed problem was:
      
      1. packet with size 104, total_size 1464, fragno 1 was received
         - packet is queued
      2. packet with size 1400, total_size 1464, fragno 0 was received
         - packet is queued at the end of the list
      3. enough data was received and can be given to the merge function
         (1464 == (1400 - 20) + (104 - 20))
         - merge functions gets 1400 byte large packet as skb argument
      4. merge function gets first entry in queue (104 byte)
         - stored as skb_out
      5. merge function calculates the required extra tail as total_size - skb->len
         - pskb_expand_head tail of skb_out with 64 bytes
      6. merge function tries to squeeze the extra 1380 bytes from the second queued
         skb (1400 byte aka skb parameter) in the 64 extra tail bytes of skb_out
      
      Instead calculate the extra required tail bytes for skb_out also using skb_out
      instead of using the parameter skb. The skb parameter is only used to get the
      total_size from the last received packet. This is also the total_size used to
      decide that all fragments were received.
      Reported-by: NPhilipp Psurek <philipp.psurek@gmail.com>
      Signed-off-by: NSven Eckelmann <sven@narfation.org>
      Acked-by: NMartin Hundebøll <martin@hundeboll.net>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      5b6698b0
  8. 14 10月, 2014 1 次提交
  9. 17 8月, 2014 1 次提交
    • S
      batman-adv: Fix parameter order of hlist_add_behind · e050dbeb
      Sven Eckelmann 提交于
      1d023284 ("list: fix order of arguments for
      hlist_add_after(_rcu)") was incorrectly rebased on top of
      d9124268 ("batman-adv: Fix out-of-order
      fragmentation support"). The parameter order change of the rebased patch was
      not re-applied as expected. This causes a memory leak and can cause crashes
      when out-of-order packets are received. hlist_add_behind will try to access the
      uninitalized list pointers of frag_entry_new to find the previous/next entry
      and may modify/read random memory locations.
      Signed-off-by: NSven Eckelmann <sven@narfation.org>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e050dbeb
  10. 08 8月, 2014 1 次提交
  11. 07 8月, 2014 1 次提交
    • K
      list: fix order of arguments for hlist_add_after(_rcu) · 1d023284
      Ken Helias 提交于
      All other add functions for lists have the new item as first argument
      and the position where it is added as second argument.  This was changed
      for no good reason in this function and makes using it unnecessary
      confusing.
      
      The name was changed to hlist_add_behind() to cause unconverted code to
      generate a compile error instead of using the wrong parameter order.
      
      [akpm@linux-foundation.org: coding-style fixes]
      Signed-off-by: NKen Helias <kenhelias@firemail.de>
      Cc: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
      Acked-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>	[intel driver bits]
      Cc: Hugh Dickins <hughd@google.com>
      Cc: Christoph Hellwig <hch@infradead.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      1d023284
  12. 05 8月, 2014 4 次提交
    • S
      71b75d0e
    • S
      batman-adv: increase default hop penalty · e03366ea
      Simon Wunderlich 提交于
      The default hop penalty is currently set to 15, which is applied like
      that for multi interface devices (e.g. dual band APs). Single band
      devices will still use an effective penalty of 30 (hop penalty + wifi
      penalty).
      
      After receiving reports of too long paths in mesh networks with dual
      band APs which were fixed by increasing the hop penalty, we'd like to
      suggest to increase that default value in the default setting as well.
      We've evaluated that increase in a handful of medium sized mesh
      networks (5-20 nodes) with single and dual band devices, with changes
      for the better (shorter routes, higher throughput) or no change at all.
      
      This patch changes the hop penalty to 30, which will give an effective
      penalty of 60 on single band devices (hop penalty + wifi penalty).
      Signed-off-by: NSimon Wunderlich <simon@open-mesh.com>
      Signed-off-by: NMarek Lindner <mareklindner@neomailbox.ch>
      Signed-off-by: NAntonio Quartulli <antonio@meshcoding.com>
      e03366ea
    • A
      batman-adv: remove unnecessary logspam · 23c4ec10
      André Gaul 提交于
      This patch removes unnecessary logspam which resulted from superfluous
      calls to net_ratelimit(). With the supplied patch, net_ratelimit() is
      called after the loglevel has been checked.
      Signed-off-by: NAndré Gaul <gaul@web-yard.de>
      Signed-off-by: NMarek Lindner <mareklindner@neomailbox.ch>
      Signed-off-by: NAntonio Quartulli <antonio@meshcoding.com>
      23c4ec10
    • S
      batman-adv: Fix out-of-order fragmentation support · d9124268
      Sven Eckelmann 提交于
      batadv_frag_insert_packet was unable to handle out-of-order packets because it
      dropped them directly. This is caused by the way the fragmentation lists is
      checked for the correct place to insert a fragmentation entry.
      
      The fragmentation code keeps the fragments in lists. The fragmentation entries
      are kept in descending order of sequence number. The list is traversed and each
      entry is compared with the new fragment. If the current entry has a smaller
      sequence number than the new fragment then the new one has to be inserted
      before the current entry. This ensures that the list is still in descending
      order.
      
      An out-of-order packet with a smaller sequence number than all entries in the
      list still has to be added to the end of the list. The used hlist has no
      information about the last entry in the list inside hlist_head and thus the
      last entry has to be calculated differently. Currently the code assumes that
      the iterator variable of hlist_for_each_entry can be used for this purpose
      after the hlist_for_each_entry finished. This is obviously wrong because the
      iterator variable is always NULL when the list was completely traversed.
      
      Instead the information about the last entry has to be stored in a different
      variable.
      
      This problem was introduced in 610bfc6b
      ("batman-adv: Receive fragmented packets and merge").
      Signed-off-by: NSven Eckelmann <sven@narfation.org>
      Signed-off-by: NMarek Lindner <mareklindner@neomailbox.ch>
      Signed-off-by: NAntonio Quartulli <antonio@meshcoding.com>
      d9124268
  13. 04 8月, 2014 1 次提交
  14. 21 7月, 2014 2 次提交
    • A
      batman-adv: fix TT VLAN inconsistency on VLAN re-add · 35df3b29
      Antonio Quartulli 提交于
      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: NAntonio Quartulli <antonio@open-mesh.com>
      Signed-off-by: NMarek Lindner <mareklindner@neomailbox.ch>
      35df3b29
    • S
      batman-adv: drop QinQ claim frames in bridge loop avoidance · d46b6bfa
      Simon Wunderlich 提交于
      Since bridge loop avoidance only supports untagged or simple 802.1q
      tagged VLAN claim frames, claim frames with stacked VLAN headers (QinQ)
      should be detected and dropped. Transporting the over the mesh may cause
      problems on the receivers, or create bogus entries in the local tt
      tables.
      Reported-by: NAntonio Quartulli <antonio@open-mesh.com>
      Signed-off-by: NSimon Wunderlich <simon@open-mesh.com>
      Signed-off-by: NMarek Lindner <mareklindner@neomailbox.ch>
      Signed-off-by: NAntonio Quartulli <antonio@meshcoding.com>
      d46b6bfa