1. 08 2月, 2013 1 次提交
    • I
      xen/netback: shutdown the ring if it contains garbage. · 48856286
      Ian Campbell 提交于
      A buggy or malicious frontend should not be able to confuse netback.
      If we spot anything which is not as it should be then shutdown the
      device and don't try to continue with the ring in a potentially
      hostile state. Well behaved and non-hostile frontends will not be
      penalised.
      
      As well as making the existing checks for such errors fatal also add a
      new check that ensures that there isn't an insane number of requests
      on the ring (i.e. more than would fit in the ring). If the ring
      contains garbage then previously is was possible to loop over this
      insane number, getting an error each time and therefore not generating
      any more pending requests and therefore not exiting the loop in
      xen_netbk_tx_build_gops for an externded period.
      
      Also turn various netdev_dbg calls which no precipitate a fatal error
      into netdev_err, they are rate limited because the device is shutdown
      afterwards.
      
      This fixes at least one known DoS/softlockup of the backend domain.
      Signed-off-by: NIan Campbell <ian.campbell@citrix.com>
      Reviewed-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Acked-by: NJan Beulich <JBeulich@suse.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      48856286
  2. 05 2月, 2013 1 次提交
    • B
      net: usbnet: fix tx_dropped statistics · bf414b36
      Bjørn Mork 提交于
      It is normal for minidrivers accumulating frames to return NULL
      from their tx_fixup function. We do not want to count this as a
      drop, or log any debug messages.  A different exit path is
      therefore chosen for such drivers, skipping the debug message
      and the tx_dropped increment.
      
      The test for accumulating drivers was however completely bogus,
      making the exit path selection depend on whether the user had
      enabled tx_err logging or not. This would arbitrarily mess up
      accounting for both accumulating and non-accumulating minidrivers,
      and would result in unwanted debug messages for the accumulating
      drivers.
      
      Fix by testing for FLAG_MULTI_PACKET instead, which probably was
      the intention from the beginning.  This usage match the documented
      behaviour of this flag:
      
       Indicates to usbnet, that USB driver accumulates multiple IP packets.
       Affects statistic (counters) and short packet handling.
      Signed-off-by: NBjørn Mork <bjorn@mork.no>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      bf414b36
  3. 03 2月, 2013 1 次提交
  4. 01 2月, 2013 1 次提交
  5. 31 1月, 2013 3 次提交
  6. 30 1月, 2013 6 次提交
  7. 29 1月, 2013 2 次提交
  8. 28 1月, 2013 5 次提交
  9. 27 1月, 2013 7 次提交
    • E
      net: loopback: fix a dst refcounting issue · 794ed393
      Eric Dumazet 提交于
      Ben Greear reported crashes in ip_rcv_finish() on a stress
      test involving many macvlans.
      
      We tracked the bug to a dst use after free. ip_rcv_finish()
      was calling dst->input() and got garbage for dst->input value.
      
      It appears the bug is in loopback driver, lacking
      a skb_dst_force() before calling netif_rx().
      
      As a result, a non refcounted dst, normally protected by a
      RCU read_lock section, was escaping this section and could
      be freed before the packet being processed.
      
        [<ffffffff813a3c4d>] loopback_xmit+0x64/0x83
        [<ffffffff81477364>] dev_hard_start_xmit+0x26c/0x35e
        [<ffffffff8147771a>] dev_queue_xmit+0x2c4/0x37c
        [<ffffffff81477456>] ? dev_hard_start_xmit+0x35e/0x35e
        [<ffffffff8148cfa6>] ? eth_header+0x28/0xb6
        [<ffffffff81480f09>] neigh_resolve_output+0x176/0x1a7
        [<ffffffff814ad835>] ip_finish_output2+0x297/0x30d
        [<ffffffff814ad6d5>] ? ip_finish_output2+0x137/0x30d
        [<ffffffff814ad90e>] ip_finish_output+0x63/0x68
        [<ffffffff814ae412>] ip_output+0x61/0x67
        [<ffffffff814ab904>] dst_output+0x17/0x1b
        [<ffffffff814adb6d>] ip_local_out+0x1e/0x23
        [<ffffffff814ae1c4>] ip_queue_xmit+0x315/0x353
        [<ffffffff814adeaf>] ? ip_send_unicast_reply+0x2cc/0x2cc
        [<ffffffff814c018f>] tcp_transmit_skb+0x7ca/0x80b
        [<ffffffff814c3571>] tcp_connect+0x53c/0x587
        [<ffffffff810c2f0c>] ? getnstimeofday+0x44/0x7d
        [<ffffffff810c2f56>] ? ktime_get_real+0x11/0x3e
        [<ffffffff814c6f9b>] tcp_v4_connect+0x3c2/0x431
        [<ffffffff814d6913>] __inet_stream_connect+0x84/0x287
        [<ffffffff814d6b38>] ? inet_stream_connect+0x22/0x49
        [<ffffffff8108d695>] ? _local_bh_enable_ip+0x84/0x9f
        [<ffffffff8108d6c8>] ? local_bh_enable+0xd/0x11
        [<ffffffff8146763c>] ? lock_sock_nested+0x6e/0x79
        [<ffffffff814d6b38>] ? inet_stream_connect+0x22/0x49
        [<ffffffff814d6b49>] inet_stream_connect+0x33/0x49
        [<ffffffff814632c6>] sys_connect+0x75/0x98
      
      This bug was introduced in linux-2.6.35, in commit
      7fee226a (net: add a noref bit on skb dst)
      
      skb_dst_force() is enforced in dev_queue_xmit() for devices having a
      qdisc.
      Reported-by: NBen Greear <greearb@candelatech.com>
      Signed-off-by: NEric Dumazet <edumazet@google.com>
      Tested-by: NBen Greear <greearb@candelatech.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      794ed393
    • W
      virtio-net: reset virtqueue affinity when doing cpu hotplug · 8de4b2f3
      Wanlong Gao 提交于
      Add a cpu notifier to virtio-net, so that we can reset the
      virtqueue affinity if the cpu hotplug happens. It improve
      the performance through enabling or disabling the virtqueue
      affinity after doing cpu hotplug.
      
      Cc: Rusty Russell <rusty@rustcorp.com.au>
      Cc: "Michael S. Tsirkin" <mst@redhat.com>
      Cc: Jason Wang <jasowang@redhat.com>
      Cc: Eric Dumazet <erdnetdev@gmail.com>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: virtualization@lists.linux-foundation.org
      Cc: netdev@vger.kernel.org
      Signed-off-by: NWanlong Gao <gaowanlong@cn.fujitsu.com>
      Acked-by: NMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      8de4b2f3
    • W
      virtio-net: split out clean affinity function · 8898c21c
      Wanlong Gao 提交于
      Split out the clean affinity function to virtnet_clean_affinity().
      
      Cc: Rusty Russell <rusty@rustcorp.com.au>
      Cc: "Michael S. Tsirkin" <mst@redhat.com>
      Cc: Jason Wang <jasowang@redhat.com>
      Cc: Eric Dumazet <erdnetdev@gmail.com>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: virtualization@lists.linux-foundation.org
      Cc: netdev@vger.kernel.org
      Signed-off-by: NWanlong Gao <gaowanlong@cn.fujitsu.com>
      Acked-by: NMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      8898c21c
    • W
      virtio-net: fix the set affinity bug when CPU IDs are not consecutive · 47be2479
      Wanlong Gao 提交于
      As Michael mentioned, set affinity and select queue will not work very
      well when CPU IDs are not consecutive, this can happen with hot unplug.
      Fix this bug by traversal the online CPUs, and create a per cpu variable
      to find the mapping from CPU to the preferable virtual-queue.
      
      Cc: Rusty Russell <rusty@rustcorp.com.au>
      Cc: "Michael S. Tsirkin" <mst@redhat.com>
      Cc: Jason Wang <jasowang@redhat.com>
      Cc: Eric Dumazet <erdnetdev@gmail.com>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: virtualization@lists.linux-foundation.org
      Cc: netdev@vger.kernel.org
      Signed-off-by: NWanlong Gao <gaowanlong@cn.fujitsu.com>
      Acked-by: NMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      47be2479
    • O
      can: pch_can: fix invalid error codes · ee50e135
      Olivier Sobrie 提交于
      Errors in CAN protocol (location) are reported in data[3] of the can
      frame instead of data[2].
      
      Cc: linux-stable <stable@vger.kernel.org>
      Signed-off-by: NOlivier Sobrie <olivier@sobrie.be>
      Signed-off-by: NMarc Kleine-Budde <mkl@pengutronix.de>
      ee50e135
    • O
      can: ti_hecc: fix invalid error codes · 71088c4b
      Olivier Sobrie 提交于
      Errors in CAN protocol (location) are reported in data[3] of the can
      frame instead of data[2].
      
      Cc: linux-stable <stable@vger.kernel.org>
      Cc: Anant Gole <anantgole@ti.com>
      Signed-off-by: NOlivier Sobrie <olivier@sobrie.be>
      Signed-off-by: NMarc Kleine-Budde <mkl@pengutronix.de>
      71088c4b
    • O
      can: c_can: fix invalid error codes · 6ea45886
      Olivier Sobrie 提交于
      Errors in CAN protocol (location) are reported in data[3] of the can
      frame instead of data[2].
      
      Cc: linux-stable <stable@vger.kernel.org>
      Cc: Bhupesh Sharma <bhupesh.sharma@st.com>
      Signed-off-by: NOlivier Sobrie <olivier@sobrie.be>
      Signed-off-by: NMarc Kleine-Budde <mkl@pengutronix.de>
      6ea45886
  10. 24 1月, 2013 5 次提交
    • E
      Revert "iwlwifi: fix the reclaimed packet tracking upon flush queue" · ae023b27
      Emmanuel Grumbach 提交于
      This reverts commit f590dcec
      which has been reported to cause issues.
      
      See https://lkml.org/lkml/2013/1/20/4 for further details.
      
      Cc: stable@vger.kernel.org [3.7]
      Signed-off-by: NEmmanuel Grumbach <emmanuel.grumbach@intel.com>
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      ae023b27
    • T
      r8169: remove the obsolete and incorrect AMD workaround · 5d0feaff
      Timo Teräs 提交于
      This was introduced in commit 6dccd16b "r8169: merge with version
      6.001.00 of Realtek's r8169 driver". I did not find the version
      6.001.00 online, but in 6.002.00 or any later r8169 from Realtek
      this hunk is no longer present.
      
      Also commit 05af2142 "r8169: fix Ethernet Hangup for RTL8110SC
      rev d" claims to have fixed this issue otherwise.
      
      The magic compare mask of 0xfffe000 is dubious as it masks
      parts of the Reserved part, and parts of the VLAN tag. But this
      does not make much sense as the VLAN tag parts are perfectly
      valid there. In matter of fact this seems to be triggered with
      any VLAN tagged packet as RxVlanTag bit is matched. I would
      suspect 0xfffe0000 was intended to test reserved part only.
      
      Finally, this hunk is evil as it can cause more packets to be
      handled than what was NAPI quota causing net/core/dev.c:
      net_rx_action(): WARN_ON_ONCE(work > weight) to trigger, and
      mess up the NAPI state causing device to hang.
      
      As result, any system using VLANs and having high receive
      traffic (so that NAPI poll budget limits rtl_rx) would result
      in device hang.
      Signed-off-by: NTimo Teräs <timo.teras@iki.fi>
      Acked-by: NFrancois Romieu <romieu@fr.zoreil.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      5d0feaff
    • J
      tuntap: limit the number of flow caches · b8732fb7
      Jason Wang 提交于
      We create new flow caches when a new flow is identified by tuntap, This may lead
      some issues:
      
      - userspace may produce a huge amount of short live flows to exhaust host memory
      - the unlimited number of flow caches may produce a long list which increase the
        time in the linear searching
      
      Solve this by introducing a limit of total number of flow caches.
      
      Cc: Stephen Hemminger <stephen@networkplumber.org>
      Signed-off-by: NJason Wang <jasowang@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b8732fb7
    • J
      tuntap: reduce memory using of queues · edfb6a14
      Jason Wang 提交于
      A MAX_TAP_QUEUES(1024) queues of tuntap device is always allocated
      unconditionally even userspace only requires a single queue device. This is
      unnecessary and will lead a very high order of page allocation when has a high
      possibility to fail. Solving this by creating a one queue net device when
      userspace only use one queue and also reduce MAX_TAP_QUEUES to
      DEFAULT_MAX_NUM_RSS_QUEUES which can guarantee the success of
      the allocation.
      Reported-by: NDirk Hohndel <dirk@hohndel.org>
      Cc: Eric Dumazet <eric.dumazet@gmail.com>
      Cc: David Woodhouse <dwmw2@infradead.org>
      Cc: Michael S. Tsirkin <mst@redhat.com>
      Signed-off-by: NJason Wang <jasowang@redhat.com>
      Acked-by: NMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      edfb6a14
    • B
      net: cdc_mbim: send ZLP only for the specific buggy device · 844e88f0
      Bjørn Mork 提交于
      Reverting 328d7b8a and instead adding an exception for the
      Sierra Wireless MC7710.
      
      commit 328d7b8a (net: cdc_mbim: send ZLP after max sized NTBs)
      added a workaround for an issue observed on one specific device.
      Concerns were raised that this workaround adds a performance
      penalty to all devices based on questionable, if not buggy,
      behaviour of a single device:
      
       "If you add ZLP for NTBs of dwNtbOutMaxSize, you are heavily affecting CPU
        load, increasing interrupt load by factor of 2 in high load traffic
        scenario and possibly decreasing throughput for all other devices
        which behaves correctly."
      
       "The idea of NCM was to avoid extra ZLPs. If your transfer is exactly
        dwNtbOutMaxSize, it's known, you can submit such request on the receiver
        side and you do not need any EOT indicatation, so the frametime can be
        used for useful data."
      
      Adding a device specific exception to prevent the workaround from
      affecting well behaved devices.
      
      The assumption here is that needing a ZLP is truly an *exception*.
      We do not yet have enough data to verify this.  The generic
      workaround in commit 328d7b8a should be considered acceptable despite
      the performance penalty if the exception list becomes a maintainance
      hassle.
      
      Cc: Alexey ORISHKO <alexey.orishko@stericsson.com>
      Cc: Yauheni Kaliuta <y.kaliuta@gmail.com>
      Signed-off-by: NBjørn Mork <bjorn@mork.no>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      844e88f0
  11. 23 1月, 2013 7 次提交
  12. 22 1月, 2013 1 次提交