1. 28 7月, 2020 1 次提交
  2. 23 7月, 2020 3 次提交
    • N
      cxgb4: add missing release on skb in uld_send() · e6827d1a
      Navid Emamdoost 提交于
      In the implementation of uld_send(), the skb is consumed on all
      execution paths except one. Release skb when returning NET_XMIT_DROP.
      Signed-off-by: NNavid Emamdoost <navid.emamdoost@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e6827d1a
    • E
      net: atlantic: fix PTP on AQC10X · 901f3cc1
      Egor Pomozov 提交于
      This patch fixes PTP on AQC10X.
      PTP support on AQC10X requires FW involvement and FW configures the
      TPS data arb mode itself.
      So we must make sure driver doesn't touch TPS data arb mode on AQC10x
      if PTP is enabled. Otherwise, there are no timestamps even though
      packets are flowing.
      
      Fixes: 2deac71a ("net: atlantic: QoS implementation: min_rate")
      Signed-off-by: NEgor Pomozov <epomozov@marvell.com>
      Signed-off-by: NMark Starovoytov <mstarovoitov@marvell.com>
      Signed-off-by: NIgor Russkikh <irusskikh@marvell.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      901f3cc1
    • C
      enetc: Remove the mdio bus on PF probe bailout · 26cb7085
      Claudiu Manoil 提交于
      For ENETC ports that register an external MDIO bus,
      the bus doesn't get removed on the error bailout path
      of enetc_pf_probe().
      
      This issue became much more visible after recent:
      commit 07095c02 ("net: enetc: Use DT protocol information to set up the ports")
      Before this commit, one could make probing fail on the error
      path only by having register_netdev() fail, which is unlikely.
      But after this commit, because it moved the enetc_of_phy_get()
      call up in the probing sequence, now we can trigger an mdiobus_free()
      bug just by forcing enetc_alloc_msix() to return error, i.e. with the
      'pci=nomsi' kernel bootarg (since ENETC relies on MSI support to work),
      as the calltrace below shows:
      
      kernel BUG at /home/eiz/work/enetc/net/drivers/net/phy/mdio_bus.c:648!
      Internal error: Oops - BUG: 0 [#1] PREEMPT SMP
      [...]
      Hardware name: LS1028A RDB Board (DT)
      pstate: 80000005 (Nzcv daif -PAN -UAO BTYPE=--)
      pc : mdiobus_free+0x50/0x58
      lr : devm_mdiobus_free+0x14/0x20
      [...]
      Call trace:
       mdiobus_free+0x50/0x58
       devm_mdiobus_free+0x14/0x20
       release_nodes+0x138/0x228
       devres_release_all+0x38/0x60
       really_probe+0x1c8/0x368
       driver_probe_device+0x5c/0xc0
       device_driver_attach+0x74/0x80
       __driver_attach+0x8c/0xd8
       bus_for_each_dev+0x7c/0xd8
       driver_attach+0x24/0x30
       bus_add_driver+0x154/0x200
       driver_register+0x64/0x120
       __pci_register_driver+0x44/0x50
       enetc_pf_driver_init+0x24/0x30
       do_one_initcall+0x60/0x1c0
       kernel_init_freeable+0x1fc/0x274
       kernel_init+0x14/0x110
       ret_from_fork+0x10/0x34
      
      Fixes: ebfcb23d ("enetc: Add ENETC PF level external MDIO support")
      Signed-off-by: NClaudiu Manoil <claudiu.manoil@nxp.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      26cb7085
  3. 22 7月, 2020 9 次提交
  4. 21 7月, 2020 11 次提交
  5. 18 7月, 2020 7 次提交
  6. 17 7月, 2020 1 次提交
  7. 16 7月, 2020 1 次提交
  8. 15 7月, 2020 2 次提交
  9. 13 7月, 2020 3 次提交
  10. 11 7月, 2020 2 次提交
    • I
      mlxsw: pci: Fix use-after-free in case of failed devlink reload · c4317b11
      Ido Schimmel 提交于
      In case devlink reload failed, it is possible to trigger a
      use-after-free when querying the kernel for device info via 'devlink dev
      info' [1].
      
      This happens because as part of the reload error path the PCI command
      interface is de-initialized and its mailboxes are freed. When the
      devlink '->info_get()' callback is invoked the device is queried via the
      command interface and the freed mailboxes are accessed.
      
      Fix this by initializing the command interface once during probe and not
      during every reload.
      
      This is consistent with the other bus used by mlxsw (i.e., 'mlxsw_i2c')
      and also allows user space to query the running firmware version (for
      example) from the device after a failed reload.
      
      [1]
      BUG: KASAN: use-after-free in memcpy include/linux/string.h:406 [inline]
      BUG: KASAN: use-after-free in mlxsw_pci_cmd_exec+0x177/0xa60 drivers/net/ethernet/mellanox/mlxsw/pci.c:1675
      Write of size 4096 at addr ffff88810ae32000 by task syz-executor.1/2355
      
      CPU: 1 PID: 2355 Comm: syz-executor.1 Not tainted 5.8.0-rc2+ #29
      Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.12.1-0-ga5cab58e9a3f-prebuilt.qemu.org 04/01/2014
      Call Trace:
       __dump_stack lib/dump_stack.c:77 [inline]
       dump_stack+0xf6/0x16e lib/dump_stack.c:118
       print_address_description.constprop.0+0x1c/0x250 mm/kasan/report.c:383
       __kasan_report mm/kasan/report.c:513 [inline]
       kasan_report.cold+0x1f/0x37 mm/kasan/report.c:530
       check_memory_region_inline mm/kasan/generic.c:186 [inline]
       check_memory_region+0x14e/0x1b0 mm/kasan/generic.c:192
       memcpy+0x39/0x60 mm/kasan/common.c:106
       memcpy include/linux/string.h:406 [inline]
       mlxsw_pci_cmd_exec+0x177/0xa60 drivers/net/ethernet/mellanox/mlxsw/pci.c:1675
       mlxsw_cmd_exec+0x249/0x550 drivers/net/ethernet/mellanox/mlxsw/core.c:2335
       mlxsw_cmd_access_reg drivers/net/ethernet/mellanox/mlxsw/cmd.h:859 [inline]
       mlxsw_core_reg_access_cmd drivers/net/ethernet/mellanox/mlxsw/core.c:1938 [inline]
       mlxsw_core_reg_access+0x2f6/0x540 drivers/net/ethernet/mellanox/mlxsw/core.c:1985
       mlxsw_reg_query drivers/net/ethernet/mellanox/mlxsw/core.c:2000 [inline]
       mlxsw_devlink_info_get+0x17f/0x6e0 drivers/net/ethernet/mellanox/mlxsw/core.c:1090
       devlink_nl_info_fill.constprop.0+0x13c/0x2d0 net/core/devlink.c:4588
       devlink_nl_cmd_info_get_dumpit+0x246/0x460 net/core/devlink.c:4648
       genl_lock_dumpit+0x85/0xc0 net/netlink/genetlink.c:575
       netlink_dump+0x515/0xe50 net/netlink/af_netlink.c:2245
       __netlink_dump_start+0x53d/0x830 net/netlink/af_netlink.c:2353
       genl_family_rcv_msg_dumpit.isra.0+0x296/0x300 net/netlink/genetlink.c:638
       genl_family_rcv_msg net/netlink/genetlink.c:733 [inline]
       genl_rcv_msg+0x78d/0x9d0 net/netlink/genetlink.c:753
       netlink_rcv_skb+0x152/0x440 net/netlink/af_netlink.c:2469
       genl_rcv+0x24/0x40 net/netlink/genetlink.c:764
       netlink_unicast_kernel net/netlink/af_netlink.c:1303 [inline]
       netlink_unicast+0x53a/0x750 net/netlink/af_netlink.c:1329
       netlink_sendmsg+0x850/0xd90 net/netlink/af_netlink.c:1918
       sock_sendmsg_nosec net/socket.c:652 [inline]
       sock_sendmsg+0x150/0x190 net/socket.c:672
       ____sys_sendmsg+0x6d8/0x840 net/socket.c:2363
       ___sys_sendmsg+0xff/0x170 net/socket.c:2417
       __sys_sendmsg+0xe5/0x1b0 net/socket.c:2450
       do_syscall_64+0x56/0xa0 arch/x86/entry/common.c:359
       entry_SYSCALL_64_after_hwframe+0x44/0xa9
      
      Fixes: a9c8336f ("mlxsw: core: Add support for devlink info command")
      Signed-off-by: NIdo Schimmel <idosch@mellanox.com>
      Reviewed-by: NJiri Pirko <jiri@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c4317b11
    • I
      mlxsw: spectrum_router: Remove inappropriate usage of WARN_ON() · d9d54202
      Ido Schimmel 提交于
      We should not trigger a warning when a memory allocation fails. Remove
      the WARN_ON().
      
      The warning is constantly triggered by syzkaller when it is injecting
      faults:
      
      [ 2230.758664] FAULT_INJECTION: forcing a failure.
      [ 2230.758664] name failslab, interval 1, probability 0, space 0, times 0
      [ 2230.762329] CPU: 3 PID: 1407 Comm: syz-executor.0 Not tainted 5.8.0-rc2+ #28
      ...
      [ 2230.898175] WARNING: CPU: 3 PID: 1407 at drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c:6265 mlxsw_sp_router_fib_event+0xfad/0x13e0
      [ 2230.898179] Kernel panic - not syncing: panic_on_warn set ...
      [ 2230.898183] CPU: 3 PID: 1407 Comm: syz-executor.0 Not tainted 5.8.0-rc2+ #28
      [ 2230.898190] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.12.1-0-ga5cab58e9a3f-prebuilt.qemu.org 04/01/2014
      
      Fixes: 3057224e ("mlxsw: spectrum_router: Implement FIB offload in deferred work")
      Signed-off-by: NIdo Schimmel <idosch@mellanox.com>
      Reviewed-by: NJiri Pirko <jiri@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d9d54202