Skip to content
  1. May 01, 2020
    • Moshe Shemesh's avatar
      net/mlx5: Fix forced completion access non initialized command entry · f3cb3ceb
      Moshe Shemesh authored
      mlx5_cmd_flush() will trigger forced completions to all valid command
      entries. Triggered by an asynch event such as fast teardown it can
      happen at any stage of the command, including command initialization.
      It will trigger forced completion and that can lead to completion on an
      uninitialized command entry.
      
      Setting MLX5_CMD_ENT_STATE_PENDING_COMP only after command entry is
      initialized will ensure force completion is treated only if command
      entry is initialized.
      
      Fixes: 73dd3a48
      
       ("net/mlx5: Avoid using pending command interface slots")
      Signed-off-by: default avatarMoshe Shemesh <moshe@mellanox.com>
      Signed-off-by: default avatarEran Ben Elisha <eranbe@mellanox.com>
      Signed-off-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
      f3cb3ceb
    • Erez Shitrit's avatar
      net/mlx5: DR, On creation set CQ's arm_db member to right value · 8075411d
      Erez Shitrit authored
      In polling mode, set arm_db member to a value that will avoid CQ
      event recovery by the HW.
      Otherwise we might get event without completion function.
      In addition,empty completion function to was added to protect from
      unexpected events.
      
      Fixes: 297ccceb
      
       ("net/mlx5: DR, Expose an internal API to issue RDMA operations")
      Signed-off-by: default avatarErez Shitrit <erezsh@mellanox.com>
      Reviewed-by: default avatarTariq Toukan <tariqt@mellanox.com>
      Reviewed-by: default avatarAlex Vesker <valex@mellanox.com>
      Signed-off-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
      8075411d
    • Parav Pandit's avatar
      net/mlx5: E-switch, Fix mutex init order · f8d1edda
      Parav Pandit authored
      In cited patch mutex is initialized after its used.
      Below call trace is observed.
      Fix the order to initialize the mutex early enough.
      Similarly follow mirror sequence during cleanup.
      
      kernel: DEBUG_LOCKS_WARN_ON(lock->magic != lock)
      kernel: WARNING: CPU: 5 PID: 45916 at kernel/locking/mutex.c:938
      __mutex_lock+0x7d6/0x8a0
      kernel: Call Trace:
      kernel: ? esw_vport_tbl_get+0x3b/0x250 [mlx5_core]
      kernel: ? mark_held_locks+0x55/0x70
      kernel: ? __slab_free+0x274/0x400
      kernel: ? lockdep_hardirqs_on+0x140/0x1d0
      kernel: esw_vport_tbl_get+0x3b/0x250 [mlx5_core]
      kernel: ? mlx5_esw_chains_create_fdb_prio+0xa57/0xc20 [mlx5_core]
      kernel: mlx5_esw_vport_tbl_get+0x88/0xf0 [mlx5_core]
      kernel: mlx5_esw_chains_create+0x2f3/0x3e0 [mlx5_core]
      kernel: esw_create_offloads_fdb_tables+0x11d/0x580 [mlx5_core]
      kernel: esw_offloads_enable+0x26d/0x540 [mlx5_core]
      kernel: mlx5_eswitch_enable_locked+0x155/0x860 [mlx5_core]
      kernel: mlx5_devlink_eswitch_mode_set+0x1af/0x320 [mlx5_core]
      kernel: devlink_nl_cmd_eswitch_set_doit+0x41/0xb0
      
      Fixes: 96e32687
      
       ("net/mlx5e: Eswitch, Use per vport tables for mirroring")
      Signed-off-by: default avatarParav Pandit <parav@mellanox.com>
      Reviewed-by: default avatarRoi Dayan <roid@mellanox.com>
      Reviewed-by: default avatarEli Cohen <eli@mellanox.com>
      Signed-off-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
      f8d1edda
    • Parav Pandit's avatar
      net/mlx5: E-switch, Fix printing wrong error value · e9864539
      Parav Pandit authored
      When mlx5_modify_header_alloc() fails, instead of printing the error
      value returned, current error log prints 0.
      
      Fix by printing correct error value returned by
      mlx5_modify_header_alloc().
      
      Fixes: 6724e66b
      
       ("net/mlx5: E-Switch, Get reg_c1 value on miss")
      Signed-off-by: default avatarParav Pandit <parav@mellanox.com>
      Reviewed-by: default avatarRoi Dayan <roid@mellanox.com>
      Signed-off-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
      e9864539
    • Parav Pandit's avatar
      net/mlx5: E-switch, Fix error unwinding flow for steering init failure · 79949985
      Parav Pandit authored
      Error unwinding is done incorrectly in the cited commit.
      When steering init fails, there is no need to perform steering cleanup.
      When vport error exists, error cleanup should be mirror of the setup
      routine, i.e. to perform steering cleanup before metadata cleanup.
      
      This avoids the call trace in accessing uninitialized objects which are
      skipped during steering_init() due to failure in steering_init().
      
      Call trace:
      mlx5_cmd_modify_header_alloc:805:(pid 21128): too many modify header
      actions 1, max supported 0
      E-Switch: Failed to create restore mod header
      
      BUG: kernel NULL pointer dereference, address: 00000000000000d0
      [  677.263079]  mlx5_destroy_flow_group+0x13/0x80 [mlx5_core]
      [  677.268921]  esw_offloads_steering_cleanup+0x51/0xf0 [mlx5_core]
      [  677.275281]  esw_offloads_enable+0x1a5/0x800 [mlx5_core]
      [  677.280949]  mlx5_eswitch_enable_locked+0x155/0x860 [mlx5_core]
      [  677.287227]  mlx5_devlink_eswitch_mode_set+0x1af/0x320
      [  677.293741]  devlink_nl_cmd_eswitch_set_doit+0x41/0xb0
      [  677.299217]  genl_rcv_msg+0x1eb/0x430
      
      Fixes: 7983a675
      
       ("net/mlx5: E-Switch, Enable chains only if regs loopback is enabled")
      Signed-off-by: default avatarParav Pandit <parav@mellanox.com>
      Reviewed-by: default avatarRoi Dayan <roid@mellanox.com>
      Signed-off-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
      79949985
  2. Apr 30, 2020
  3. Apr 29, 2020
    • YueHaibing's avatar
      net/x25: Fix null-ptr-deref in x25_disconnect · 8999dc89
      YueHaibing authored
      
      
      We should check null before do x25_neigh_put in x25_disconnect,
      otherwise may cause null-ptr-deref like this:
      
       #include <sys/socket.h>
       #include <linux/x25.h>
      
       int main() {
          int sck_x25;
          sck_x25 = socket(AF_X25, SOCK_SEQPACKET, 0);
          close(sck_x25);
          return 0;
       }
      
      BUG: kernel NULL pointer dereference, address: 00000000000000d8
      CPU: 0 PID: 4817 Comm: t2 Not tainted 5.7.0-rc3+ #159
      Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.9.3-
      RIP: 0010:x25_disconnect+0x91/0xe0
      Call Trace:
       x25_release+0x18a/0x1b0
       __sock_release+0x3d/0xc0
       sock_close+0x13/0x20
       __fput+0x107/0x270
       ____fput+0x9/0x10
       task_work_run+0x6d/0xb0
       exit_to_usermode_loop+0x102/0x110
       do_syscall_64+0x23c/0x260
       entry_SYSCALL_64_after_hwframe+0x49/0xb3
      
      Reported-by: default avatar <syzbot+6db548b615e5aeefdce2@syzkaller.appspotmail.com>
      Fixes: 4becb7ee
      
       ("net/x25: Fix x25_neigh refcnt leak when x25 disconnect")
      Signed-off-by: default avatarYueHaibing <yuehaibing@huawei.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      8999dc89
    • Gavin Shan's avatar
      net/ena: Fix build warning in ena_xdp_set() · caec6619
      Gavin Shan authored
      
      
      This fixes the following build warning in ena_xdp_set(), which is
      observed on aarch64 with 64KB page size.
      
         In file included from ./include/net/inet_sock.h:19,
            from ./include/net/ip.h:27,
            from drivers/net/ethernet/amazon/ena/ena_netdev.c:46:
         drivers/net/ethernet/amazon/ena/ena_netdev.c: In function         \
         ‘ena_xdp_set’:                                                    \
         drivers/net/ethernet/amazon/ena/ena_netdev.c:557:6: warning:      \
         format ‘%lu’                                                      \
         expects argument of type ‘long unsigned int’, but argument 4      \
         has type ‘int’                                                    \
         [-Wformat=] "Failed to set xdp program, the current MTU (%d) is   \
         larger than the maximum allowed MTU (%lu) while xdp is on",
      
      Signed-off-by: default avatarGavin Shan <gshan@redhat.com>
      Acked-by: default avatarShay Agroskin <shayagr@amazon.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      caec6619
  4. Apr 28, 2020
  5. Apr 26, 2020