1. 13 4月, 2014 4 次提交
    • N
      vti: don't allow to add the same tunnel twice · 8d89dcdf
      Nicolas Dichtel 提交于
      Before the patch, it was possible to add two times the same tunnel:
      ip l a vti1 type vti remote 10.16.0.121 local 10.16.0.249 key 41
      ip l a vti2 type vti remote 10.16.0.121 local 10.16.0.249 key 41
      
      It was possible, because ip_tunnel_newlink() calls ip_tunnel_find() with the
      argument dev->type, which was set only later (when calling ndo_init handler
      in register_netdevice()). Let's set this type in the setup handler, which is
      called before newlink handler.
      
      Introduced by commit b9959fd3 ("vti: switch to new ip tunnel code").
      
      CC: Cong Wang <amwang@redhat.com>
      CC: Steffen Klassert <steffen.klassert@secunet.com>
      Signed-off-by: NNicolas Dichtel <nicolas.dichtel@6wind.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      8d89dcdf
    • N
      gre: don't allow to add the same tunnel twice · 5a455275
      Nicolas Dichtel 提交于
      Before the patch, it was possible to add two times the same tunnel:
      ip l a gre1 type gre remote 10.16.0.121 local 10.16.0.249
      ip l a gre2 type gre remote 10.16.0.121 local 10.16.0.249
      
      It was possible, because ip_tunnel_newlink() calls ip_tunnel_find() with the
      argument dev->type, which was set only later (when calling ndo_init handler
      in register_netdevice()). Let's set this type in the setup handler, which is
      called before newlink handler.
      
      Introduced by commit c5441932 ("GRE: Refactor GRE tunneling code.").
      
      CC: Pravin B Shelar <pshelar@nicira.com>
      Signed-off-by: NNicolas Dichtel <nicolas.dichtel@6wind.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      5a455275
    • V
      drivers: net: xen-netfront: fix array initialization bug · 810d8ced
      Vincenzo Maffione 提交于
      This patch fixes the initialization of an array used in the TX
      datapath that was mistakenly initialized together with the
      RX datapath arrays. An out of range array access could happen
      when RX and TX rings had different sizes.
      Signed-off-by: NVincenzo Maffione <v.maffione@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      810d8ced
    • D
      Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net · dcfba949
      David S. Miller 提交于
      Jeff Kirsher says:
      
      ====================
      Intel Wired LAN Driver Updates
      
      This series contains updates to e1000, e1000e, igb, igbvf, ixgb, ixgbe,
      ixgbevf and i40evf.
      
      Mark fixes an issue with ixgbe and ixgbevf by adding a bit to indicate
      when workqueues have been initialized.  This permits the register read
      error handling from attempting to use them prior to that, which also
      generates warnings.  Checking for a detected removal after initializing
      the work queues allows the probe function to return an error without
      getting the workqueue involved.  Further, if the error_detected
      callback is entered before the workqueues are initialized, exit without
      recovery since the device initialization was so truncated.
      
      Francois Romieu provides several patches to all the drivers to remove
      the open coded skb_cow_head.
      
      Jakub Kicinski provides a fix for igb where last_rx_timestamp should be
      updated only when Rx time stamp is read.
      
      Mitch provides a fix for i40evf where a recent change broke the RSS LUT
      programming causing it to be programmed with all 0's.
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      dcfba949
  2. 12 4月, 2014 16 次提交
    • D
      pktgen: be friendly to LLTX devices · 0f2eea4b
      Daniel Borkmann 提交于
      Similarly to commit 43279500 ("packet: respect devices with
      LLTX flag in direct xmit"), we can basically apply the very same
      to pktgen. This will help testing against LLTX devices such as
      dummy driver (or others), which only have a single netdevice txq
      and would otherwise require locking their txq from pktgen side
      while e.g. in dummy case, we would not need any locking. Fix this
      by making use of HARD_TX_{UN,}LOCK API, so that NETIF_F_LLTX will
      be respected.
      Signed-off-by: NDaniel Borkmann <dborkman@redhat.com>
      Signed-off-by: NJesper Dangaard Brouer <brouer@redhat.com>
      Cc: Eric Dumazet <edumazet@google.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      0f2eea4b
    • H
      r8152: check RTL8152_UNPLUG · 6871438c
      hayeswang 提交于
      When the device is unplugged, the driver would try to disable the
      device. Add checking the flag of RTL8152_UNPLUG to skip setting
      the device when it is unplugged. This could shorten the time of
      unloading the driver.
      Signed-off-by: NHayes Wang <hayeswang@realtek.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      6871438c
    • M
      net: sun4i-emac: add promiscuous support · cec9ae50
      Marc Zyngier 提交于
      The sun4i-emac driver is rather primitive, and doesn't support
      promiscuous mode. This makes usage such as bridging impossible,
      which is a shame on virtualization capable HW such as the
      Allwinner A20.
      
      The fix is fairly simple: move the RX setup code to the ndo_set_rx_mode
      vector, and add the required HW configuration when IFF_PROMISC is passed
      by the core code.
      
      This has been tested on a generic A20 box running a few virtual
      machines hanging off a bridge with the EMAC chip as the link to the
      outside world.
      
      Cc: Stefan Roese <sr@denx.de>
      Cc: Maxime Ripard <maxime.ripard@free-electrons.com>
      Signed-off-by: NMarc Zyngier <marc.zyngier@arm.com>
      Acked-by: NStefan Roese <sr@denx.de>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      cec9ae50
    • D
      net/apne: replace IS_ERR and PTR_ERR with PTR_ERR_OR_ZERO · 0af764e3
      Duan Jiong 提交于
      This patch fixes coccinelle error regarding usage of IS_ERR and
      PTR_ERR instead of PTR_ERR_OR_ZERO.
      Signed-off-by: NDuan Jiong <duanj.fnst@cn.fujitsu.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      0af764e3
    • L
      net: ipv6: Fix oif in TCP SYN+ACK route lookup. · a36dbdb2
      Lorenzo Colitti 提交于
      net-next commit 9c76a114, ipv6: tcp_ipv6 policy route issue, had
      a boolean logic error that caused incorrect behaviour for TCP
      SYN+ACK when oif-based rules are in use. Specifically:
      
      1. If a SYN comes in from a global address, and sk_bound_dev_if
         is not set, the routing lookup has oif set to the interface
         the SYN came in on. Instead, it should have oif unset,
         because for global addresses, the incoming interface doesn't
         necessarily have any bearing on the interface the SYN+ACK is
         sent out on.
      2. If a SYN comes in from a link-local address, and
         sk_bound_dev_if is set, the routing lookup has oif set to the
         interface the SYN came in on. Instead, it should have oif set
         to sk_bound_dev_if, because that's what the application
         requested.
      Signed-off-by: NLorenzo Colitti <lorenzo@google.com>
      Acked-by: NHannes Frederic Sowa <hannes@stressinduktion.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a36dbdb2
    • D
      Merge branch 'for-davem' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless · 6a489c48
      David S. Miller 提交于
      John W. Linville says:
      
      ====================
      Please pull this batch of fixes intended for the 3.15 stream!
      
      Chun-Yeow Yeoh gives us an ath9k_htc fix so that mac80211 can report
      last_tx_rate correctly for those devices..
      
      Fariya Fatima has a number of small fixes for things identified by
      the static analysis folks in the new rsi driver.
      
      Felix Fietkau brings an ath9k fix to better support some older chips,
      and a fix for a scheduling while atomic bug introduced by an earlier
      patch.
      
      Janusz Dziedzic produced an ath9k fix to only enable DFS when a
      related build option is selected.
      
      Paul Bolle removes some dead code in rtlwifi.
      
      Rafał Miłecki fixes some b43 code that was accessing some registers
      with operations for the wrong register width.
      
      Please let me know if there are problems!
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      6a489c48
    • D
      Merge branch 'cpsw' · 45cdf9f3
      David S. Miller 提交于
      Mugunthan V N says:
      
      ====================
      This patch series fixes the cpsw issue with interface up/dpwn with high
      ethernet traffic.
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      45cdf9f3
    • M
      drivers: net: cpsw: enable interrupts after napi enable and clearing previous interrupts · f63a975e
      Mugunthan V N 提交于
      When the Ethernet interface is put down and up with heavy Ethernet
      traffic, then there is prossibility of an interrupt waiting in irq
      controller to be processed, so when the interface is brought up again
      just after enable interrupt, it goes to ISR due to the previous
      unhandled interrutp and in ISR napi is not scheduled as the napi
      is not enabled in ndo_open which results in disabled interrupt for
      CPSW and no packets are received in cpsw. So this patch moves enabling
      of interupts after napi_enable and clearing CPDMA interrupts.
      Signed-off-by: NMugunthan V N <mugunthanvnm@ti.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f63a975e
    • M
      drivers: net: cpsw: discard all packets received when interface is down · 16e5c57d
      Mugunthan V N 提交于
      When the Ethernet interface is brought down during high Ethernet traffic,
      then cpsw creates the following warn dump. When cpdma has already processed
      the packet then the status will be greater than 0, so the cpsw_rx_handler
      considers that the interface is up and try to resubmit one more rx buffer
      to cpdma which fails as the DMA is in teardown process. This can be avoided
      by checking the interface state and then process the received packet, if the
      interface is down just discard and free the skb and return.
      
      [ 2823.104591] WARNING: CPU: 0 PID: 1823 at drivers/net/ethernet/ti/cpsw.c:711 cpsw_rx_handler+0x148/0x164()
      [ 2823.114654] Modules linked in:
      [ 2823.117872] CPU: 0 PID: 1823 Comm: ifconfig Tainted: G        W     3.14.0-11992-gf34c4a35 #11
      [ 2823.126860] [<c0014b5c>] (unwind_backtrace) from [<c00117e4>] (show_stack+0x10/0x14)
      [ 2823.135030] [<c00117e4>] (show_stack) from [<c0533a9c>] (dump_stack+0x80/0x9c)
      [ 2823.142619] [<c0533a9c>] (dump_stack) from [<c003f0e0>] (warn_slowpath_common+0x6c/0x90)
      [ 2823.151141] [<c003f0e0>] (warn_slowpath_common) from [<c003f120>] (warn_slowpath_null+0x1c/0x24)
      [ 2823.160336] [<c003f120>] (warn_slowpath_null) from [<c03caeb0>] (cpsw_rx_handler+0x148/0x164)
      [ 2823.169314] [<c03caeb0>] (cpsw_rx_handler) from [<c03c730c>] (__cpdma_chan_free+0x90/0xa8)
      [ 2823.178028] [<c03c730c>] (__cpdma_chan_free) from [<c03c7418>] (__cpdma_chan_process+0xf4/0x134)
      [ 2823.187279] [<c03c7418>] (__cpdma_chan_process) from [<c03c7560>] (cpdma_chan_stop+0xb4/0x17c)
      [ 2823.196349] [<c03c7560>] (cpdma_chan_stop) from [<c03c766c>] (cpdma_ctlr_stop+0x44/0x9c)
      [ 2823.204872] [<c03c766c>] (cpdma_ctlr_stop) from [<c03cb708>] (cpsw_ndo_stop+0x154/0x188)
      [ 2823.213321] [<c03cb708>] (cpsw_ndo_stop) from [<c046f0ec>] (__dev_close_many+0x84/0xc8)
      [ 2823.221761] [<c046f0ec>] (__dev_close_many) from [<c046f158>] (__dev_close+0x28/0x3c)
      [ 2823.230012] [<c046f158>] (__dev_close) from [<c0474ca8>] (__dev_change_flags+0x88/0x160)
      [ 2823.238483] [<c0474ca8>] (__dev_change_flags) from [<c0474da0>] (dev_change_flags+0x18/0x48)
      [ 2823.247316] [<c0474da0>] (dev_change_flags) from [<c04d12c4>] (devinet_ioctl+0x61c/0x6e0)
      [ 2823.255884] [<c04d12c4>] (devinet_ioctl) from [<c045c660>] (sock_ioctl+0x68/0x2a4)
      [ 2823.263789] [<c045c660>] (sock_ioctl) from [<c0125fe4>] (do_vfs_ioctl+0x78/0x61c)
      [ 2823.271629] [<c0125fe4>] (do_vfs_ioctl) from [<c01265ec>] (SyS_ioctl+0x64/0x74)
      [ 2823.279284] [<c01265ec>] (SyS_ioctl) from [<c000e580>] (ret_fast_syscall+0x0/0x48)
      Signed-off-by: NMugunthan V N <mugunthanvnm@ti.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      16e5c57d
    • D
      net: Fix use after free by removing length arg from sk_data_ready callbacks. · 676d2369
      David S. Miller 提交于
      Several spots in the kernel perform a sequence like:
      
      	skb_queue_tail(&sk->s_receive_queue, skb);
      	sk->sk_data_ready(sk, skb->len);
      
      But at the moment we place the SKB onto the socket receive queue it
      can be consumed and freed up.  So this skb->len access is potentially
      to freed up memory.
      
      Furthermore, the skb->len can be modified by the consumer so it is
      possible that the value isn't accurate.
      
      And finally, no actual implementation of this callback actually uses
      the length argument.  And since nobody actually cared about it's
      value, lots of call sites pass arbitrary values in such as '0' and
      even '1'.
      
      So just remove the length argument from the callback, that way there
      is no confusion whatsoever and all of these use-after-free cases get
      fixed as a side effect.
      
      Based upon a patch by Eric Dumazet and his suggestion to audit this
      issue tree-wide.
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      676d2369
    • D
      Merge branch 'hyperv' · ad20d5f6
      David S. Miller 提交于
      K. Y. Srinivasan says:
      
      ====================
      Fix issues with Heper-V network offload code
      
      WS2008 R2 does not support udp checksum offload. Furthermore, ws2012 and
      ws2012 r2 have issues offloading udp checksum from Linux guests.
      This patch-set addresses these issues as well as other bug fixes.
      Please apply.
      
      In this version, I have addressed the comment from David Miller with reagards
      to COWing the skb prior to modifying the header (patch 3/3).
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ad20d5f6
    • K
      Drivers: net: hyperv: Address UDP checksum issues · af9893a3
      KY Srinivasan 提交于
      ws2008r2 does not support UDP checksum offload. Thus, we cannnot turn on
      UDP offload in the host. Also, on ws2012 and ws2012 r2, there appear to be
      an issue with UDP checksum offload.
      Fix this issue by computing the UDP checksum in the Hyper-V driver.
      
      Based on Dave Miller's comments, in this version, I have COWed the skb
      before modifying the UDP header (the checksum field).
      Signed-off-by: NK. Y. Srinivasan <kys@microsoft.com>
      Reviewed-by: NHaiyang Zhang <haiyangz@microsoft.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      af9893a3
    • K
      Drivers: net: hyperv: Negotiate suitable ndis version for offload support · 1f73db49
      KY Srinivasan 提交于
      Ws2008R2 supports ndis_version 6.1 and 6.1 is the minimal version required
      for various offloads. Negotiate ndis_version 6.1 when on ws2008r2.
      Signed-off-by: NK. Y. Srinivasan <kys@microsoft.com>
      Reviewed-by: NHaiyang Zhang <haiyangz@microsoft.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      1f73db49
    • K
      Drivers: net: hyperv: Allocate memory for all possible per-pecket information · 4276372f
      KY Srinivasan 提交于
      An outgoing packet can potentially need per-packet information for
      all the offloads and VLAN tagging. Fix this issue.
      Signed-off-by: NK. Y. Srinivasan <kys@microsoft.com>
      Reviewed-by: NHaiyang Zhang <haiyangz@microsoft.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4276372f
    • T
      bridge: Fix double free and memory leak around br_allowed_ingress · eb707618
      Toshiaki Makita 提交于
      br_allowed_ingress() has two problems.
      
      1. If br_allowed_ingress() is called by br_handle_frame_finish() and
      vlan_untag() in br_allowed_ingress() fails, skb will be freed by both
      vlan_untag() and br_handle_frame_finish().
      
      2. If br_allowed_ingress() is called by br_dev_xmit() and
      br_allowed_ingress() fails, the skb will not be freed.
      
      Fix these two problems by freeing the skb in br_allowed_ingress()
      if it fails.
      Signed-off-by: NToshiaki Makita <makita.toshiaki@lab.ntt.co.jp>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      eb707618
    • T
      bonding: Remove debug_fs files when module init fails · db298686
      Thomas Richter 提交于
      Remove the bonding debug_fs entries when the
      module initialization fails. The debug_fs
      entries should be removed together with all other
      already allocated resources.
      Signed-off-by: NThomas Richter <tmricht@linux.vnet.ibm.com>
      Signed-off-by: NJay Vosburgh <j.vosburgh@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      db298686
  3. 11 4月, 2014 14 次提交
  4. 10 4月, 2014 6 次提交