1. 11 2月, 2016 7 次提交
    • J
      ipv4: add option to drop unicast encapsulated in L2 multicast · 12b74dfa
      Johannes Berg 提交于
      In order to solve a problem with 802.11, the so-called hole-196 attack,
      add an option (sysctl) called "drop_unicast_in_l2_multicast" which, if
      enabled, causes the stack to drop IPv4 unicast packets encapsulated in
      link-layer multi- or broadcast frames. Such frames can (as an attack)
      be created by any member of the same wireless network and transmitted
      as valid encrypted frames since the symmetric key for broadcast frames
      is shared between all stations.
      
      Additionally, enabling this option provides compliance with a SHOULD
      clause of RFC 1122.
      Reviewed-by: NJulian Anastasov <ja@ssi.bg>
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      12b74dfa
    • D
      net: Add support for filtering link dump by master device and kind · dc599f76
      David Ahern 提交于
      Add support for filtering link dumps by master device and kind, similar
      to the filtering implemented for neighbor dumps.
      
      Each net_device that exists adds between 1196 bytes (eth) and 1556 bytes
      (bridge) to the link dump. As the number of interfaces increases so does
      the amount of data pushed to user space for a link list. If the user
      only wants to see a list of specific devices (e.g., interfaces enslaved
      to a specific bridge or a list of VRFs) most of that data is thrown away.
      Passing the filters to the kernel to have only relevant data returned
      makes the dump more efficient.
      Signed-off-by: NDavid Ahern <dsa@cumulusnetworks.com>
      Acked-by: NRoopa Prabhu <roopa@cumulusnetworks.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      dc599f76
    • C
      soreuseport: fast reuseport TCP socket selection · c125e80b
      Craig Gallek 提交于
      This change extends the fast SO_REUSEPORT socket lookup implemented
      for UDP to TCP.  Listener sockets with SO_REUSEPORT and the same
      receive address are additionally added to an array for faster
      random access.  This means that only a single socket from the group
      must be found in the listener list before any socket in the group can
      be used to receive a packet.  Previously, every socket in the group
      needed to be considered before handing off the incoming packet.
      
      This feature also exposes the ability to use a BPF program when
      selecting a socket from a reuseport group.
      Signed-off-by: NCraig Gallek <kraig@google.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c125e80b
    • C
      soreuseport: Prep for fast reuseport TCP socket selection · fa463497
      Craig Gallek 提交于
      Both of the lines in this patch probably should have been included
      in the initial implementation of this code for generic socket
      support, but weren't technically necessary since only UDP sockets
      were supported.
      
      First, the sk_reuseport_cb points to a structure which assumes
      each socket in the group has this pointer assigned at the same
      time it's added to the array in the structure.  The sk_clone_lock
      function breaks this assumption.  Since a child socket shouldn't
      implicitly be in a reuseport group, the simple fix is to clear
      the field in the clone.
      
      Second, the SO_ATTACH_REUSEPORT_xBPF socket options require that
      SO_REUSEPORT also be set first.  For UDP sockets, this is easily
      enforced at bind-time since that process both puts the socket in
      the appropriate receive hlist and updates the reuseport structures.
      Since these operations can happen at two different times for TCP
      sockets (bind and listen) it must be explicitly checked to enforce
      the use of SO_REUSEPORT with SO_ATTACH_REUSEPORT_xBPF in the
      setsockopt call.
      Signed-off-by: NCraig Gallek <kraig@google.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      fa463497
    • C
      inet: refactor inet[6]_lookup functions to take skb · a583636a
      Craig Gallek 提交于
      This is a preliminary step to allow fast socket lookup of SO_REUSEPORT
      groups.  Doing so with a BPF filter will require access to the
      skb in question.  This change plumbs the skb (and offset to payload
      data) through the call stack to the listening socket lookup
      implementations where it will be used in a following patch.
      Signed-off-by: NCraig Gallek <kraig@google.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a583636a
    • C
      inet: create IPv6-equivalent inet_hash function · 496611d7
      Craig Gallek 提交于
      In order to support fast lookups for TCP sockets with SO_REUSEPORT,
      the function that adds sockets to the listening hash set needs
      to be able to check receive address equality.  Since this equality
      check is different for IPv4 and IPv6, we will need two different
      socket hashing functions.
      
      This patch adds inet6_hash identical to the existing inet_hash function
      and updates the appropriate references.  A following patch will
      differentiate the two by passing different comparison functions to
      __inet_hash.
      
      Additionally, in order to use the IPv6 address equality function from
      inet6_hashtables (which is compiled as a built-in object when IPv6 is
      enabled) it also needs to be in a built-in object file as well.  This
      moves ipv6_rcv_saddr_equal into inet_hashtables to accomplish this.
      Signed-off-by: NCraig Gallek <kraig@google.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      496611d7
    • C
      sock: struct proto hash function may error · 086c653f
      Craig Gallek 提交于
      In order to support fast reuseport lookups in TCP, the hash function
      defined in struct proto must be capable of returning an error code.
      This patch changes the function signature of all related hash functions
      to return an integer and handles or propagates this return value at
      all call sites.
      Signed-off-by: NCraig Gallek <kraig@google.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      086c653f
  2. 10 2月, 2016 21 次提交
  3. 09 2月, 2016 6 次提交
  4. 08 2月, 2016 6 次提交