1. 29 1月, 2016 4 次提交
  2. 23 1月, 2016 2 次提交
    • L
      Bluetooth: 6lowpan: Fix handling of uncompressed IPv6 packets · 87f5fedb
      Lukasz Duda 提交于
      This patch fixes incorrect handling of the 6lowpan packets that contain
      uncompressed IPv6 header.
      
      RFC4944 specifies a special dispatch for 6lowpan to carry uncompressed
      IPv6 header. This dispatch (1 byte long) has to be removed during
      reception and skb data pointer has to be moved. To correctly point in
      the beginning of the IPv6 header the dispatch byte has to be pulled off
      before packet can be processed by netif_rx_in().
      
      Test scenario: IPv6 packets are not correctly interpreted by the network
      layer when IPv6 header is not compressed (e.g. ICMPv6 Echo Reply is not
      propagated correctly to the ICMPv6 layer because the extra byte will make
      the header look corrupted).
      
      Similar approach is done for IEEE 802.15.4.
      Signed-off-by: NLukasz Duda <lukasz.duda@nordicsemi.no>
      Signed-off-by: NGlenn Ruben Bakke <glenn.ruben.bakke@nordicsemi.no>
      Acked-by: NJukka Rissanen <jukka.rissanen@linux.intel.com>
      Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
      Cc: stable@vger.kernel.org # 4.4+
      87f5fedb
    • G
      Bluetooth: 6lowpan: Fix kernel NULL pointer dereferences · 4c58f328
      Glenn Ruben Bakke 提交于
      The fixes provided in this patch assigns a valid net_device structure to
      skb before dispatching it for further processing.
      
      Scenario #1:
      ============
      
      Bluetooth 6lowpan receives an uncompressed IPv6 header, and dispatches it
      to netif. The following error occurs:
      
      Null pointer dereference error #1 crash log:
      
      [  845.854013] BUG: unable to handle kernel NULL pointer dereference at
                     0000000000000048
      [  845.855785] IP: [<ffffffff816e3d36>] enqueue_to_backlog+0x56/0x240
      ...
      [  845.909459] Call Trace:
      [  845.911678]  [<ffffffff816e3f64>] netif_rx_internal+0x44/0xf0
      
      The first modification fixes the NULL pointer dereference error by
      assigning dev to the local_skb in order to set a valid net_device before
      processing the skb by netif_rx_ni().
      
      Scenario #2:
      ============
      
      Bluetooth 6lowpan receives an UDP compressed message which needs further
      decompression by nhc_udp. The following error occurs:
      
      Null pointer dereference error #2 crash log:
      
      [   63.295149] BUG: unable to handle kernel NULL pointer dereference at
                     0000000000000840
      [   63.295931] IP: [<ffffffffc0559540>] udp_uncompress+0x320/0x626
                     [nhc_udp]
      
      The second modification fixes the NULL pointer dereference error by
      assigning dev to the local_skb in the case of a udp compressed packet.
      The 6lowpan udp_uncompress function expects that the net_device is set in
      the skb when checking lltype.
      Signed-off-by: NGlenn Ruben Bakke <glenn.ruben.bakke@nordicsemi.no>
      Signed-off-by: NLukasz Duda <lukasz.duda@nordicsemi.no>
      Acked-by: NJukka Rissanen <jukka.rissanen@linux.intel.com>
      Signed-off-by: NJohan Hedberg <johan.hedberg@intel.com>
      Cc: stable@vger.kernel.org # 4.4+
      4c58f328
  3. 06 1月, 2016 3 次提交
  4. 20 12月, 2015 1 次提交
  5. 16 12月, 2015 1 次提交
  6. 11 12月, 2015 1 次提交
    • D
      Bluetooth: Do not filter multicast addresses by default · 4ada1282
      Danny Schweizer 提交于
      A Linux PC is connected with another device over Bluetooth PAN using a
      BNEP interface.
      
      Whenever a packet is tried to be sent over the BNEP interface, the
      function "bnep_net_xmit()" in "net/bluetooth/bnep/netdev.c" is called.
      This function calls "bnep_net_mc_filter()", which checks (if the
      destination address is multicast) if the address is set in a certain
      multicast filter (&s->mc_filter). If it is not, then it is not sent out.
      
      This filter is only changed in two other functions, found in
      net/bluetooth/bnep/core.c": in "bnep_ctrl_set_mc_filter()", which is
      only called if a message of type "BNEP_FILTER_MULTI_ADDR_SET" is
      received. Otherwise, it is set in "bnep_add_connection()", where it is
      set to a default value which only adds the broadcast address to the
      filter:
      
      set_bit(bnep_mc_hash(dev->broadcast), (ulong *) &s->mc_filter);
      
      To sum up, if the BNEP interface does not receive any message of type
      "BNEP_FILTER_MULTI_ADDR_SET", it will not send out any messages with
      multicast destination addresses except for broadcast.
      
      However, in the BNEP specification (page 27 in
      http://grouper.ieee.org/groups/802/15/Bluetooth/BNEP.pdf), it is said
      that per default, all multicast addresses should not be filtered, i.e.
      the BNEP interface should be able to send packets with any multicast
      destination address.
      
      It seems that the default case is wrong: the multicast filter should not
      block almost all multicast addresses, but should not filter out any.
      
      This leads to the problem that e.g. Neighbor Solicitation messages sent
      with Bluetooth PAN over the BNEP interface to a multicast destination
      address other than broadcast are blocked and not sent out.
      
      Therefore, in the default case, we set the mc_filter to ~0LL to not
      filter out any multicast addresses.
      Signed-off-by: NDanny Schweizer <danny.schweizer@proofnet.de>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      4ada1282
  7. 10 12月, 2015 21 次提交
  8. 02 12月, 2015 1 次提交
    • E
      net: rename SOCK_ASYNC_NOSPACE and SOCK_ASYNC_WAITDATA · 9cd3e072
      Eric Dumazet 提交于
      This patch is a cleanup to make following patch easier to
      review.
      
      Goal is to move SOCK_ASYNC_NOSPACE and SOCK_ASYNC_WAITDATA
      from (struct socket)->flags to a (struct socket_wq)->flags
      to benefit from RCU protection in sock_wake_async()
      
      To ease backports, we rename both constants.
      
      Two new helpers, sk_set_bit(int nr, struct sock *sk)
      and sk_clear_bit(int net, struct sock *sk) are added so that
      following patch can change their implementation.
      Signed-off-by: NEric Dumazet <edumazet@google.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      9cd3e072
  9. 23 11月, 2015 3 次提交
  10. 22 11月, 2015 3 次提交