1. 19 7月, 2017 10 次提交
  2. 18 7月, 2017 18 次提交
  3. 17 7月, 2017 2 次提交
  4. 13 7月, 2017 3 次提交
  5. 12 7月, 2017 7 次提交
    • L
      net: hns: Bugfix for Tx timeout handling in hns driver · 76b825ab
      Lin Yun Sheng 提交于
      When hns port type is not debug mode, netif_tx_disable is called
      when there is a tx timeout, which requires system reboot to return
      to normal state. This patch fix this problem by resetting the net
      dev.
      
      Fixes: b5996f11 ("net: add Hisilicon Network Subsystem basic ethernet support")
      Signed-off-by: NLin Yun Sheng <linyunsheng@huawei.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      76b825ab
    • D
      nfp: freeing the wrong variable · 88f0f09b
      Dan Carpenter 提交于
      We accidentally free a NULL pointer and leak the pointer we want to
      free.  Also you can tell from the label name what was intended.  :)
      
      Fixes: abfcdc1d ("nfp: add a stats handler for flower offloads")
      Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
      Acked-by: NJakub Kicinski <jakub.kicinski@netronome.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      88f0f09b
    • I
      mlxsw: spectrum_switchdev: Check status of memory allocation · 6f497930
      Ido Schimmel 提交于
      We can't rely on kzalloc() always succeeding, so check its return value.
      
      Suppresses the following smatch error:
      
      mlxsw_sp_switchdev_event() error: potential null dereference
      'switchdev_work->fdb_info.addr'.  (kzalloc returns
       null)
      
      Fixes: af061378 ("mlxsw: spectrum_switchdev: Add support for learning FDB through notification")
      Signed-off-by: NIdo Schimmel <idosch@mellanox.com>
      Signed-off-by: NJiri Pirko <jiri@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      6f497930
    • I
      mlxsw: spectrum_switchdev: Remove unused variable · a9265b80
      Ido Schimmel 提交于
      Commit 10e23eb2 ("mlxsw: spectrum: Remove support for bypass bridge
      port attributes/vlan set") removed statements that used 'bridge_vlan',
      but didn't remove the variable itself resulting in the following warning
      with W=1:
      
      warning: variable ‘bridge_vlan’ set but not used
      [-Wunused-but-set-variable]
      
      Remove the variable and suppress the warning.
      
      Fixes: 10e23eb2 ("mlxsw: spectrum: Remove support for bypass bridge port attributes/vlan set")
      Signed-off-by: NIdo Schimmel <idosch@mellanox.com>
      Signed-off-by: NJiri Pirko <jiri@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a9265b80
    • I
      mlxsw: spectrum_router: Fix use-after-free in route replace · 7387dbbc
      Ido Schimmel 提交于
      While working on IPv6 route replace I realized we can have a
      use-after-free in IPv4 in case the replaced route is offloaded and the
      only one using its FIB info.
      
      The problem is that fib_table_insert() drops the reference on the FIB
      info of the replaced routes which is eventually freed via call_rcu().
      Since the driver doesn't hold a reference on this FIB info it can cause
      a use-after-free when it tries to clear the RTNH_F_OFFLOAD flag stored
      in fi->fib_flags.
      
      After running the following commands in a loop for enough time with a
      KASAN enabled kernel I finally got the below trace.
      
      $ ip route add 192.168.50.0/24 via 192.168.200.1 dev enp3s0np3
      $ ip route replace 192.168.50.0/24 dev enp3s0np5
      $ ip route del 192.168.50.0/24 dev enp3s0np5
      
      BUG: KASAN: use-after-free in mlxsw_sp_fib_entry_offload_unset+0xa7/0x120 [mlxsw_spectrum]
      Read of size 4 at addr ffff8803717d9820 by task kworker/u4:2/55
      [...]
      ? mlxsw_sp_fib_entry_offload_unset+0xa7/0x120 [mlxsw_spectrum]
      ? mlxsw_sp_fib_entry_offload_unset+0xa7/0x120 [mlxsw_spectrum]
      ? mlxsw_sp_router_neighs_update_work+0x1cd0/0x1ce0 [mlxsw_spectrum]
      ? mlxsw_sp_fib_entry_offload_unset+0xa7/0x120 [mlxsw_spectrum]
      __asan_load4+0x61/0x80
      mlxsw_sp_fib_entry_offload_unset+0xa7/0x120 [mlxsw_spectrum]
      mlxsw_sp_fib_entry_offload_refresh+0xb6/0x370 [mlxsw_spectrum]
      mlxsw_sp_router_fib_event_work+0xd1c/0x2780 [mlxsw_spectrum]
      [...]
      Freed by task 5131:
       save_stack_trace+0x16/0x20
       save_stack+0x46/0xd0
       kasan_slab_free+0x70/0xc0
       kfree+0x144/0x570
       free_fib_info_rcu+0x2e7/0x410
       rcu_process_callbacks+0x4f8/0xe30
       __do_softirq+0x1d3/0x9e2
      
      Fix this by taking a reference on the FIB info when creating the nexthop
      group it represents and drop it when the group is destroyed.
      
      Fixes: 599cf8f9 ("mlxsw: spectrum_router: Add support for route replace")
      Signed-off-by: NIdo Schimmel <idosch@mellanox.com>
      Signed-off-by: NJiri Pirko <jiri@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      7387dbbc
    • I
      mlxsw: spectrum_router: Add missing rollback · a4e75b76
      Ido Schimmel 提交于
      With this patch the error path of mlxsw_sp_nexthop_init() is symmetric
      with mlxsw_sp_nexthop_fini(). Noticed during code review.
      
      Fixes: a8c97014 ("mlxsw: spectrum_router: Refactor nexthop init routine")
      Signed-off-by: NIdo Schimmel <idosch@mellanox.com>
      Signed-off-by: NJiri Pirko <jiri@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a4e75b76
    • G
      cxgb4: fix BUG() on interrupt deallocating path of ULD · 6a146f3a
      Guilherme G. Piccoli 提交于
      Since the introduction of ULD (Upper-Layer Drivers), the MSI-X
      deallocating path changed in cxgb4: the driver frees the interrupts
      of ULD when unregistering it or on shutdown PCI handler.
      
      Problem is that if a MSI-X is not freed before deallocated in the PCI
      layer, it will trigger a BUG() due to still "alive" interrupt being
      tentatively quiesced.
      
      The below trace was observed when doing a simple unbind of Chelsio's
      adapter PCI function, like:
        "echo 001e:80:00.4 > /sys/bus/pci/drivers/cxgb4/unbind"
      
      Trace:
      
        kernel BUG at drivers/pci/msi.c:352!
        Oops: Exception in kernel mode, sig: 5 [#1]
        ...
        NIP [c0000000005a5e60] free_msi_irqs+0xa0/0x250
        LR [c0000000005a5e50] free_msi_irqs+0x90/0x250
        Call Trace:
        [c0000000005a5e50] free_msi_irqs+0x90/0x250 (unreliable)
        [c0000000005a72c4] pci_disable_msix+0x124/0x180
        [d000000011e06708] disable_msi+0x88/0xb0 [cxgb4]
        [d000000011e06948] free_some_resources+0xa8/0x160 [cxgb4]
        [d000000011e06d60] remove_one+0x170/0x3c0 [cxgb4]
        [c00000000058a910] pci_device_remove+0x70/0x110
        [c00000000064ef04] device_release_driver_internal+0x1f4/0x2c0
        ...
      
      This patch fixes the issue by refactoring the shutdown path of ULD on
      cxgb4 driver, by properly freeing and disabling interrupts on PCI
      remove handler too.
      
      Fixes: 0fbc81b3 ("Allocate resources dynamically for all cxgb4 ULD's")
      Reported-by: NHarsha Thyagaraja <hathyaga@in.ibm.com>
      Signed-off-by: NGuilherme G. Piccoli <gpiccoli@linux.vnet.ibm.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      6a146f3a