1. 16 12月, 2015 3 次提交
  2. 15 12月, 2015 3 次提交
  3. 12 12月, 2015 1 次提交
  4. 11 12月, 2015 2 次提交
    • 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
    • A
      mac802154: tx: fix synced xmit deadlock · c3838353
      Alexander Aring 提交于
      This patch reverts 6001d522 ("mac802154: tx: don't allow if down while
      sync tx"). This has side effects with stop callback which flush the
      transmit workqueue. The stop callback will wait until the workqueue is
      flushed and holding the rtnl lock. That means it can happen that the stop
      callback waits forever because it try to lock the rtnl mutex which is
      already hold by stop callback.
      
      Cc: Michael Hennerich <michael.hennerich@analog.com>
      Signed-off-by: NAlexander Aring <alex.aring@gmail.com>
      Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
      c3838353
  5. 10 12月, 2015 29 次提交
  6. 09 12月, 2015 2 次提交
    • T
      sock, cgroup: add sock->sk_cgroup · bd1060a1
      Tejun Heo 提交于
      In cgroup v1, dealing with cgroup membership was difficult because the
      number of membership associations was unbound.  As a result, cgroup v1
      grew several controllers whose primary purpose is either tagging
      membership or pull in configuration knobs from other subsystems so
      that cgroup membership test can be avoided.
      
      net_cls and net_prio controllers are examples of the latter.  They
      allow configuring network-specific attributes from cgroup side so that
      network subsystem can avoid testing cgroup membership; unfortunately,
      these are not only cumbersome but also problematic.
      
      Both net_cls and net_prio aren't properly hierarchical.  Both inherit
      configuration from the parent on creation but there's no interaction
      afterwards.  An ancestor doesn't restrict the behavior in its subtree
      in anyway and configuration changes aren't propagated downwards.
      Especially when combined with cgroup delegation, this is problematic
      because delegatees can mess up whatever network configuration
      implemented at the system level.  net_prio would allow the delegatees
      to set whatever priority value regardless of CAP_NET_ADMIN and net_cls
      the same for classid.
      
      While it is possible to solve these issues from controller side by
      implementing hierarchical allowable ranges in both controllers, it
      would involve quite a bit of complexity in the controllers and further
      obfuscate network configuration as it becomes even more difficult to
      tell what's actually being configured looking from the network side.
      While not much can be done for v1 at this point, as membership
      handling is sane on cgroup v2, it'd be better to make cgroup matching
      behave like other network matches and classifiers than introducing
      further complications.
      
      In preparation, this patch updates sock->sk_cgrp_data handling so that
      it points to the v2 cgroup that sock was created in until either
      net_prio or net_cls is used.  Once either of the two is used,
      sock->sk_cgrp_data reverts to its previous role of carrying prioidx
      and classid.  This is to avoid adding yet another cgroup related field
      to struct sock.
      
      As the mode switching can happen at most once per boot, the switching
      mechanism is aimed at lowering hot path overhead.  It may leak a
      finite, likely small, number of cgroup refs and report spurious
      prioidx or classid on switching; however, dynamic updates of prioidx
      and classid have always been racy and lossy - socks between creation
      and fd installation are never updated, config changes don't update
      existing sockets at all, and prioidx may index with dead and recycled
      cgroup IDs.  Non-critical inaccuracies from small race windows won't
      make any noticeable difference.
      
      This patch doesn't make use of the pointer yet.  The following patch
      will implement netfilter match for cgroup2 membership.
      
      v2: Use sock_cgroup_data to avoid inflating struct sock w/ another
          cgroup specific field.
      
      v3: Add comments explaining why sock_data_prioidx() and
          sock_data_classid() use different fallback values.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Cc: Daniel Borkmann <daniel@iogearbox.net>
      Cc: Daniel Wagner <daniel.wagner@bmw-carit.de>
      CC: Neil Horman <nhorman@tuxdriver.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      bd1060a1
    • T
      net: wrap sock->sk_cgrp_prioidx and ->sk_classid inside a struct · 2a56a1fe
      Tejun Heo 提交于
      Introduce sock->sk_cgrp_data which is a struct sock_cgroup_data.
      ->sk_cgroup_prioidx and ->sk_classid are moved into it.  The struct
      and its accessors are defined in cgroup-defs.h.  This is to prepare
      for overloading the fields with a cgroup pointer.
      
      This patch mostly performs equivalent conversions but the followings
      are noteworthy.
      
      * Equality test before updating classid is removed from
        sock_update_classid().  This shouldn't make any noticeable
        difference and a similar test will be implemented on the helper side
        later.
      
      * sock_update_netprioidx() now takes struct sock_cgroup_data and can
        be moved to netprio_cgroup.h without causing include dependency
        loop.  Moved.
      
      * The dummy version of sock_update_netprioidx() converted to a static
        inline function while at it.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      2a56a1fe