1. 29 5月, 2015 11 次提交
  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