1. 21 10月, 2016 1 次提交
    • S
      net: add recursion limit to GRO · fcd91dd4
      Sabrina Dubroca 提交于
      Currently, GRO can do unlimited recursion through the gro_receive
      handlers.  This was fixed for tunneling protocols by limiting tunnel GRO
      to one level with encap_mark, but both VLAN and TEB still have this
      problem.  Thus, the kernel is vulnerable to a stack overflow, if we
      receive a packet composed entirely of VLAN headers.
      
      This patch adds a recursion counter to the GRO layer to prevent stack
      overflow.  When a gro_receive function hits the recursion limit, GRO is
      aborted for this skb and it is processed normally.  This recursion
      counter is put in the GRO CB, but could be turned into a percpu counter
      if we run out of space in the CB.
      
      Thanks to Vladimír Beneš <vbenes@redhat.com> for the initial bug report.
      
      Fixes: CVE-2016-7039
      Fixes: 9b174d88 ("net: Add Transparent Ethernet Bridging GRO support.")
      Fixes: 66e5133f ("vlan: Add GRO support for non hardware accelerated vlan")
      Signed-off-by: NSabrina Dubroca <sd@queasysnail.net>
      Reviewed-by: NJiri Benc <jbenc@redhat.com>
      Acked-by: NHannes Frederic Sowa <hannes@stressinduktion.org>
      Acked-by: NTom Herbert <tom@herbertland.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      fcd91dd4
  2. 19 10月, 2016 1 次提交
  3. 18 10月, 2016 1 次提交
  4. 14 8月, 2016 1 次提交
    • S
      net: remove type_check from dev_get_nest_level() · 952fcfd0
      Sabrina Dubroca 提交于
      The idea for type_check in dev_get_nest_level() was to count the number
      of nested devices of the same type (currently, only macvlan or vlan
      devices).
      This prevented the false positive lockdep warning on configurations such
      as:
      
      eth0 <--- macvlan0 <--- vlan0 <--- macvlan1
      
      However, this doesn't prevent a warning on a configuration such as:
      
      eth0 <--- macvlan0 <--- vlan0
      eth1 <--- vlan1 <--- macvlan1
      
      In this case, all the locks end up with a nesting subclass of 1, so
      lockdep thinks that there is still a deadlock:
      
      - in the first case we have (macvlan_netdev_addr_lock_key, 1) and then
        take (vlan_netdev_xmit_lock_key, 1)
      - in the second case, we have (vlan_netdev_xmit_lock_key, 1) and then
        take (macvlan_netdev_addr_lock_key, 1)
      
      By removing the linktype check in dev_get_nest_level() and always
      incrementing the nesting depth, lockdep considers this configuration
      valid.
      Signed-off-by: NSabrina Dubroca <sd@queasysnail.net>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      952fcfd0
  5. 01 6月, 2016 1 次提交
    • M
      vlan: Propagate MAC address to VLANs · 308453aa
      Mike Manning 提交于
      The MAC address of the physical interface is only copied to the VLAN
      when it is first created, resulting in an inconsistency after MAC
      address changes of only newly created VLANs having an up-to-date MAC.
      
      The VLANs should continue inheriting the MAC address of the physical
      interface until the VLAN MAC address is explicitly set to any value.
      This allows IPv6 EUI64 addresses for the VLAN to reflect any changes
      to the MAC of the physical interface and thus for DAD to behave as
      expected.
      Signed-off-by: NMike Manning <mmanning@brocade.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      308453aa
  6. 18 3月, 2016 1 次提交
  7. 22 2月, 2016 1 次提交
  8. 02 6月, 2015 1 次提交
    • T
      vlan: Add GRO support for non hardware accelerated vlan · 66e5133f
      Toshiaki Makita 提交于
      Currently packets with non-hardware-accelerated vlan cannot be handled
      by GRO. This causes low performance for 802.1ad and stacked vlan, as their
      vlan tags are currently not stripped by hardware.
      
      This patch adds GRO support for non-hardware-accelerated vlan and
      improves receive performance of them.
      
      Test Environment:
       vlan device (.1Q) on vlan device (.1ad) on ixgbe (82599)
      
      Result:
      
      - Before
      
      $ netperf -t TCP_STREAM -H 192.168.20.2 -l 60
      Recv   Send    Send
      Socket Socket  Message  Elapsed
      Size   Size    Size     Time     Throughput
      bytes  bytes   bytes    secs.    10^6bits/sec
      
       87380  16384  16384    60.00    5233.17
      
      Rx side CPU usage:
        %usr      %sys      %irq     %soft     %idle
        0.27     58.03      0.00     41.70      0.00
      
      - After
      
      $ netperf -t TCP_STREAM -H 192.168.20.2 -l 60
      Recv   Send    Send
      Socket Socket  Message  Elapsed
      Size   Size    Size     Time     Throughput
      bytes  bytes   bytes    secs.    10^6bits/sec
      
       87380  16384  16384    60.00    7586.85
      
      Rx side CPU usage:
        %usr      %sys      %irq     %soft     %idle
        0.50     25.83      0.00     59.53     14.14
      
      [ Register VLAN offloads with priority 10 -DaveM ]
      Signed-off-by: NToshiaki Makita <makita.toshiaki@lab.ntt.co.jp>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      66e5133f
  9. 14 5月, 2015 1 次提交
    • V
      vlan: Correctly propagate promisc|allmulti flags in notifier. · be346ffa
      Vlad Yasevich 提交于
      Currently vlan notifier handler will try to update all vlans
      for a device when that device comes up.  A problem occurs,
      however, when the vlan device was set to promiscuous, but not
      by the user (ex: a bridge).  In that case, dev->gflags are
      not updated.  What results is that the lower device ends
      up with an extra promiscuity count.  Here are the
      backtraces that prove this:
      [62852.052179]  [<ffffffff814fe248>] __dev_set_promiscuity+0x38/0x1e0
      [62852.052186]  [<ffffffff8160bcbb>] ? _raw_spin_unlock_bh+0x1b/0x40
      [62852.052188]  [<ffffffff814fe4be>] ? dev_set_rx_mode+0x2e/0x40
      [62852.052190]  [<ffffffff814fe694>] dev_set_promiscuity+0x24/0x50
      [62852.052194]  [<ffffffffa0324795>] vlan_dev_open+0xd5/0x1f0 [8021q]
      [62852.052196]  [<ffffffff814fe58f>] __dev_open+0xbf/0x140
      [62852.052198]  [<ffffffff814fe88d>] __dev_change_flags+0x9d/0x170
      [62852.052200]  [<ffffffff814fe989>] dev_change_flags+0x29/0x60
      
      The above comes from the setting the vlan device to IFF_UP state.
      
      [62852.053569]  [<ffffffff814fe248>] __dev_set_promiscuity+0x38/0x1e0
      [62852.053571]  [<ffffffffa032459b>] ? vlan_dev_set_rx_mode+0x2b/0x30
      [8021q]
      [62852.053573]  [<ffffffff814fe8d5>] __dev_change_flags+0xe5/0x170
      [62852.053645]  [<ffffffff814fe989>] dev_change_flags+0x29/0x60
      [62852.053647]  [<ffffffffa032334a>] vlan_device_event+0x18a/0x690
      [8021q]
      [62852.053649]  [<ffffffff8161036c>] notifier_call_chain+0x4c/0x70
      [62852.053651]  [<ffffffff8109d456>] raw_notifier_call_chain+0x16/0x20
      [62852.053653]  [<ffffffff814f744d>] call_netdevice_notifiers+0x2d/0x60
      [62852.053654]  [<ffffffff814fe1a3>] __dev_notify_flags+0x33/0xa0
      [62852.053656]  [<ffffffff814fe9b2>] dev_change_flags+0x52/0x60
      [62852.053657]  [<ffffffff8150cd57>] do_setlink+0x397/0xa40
      
      And this one comes from the notification code.  What we end
      up with is a vlan with promiscuity count of 1 and and a physical
      device with a promiscuity count of 2.  They should both have
      a count 1.
      
      To resolve this issue, vlan code can use dev_get_flags() api
      which correctly masks promiscuity and allmulti flags.
      Signed-off-by: NVlad Yasevich <vyasevic@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      be346ffa
  10. 19 3月, 2015 1 次提交
    • D
      net: Fix high overhead of vlan sub-device teardown. · 99c4a26a
      David S. Miller 提交于
      When a networking device is taken down that has a non-trivial number
      of VLAN devices configured under it, we eat a full synchronize_net()
      for every such VLAN device.
      
      This is because of the call chain:
      
      	NETDEV_DOWN notifier
      	--> vlan_device_event()
      		--> dev_change_flags()
      		--> __dev_change_flags()
      		--> __dev_close()
      		--> __dev_close_many()
      		--> dev_deactivate_many()
      			--> synchronize_net()
      
      This is kind of rediculous because we already have infrastructure for
      batching doing operation X to a list of net devices so that we only
      incur one sync.
      
      So make use of that by exporting dev_close_many() and adjusting it's
      interfaace so that the caller can fully manage the batch list.  Use
      this in vlan_device_event() and all the overhead goes away.
      Reported-by: NSalam Noureddine <noureddine@arista.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      99c4a26a
  11. 30 7月, 2014 1 次提交
  12. 16 7月, 2014 1 次提交
    • T
      net: set name_assign_type in alloc_netdev() · c835a677
      Tom Gundersen 提交于
      Extend alloc_netdev{,_mq{,s}}() to take name_assign_type as argument, and convert
      all users to pass NET_NAME_UNKNOWN.
      
      Coccinelle patch:
      
      @@
      expression sizeof_priv, name, setup, txqs, rxqs, count;
      @@
      
      (
      -alloc_netdev_mqs(sizeof_priv, name, setup, txqs, rxqs)
      +alloc_netdev_mqs(sizeof_priv, name, NET_NAME_UNKNOWN, setup, txqs, rxqs)
      |
      -alloc_netdev_mq(sizeof_priv, name, setup, count)
      +alloc_netdev_mq(sizeof_priv, name, NET_NAME_UNKNOWN, setup, count)
      |
      -alloc_netdev(sizeof_priv, name, setup)
      +alloc_netdev(sizeof_priv, name, NET_NAME_UNKNOWN, setup)
      )
      
      v9: move comments here from the wrong commit
      Signed-off-by: NTom Gundersen <teg@jklm.no>
      Reviewed-by: NDavid Herrmann <dh.herrmann@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c835a677
  13. 17 5月, 2014 1 次提交
  14. 28 3月, 2014 1 次提交
  15. 22 1月, 2014 1 次提交
  16. 27 9月, 2013 2 次提交
  17. 04 8月, 2013 1 次提交
    • W
      vlan: cleanup the usage of vlan_dev_priv(dev) · 0c0667a8
      Wang Sheng-Hui 提交于
      This patch cleanup 2 points for the usage of vlan_dev_priv(dev):
      * In vlan_dev.c/vlan_dev_hard_header, we should use the var *vlan directly
        after grabing the pointer at the beginning with
              *vlan = vlan_dev_priv(dev);
        when we need to access the fields of *vlan.
      * In vlan.c/register_vlan_device, add the var *vlan pointer
              struct vlan_dev_priv *vlan;
      to cleanup the code to access the fields of vlan_dev_priv(new_dev).
      Signed-off-by: NWang Sheng-Hui <shhuiw@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      0c0667a8
  18. 24 7月, 2013 1 次提交
  19. 29 5月, 2013 1 次提交
  20. 20 4月, 2013 3 次提交
  21. 25 3月, 2013 1 次提交
  22. 11 2月, 2013 1 次提交
  23. 30 1月, 2013 1 次提交
  24. 05 1月, 2013 1 次提交
  25. 01 12月, 2012 1 次提交
    • Y
      8021q: fix vlan device to inherit the unicast filtering capability flag · 6e22ce2c
      Yi Zou 提交于
      This bug is observed on running FCoE over a VLAN device associated w/
      a real device that has IFF_UNICAST_FLT set since FCoE would add unicast
      address such as FLOGI MAC to the VLAN interface that FCoE is on. Since
      currently, VLAN device is not inheriting the IFF_UNICAST_FLT flag from the
      parent real device even though the real device is capable of doing unicast
      filtering. This forces the VLAN device and its real device go to promiscuous
      mode unnecessarily even the added address is actually being added to the
      available unicast filter table in real device.
      Signed-off-by: NYi Zou <yi.zou@intel.com>
      Cc: devel@open-fcoe.org
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      6e22ce2c
  26. 19 11月, 2012 1 次提交
  27. 02 11月, 2012 1 次提交
  28. 19 10月, 2012 1 次提交
  29. 11 7月, 2012 1 次提交
  30. 10 5月, 2012 1 次提交
    • J
      8021q: Convert compare_ether_addr to ether_addr_equal · 53a2b3a1
      Joe Perches 提交于
      Use the new bool function ether_addr_equal to add
      some clarity and reduce the likelihood for misuse
      of compare_ether_addr for sorting.
      
      Done via cocci script:
      
      $ cat compare_ether_addr.cocci
      @@
      expression a,b;
      @@
      -	!compare_ether_addr(a, b)
      +	ether_addr_equal(a, b)
      
      @@
      expression a,b;
      @@
      -	compare_ether_addr(a, b)
      +	!ether_addr_equal(a, b)
      
      @@
      expression a,b;
      @@
      -	!ether_addr_equal(a, b) == 0
      +	ether_addr_equal(a, b)
      
      @@
      expression a,b;
      @@
      -	!ether_addr_equal(a, b) != 0
      +	!ether_addr_equal(a, b)
      
      @@
      expression a,b;
      @@
      -	ether_addr_equal(a, b) == 0
      +	!ether_addr_equal(a, b)
      
      @@
      expression a,b;
      @@
      -	ether_addr_equal(a, b) != 0
      +	ether_addr_equal(a, b)
      
      @@
      expression a,b;
      @@
      -	!!ether_addr_equal(a, b)
      +	ether_addr_equal(a, b)
      Signed-off-by: NJoe Perches <joe@perches.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      53a2b3a1
  31. 09 12月, 2011 3 次提交
  32. 02 8月, 2011 1 次提交
  33. 22 7月, 2011 1 次提交
  34. 17 6月, 2011 1 次提交
  35. 03 6月, 2011 1 次提交