1. 21 8月, 2015 30 次提交
  2. 20 8月, 2015 2 次提交
    • N
      vrf: vrf_master_ifindex_rcu is not always called with rcu read lock · 18041e31
      Nikolay Aleksandrov 提交于
      While running net-next I hit this:
      [  634.073119] ===============================
      [  634.073150] [ INFO: suspicious RCU usage. ]
      [  634.073182] 4.2.0-rc6+ #45 Not tainted
      [  634.073213] -------------------------------
      [  634.073244] include/net/vrf.h:38 suspicious rcu_dereference_check()
      usage!
      [  634.073274]
                     other info that might help us debug this:
      
      [  634.073307]
                     rcu_scheduler_active = 1, debug_locks = 1
      [  634.073338] 2 locks held by swapper/0/0:
      [  634.073369]  #0:  (((&n->timer))){+.-...}, at: [<ffffffff8112bc35>]
      call_timer_fn+0x5/0x480
      [  634.073412]  #1:  (slock-AF_INET){+.-...}, at: [<ffffffff8174f0f5>]
      icmp_send+0x155/0x5f0
      [  634.073450]
                     stack backtrace:
      [  634.073483] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.2.0-rc6+ #45
      [  634.073514] Hardware name: innotek GmbH VirtualBox/VirtualBox, BIOS
      VirtualBox 12/01/2006
      [  634.073545]  0000000000000000 0593ba8242d9ace4 ffff88002fc03b48
      ffffffff81803f1b
      [  634.073612]  0000000000000000 ffffffff81e12500 ffff88002fc03b78
      ffffffff811003c5
      [  634.073642]  0000000000000000 ffff88002ec4e600 ffffffff81f00f80
      ffff88002fc03cf0
      [  634.073669] Call Trace:
      [  634.073694]  <IRQ>  [<ffffffff81803f1b>] dump_stack+0x4c/0x65
      [  634.073728]  [<ffffffff811003c5>] lockdep_rcu_suspicious+0xc5/0x100
      [  634.073763]  [<ffffffff8174eb56>] icmp_route_lookup+0x176/0x5c0
      [  634.073793]  [<ffffffff8174f2fb>] ? icmp_send+0x35b/0x5f0
      [  634.073818]  [<ffffffff8174f274>] ? icmp_send+0x2d4/0x5f0
      [  634.073844]  [<ffffffff8174f3ce>] icmp_send+0x42e/0x5f0
      [  634.073873]  [<ffffffff8170b662>] ipv4_link_failure+0x22/0xa0
      [  634.073899]  [<ffffffff8174bdda>] arp_error_report+0x3a/0x80
      [  634.073926]  [<ffffffff816d6100>] ? neigh_lookup+0x2c0/0x2c0
      [  634.073952]  [<ffffffff816d396e>] neigh_invalidate+0x8e/0x110
      [  634.073984]  [<ffffffff816d62ae>] neigh_timer_handler+0x1ae/0x290
      [  634.074013]  [<ffffffff816d6100>] ? neigh_lookup+0x2c0/0x2c0
      [  634.074013]  [<ffffffff8112bce3>] call_timer_fn+0xb3/0x480
      [  634.074013]  [<ffffffff8112bc35>] ? call_timer_fn+0x5/0x480
      [  634.074013]  [<ffffffff816d6100>] ? neigh_lookup+0x2c0/0x2c0
      [  634.074013]  [<ffffffff8112c2bc>] run_timer_softirq+0x20c/0x430
      [  634.074013]  [<ffffffff810af50e>] __do_softirq+0xde/0x630
      [  634.074013]  [<ffffffff810afc97>] irq_exit+0x117/0x120
      [  634.074013]  [<ffffffff81810976>] smp_apic_timer_interrupt+0x46/0x60
      [  634.074013]  [<ffffffff8180e950>] apic_timer_interrupt+0x70/0x80
      [  634.074013]  <EOI>  [<ffffffff8106b9d6>] ? native_safe_halt+0x6/0x10
      [  634.074013]  [<ffffffff81101d8d>] ? trace_hardirqs_on+0xd/0x10
      [  634.074013]  [<ffffffff81027d43>] default_idle+0x23/0x200
      [  634.074013]  [<ffffffff8102852f>] arch_cpu_idle+0xf/0x20
      [  634.074013]  [<ffffffff810f89ba>] default_idle_call+0x2a/0x40
      [  634.074013]  [<ffffffff810f8dcc>] cpu_startup_entry+0x39c/0x4c0
      [  634.074013]  [<ffffffff817f9cad>] rest_init+0x13d/0x150
      [  634.074013]  [<ffffffff81f69038>] start_kernel+0x4a8/0x4c9
      [  634.074013]  [<ffffffff81f68120>] ?
      early_idt_handler_array+0x120/0x120
      [  634.074013]  [<ffffffff81f68339>] x86_64_start_reservations+0x2a/0x2c
      [  634.074013]  [<ffffffff81f68485>] x86_64_start_kernel+0x14a/0x16d
      
      It would seem vrf_master_ifindex_rcu() can be called without RCU held in
      other contexts as well so introduce a new helper which acquires rcu and
      returns the ifindex.
      Also add curly braces around both the "if" and "else" parts as per the
      style guide.
      Signed-off-by: NNikolay Aleksandrov <nikolay@cumulusnetworks.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      18041e31
    • Y
      lwtunnel: Fix the sparse warnings in fib_encap_match · 824e7383
      Ying Xue 提交于
      When CONFIG_LWTUNNEL config is not enabled, the lwtstate_free() is not
      declared in lwtunnel.h at all. However, even in this case, the function
      is still referenced in fib_semantics.c so that there appears the
      following sparse warnings:
      
      net/ipv4/fib_semantics.c:553:17: error: undefined identifier 'lwtstate_free'
        CC      net/ipv4/fib_semantics.o
        net/ipv4/fib_semantics.c: In function ‘fib_encap_match’:
        net/ipv4/fib_semantics.c:553:3: error: implicit declaration of function ‘lwtstate_free’ [-Werror=implicit-function-declaration]
        cc1: some warnings being treated as errors
        make[1]: *** [net/ipv4/fib_semantics.o] Error 1
        make: *** [net/ipv4/fib_semantics.o] Error 2
      
      To eliminate the error, we define an empty function for lwtstate_free()
      in lwtunnel.h when CONFIG_LWTUNNEL is disabled.
      
      Fixes: df383e62 ("lwtunnel: fix memory leak")
      Cc: Jiri Benc <jbenc@redhat.com>
      Reported-by: Nkbuild test robot <fengguang.wu@intel.com>
      Signed-off-by: NYing Xue <ying.xue@windriver.com>
      Acked-by: NJiri Benc <jbenc@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      824e7383
  3. 19 8月, 2015 8 次提交
    • D
      Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next-queue · def63be8
      David S. Miller 提交于
      Jeff Kirsher says:
      
      ====================
      Intel Wired LAN Driver Updates 2015-08-18
      
      This series contains updates to igb, e100, e1000e and ixgbe.
      
      Shota Suzuki provides a fix for a possible overflow in
      igb_set_interrupt_capability() which leads to an oops.  When changing the
      number of queues by "ethtool -L", set IGB_FLAG_QUEUE_PAIRS in the same
      manner as when initializing the igb driver.
      
      Vasily Averin provides a fix for a missing rtnl_unlock() for when we
      error out due to not being able to allocate memory for our queues.
      
      Stefan Assman provides a couple of fixes for igb/igbvf.  First changes
      the igb driver in probe to simply call igb_enable_sriov() instead of
      igb_sriov_reinit() since we are starting from scratch.  Then in igbvf,
      fix the driver where it does not clear the buffer_info->dma in all
      cases after calling dma_unmap_single(), which was found by changing the
      MTU twice.
      
      Richard Cochran implements the periodic output function using the
      programmable clock outputs available in i210 when possible, falling
      back to the target time for longer periods.
      
      Todd adds support for the Marvell PHY 1512 which is required for i354
      devices.  Then updates igb to make sure SR-IOV init uses the correct
      number of queues, since recent changes could result in the PF holding
      onto all of the queues.
      
      Alex Williamson provides a fix in the case where a guest OS does not
      support hot-unplug, so disable SR-IOV prior to unregister_netdev() to
      avoid the problem.
      
      Jia-Ju Bai provides several patches, first knocks some collecting dust
      off an old e100 driver to add a check to avoid a null pointer
      dereference.  Then cleans up a possible resource leak by releasing the
      skb buffer allocated when the e100_xmit_prepare() runs into an issue
      in the DMA mapping.  In igb, add a missing rtnl_unlock() for when we
      error out due to igb_sriov_reinit() in the igb_init_interrupt_scheme().
      Provides a e1000e fix, based on suggestions from Alex Duyck to move
      head/tail register writing to e1000_configure_tx/rx() to avoid a
      possible null pointer dereference (similar to igb driver).  Lastly,
      fix a possible memory leak in igb_probe(), where the memory shadow_vfta
      allocated by kcalloc in igb_sw_init() is not freed.
      
      Mark simplifies port-specific macros for ixgbe by eliminating explicit
      comparisons with 0 and enclose formal parameters in parens to eliminate
      the risk of an operator precedence issue.
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      def63be8
    • D
      Merge branch 'vrf-next' · 1c8aa215
      David S. Miller 提交于
      Nikolay Aleksandrov says:
      
      ====================
      vrf: a few simplifications and cleanups
      
      These patches remove some unnecessary checks (patches 3, 4), unnecessary
      num_slaves member and refcnt manipulations which are already done by the
      upper functions.
      ====================
      Acked-by: NDavid Ahern <dsa@cumulusnetworks.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      1c8aa215
    • N
      vrf: simplify the netdev notifier function · 58aa9087
      Nikolay Aleksandrov 提交于
      We can drop the check because if vrf_ptr is present then we must have
      the vrf device as a master and since we're running with rtnl it can't go
      away.
      Signed-off-by: NNikolay Aleksandrov <nikolay@cumulusnetworks.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      58aa9087
    • N
      vrf: don't check for dstats and rth in uninit path · 3a4a27d3
      Nikolay Aleksandrov 提交于
      dstats and rth are always present because we fail the device registration
      if they can't be allocated in vrf_init() (ndo_init) so drop the unnecessary
      checks.
      Signed-off-by: NNikolay Aleksandrov <nikolay@cumulusnetworks.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      3a4a27d3
    • N
      vrf: drop unused num_slaves member · db5dbec5
      Nikolay Aleksandrov 提交于
      slave_queue has a num_slaves member which is unused, drop it.
      Signed-off-by: NNikolay Aleksandrov <nikolay@cumulusnetworks.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      db5dbec5
    • N
      vrf: drop unnecessary dev refcnt changes · 17d95f5e
      Nikolay Aleksandrov 提交于
      netdev_master_upper_dev_link/unlink already do a dev_hold/put on the
      devices being linked, so no need to take another reference.
      Signed-off-by: NNikolay Aleksandrov <nikolay@cumulusnetworks.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      17d95f5e
    • A
      hv_netvsc: Fix dereference of nvdev before check · 954591b9
      Andrew Schwartzmeyer 提交于
      Passes static analysis by Smatch.
      Signed-off-by: NAndrew Schwartzmeyer <andschwa@microsoft.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      954591b9
    • J
      lwtunnel: ip tunnel: fix multiple routes with different encap · 2d798499
      Jiri Benc 提交于
      Currently, two routes going through the same tunnel interface are considered
      the same even when they are routed to a different host after encapsulation.
      This causes all routes added after the first one to have incorrect
      encapsulation parameters.
      
      This is nicely visible by doing:
      
        # ip r a 192.168.1.2/32 dev vxlan0 tunnel dst 10.0.0.2
        # ip r a 192.168.1.3/32 dev vxlan0 tunnel dst 10.0.0.3
        # ip r
        [...]
        192.168.1.2/32 tunnel id 0 src 0.0.0.0 dst 10.0.0.2 [...]
        192.168.1.3/32 tunnel id 0 src 0.0.0.0 dst 10.0.0.2 [...]
      
      Implement the missing comparison function.
      
      Fixes: 3093fbe7 ("route: Per route IP tunnel metadata via lightweight tunnel")
      Signed-off-by: NJiri Benc <jbenc@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      2d798499