1. 23 7月, 2017 10 次提交
  2. 20 7月, 2017 2 次提交
  3. 18 7月, 2017 4 次提交
  4. 17 7月, 2017 1 次提交
    • V
      IB/iser: Fix connection teardown race condition · c8c16d3b
      Vladimir Neyelov 提交于
      Under heavy iser target(scst) start/stop stress during login/logout
      on iser intitiator side happened trace call provided below.
      
      The function iscsi_iser_slave_alloc iser_conn pointer could be NULL,
      due to the fact that function iscsi_iser_conn_stop can be called before
      and free iser connection. Let's protect that flow by introducing global mutex.
      
      BUG: unable to handle kernel paging request at 0000000000001018
      IP: [<ffffffffc0426f7e>] iscsi_iser_slave_alloc+0x1e/0x50 [ib_iser]
      Call Trace:
      ? scsi_alloc_sdev+0x242/0x300
      scsi_probe_and_add_lun+0x9e1/0xea0
      ? kfree_const+0x21/0x30
      ? kobject_set_name_vargs+0x76/0x90
      ? __pm_runtime_resume+0x5b/0x70
      __scsi_scan_target+0xf6/0x250
      scsi_scan_target+0xea/0x100
      iscsi_user_scan_session.part.13+0x101/0x130 [scsi_transport_iscsi]
      ? iscsi_user_scan_session.part.13+0x130/0x130 [scsi_transport_iscsi]
      iscsi_user_scan_session+0x1e/0x30 [scsi_transport_iscsi]
      device_for_each_child+0x50/0x90
      iscsi_user_scan+0x44/0x60 [scsi_transport_iscsi]
      store_scan+0xa8/0x100
      ? common_file_perm+0x5d/0x1c0
      dev_attr_store+0x18/0x30
      sysfs_kf_write+0x37/0x40
      kernfs_fop_write+0x12c/0x1c0
      __vfs_write+0x18/0x40
      vfs_write+0xb5/0x1a0
      SyS_write+0x55/0xc0
      
      Fixes: 318d311e ("iser: Accept arbitrary sg lists mapping if the device supports it")
      Cc: <stable@vger.kernel.org> # v4.5+
      Signed-off-by: NVladimir Neyelov <vladimirn@mellanox.com>
      Signed-off-by: NLeon Romanovsky <leon@kernel.org>
      Reviewed-by: NSagi Grimberg <sagi@grimbeg.me>
      Signed-off-by: NDoug Ledford <dledford@redhat.com>
      c8c16d3b
  5. 11 7月, 2017 1 次提交
  6. 07 7月, 2017 2 次提交
  7. 06 7月, 2017 1 次提交
  8. 30 6月, 2017 2 次提交
  9. 27 6月, 2017 2 次提交
  10. 16 6月, 2017 1 次提交
    • J
      networking: make skb_push & __skb_push return void pointers · d58ff351
      Johannes Berg 提交于
      It seems like a historic accident that these return unsigned char *,
      and in many places that means casts are required, more often than not.
      
      Make these functions return void * and remove all the casts across
      the tree, adding a (u8 *) cast only where the unsigned char pointer
      was used directly, all done with the following spatch:
      
          @@
          expression SKB, LEN;
          typedef u8;
          identifier fn = { skb_push, __skb_push, skb_push_rcsum };
          @@
          - *(fn(SKB, LEN))
          + *(u8 *)fn(SKB, LEN)
      
          @@
          expression E, SKB, LEN;
          identifier fn = { skb_push, __skb_push, skb_push_rcsum };
          type T;
          @@
          - E = ((T *)(fn(SKB, LEN)))
          + E = fn(SKB, LEN)
      
          @@
          expression SKB, LEN;
          identifier fn = { skb_push, __skb_push, skb_push_rcsum };
          @@
          - fn(SKB, LEN)[0]
          + *(u8 *)fn(SKB, LEN)
      
      Note that the last part there converts from push(...)[0] to the
      more idiomatic *(u8 *)push(...).
      Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d58ff351
  11. 15 6月, 2017 5 次提交
    • F
      IB/ipoib: Fix memory leak in create child syscall · 4542d66b
      Feras Daoud 提交于
      The flow of creating a new child goes through ipoib_vlan_add
      which allocates a new interface and checks the rtnl_lock.
      
      If the lock is taken, restart_syscall will be called to restart
      the system call again. In this case we are not releasing the
      already allocated interface, causing a leak.
      
      Fixes: 9baa0b03 ("IB/ipoib: Add rtnl_link_ops support")
      Signed-off-by: NFeras Daoud <ferasda@mellanox.com>
      Signed-off-by: NLeon Romanovsky <leon@kernel.org>
      Signed-off-by: NDoug Ledford <dledford@redhat.com>
      4542d66b
    • A
      IB/ipoib: Fix access to un-initialized napi struct · 560b7c3f
      Alex Vesker 提交于
      There is no need to re-enable napi since we set the initialized
      flag before calling ipoib_ib_dev_stop which will disable napi,
      disabling napi twice is harmless in case it was already disabled.
      
      One more reason for this fix is that when using IPoIB new device
      driver napi is not added to priv, this can lead to kernel panic
      when rn_ops ndo_open fails.
      
      [ 289.755840] invalid opcode: 0000 [#1] SMP
      [ 289.757111] task: ffff880036964440 ti: ffff880178ee8000 task.ti: ffff880178ee8000
      [ 289.757111] RIP: 0010:[<ffffffffa05368d6>] [<ffffffffa05368d6>] napi_enable.part.24+0x4/0x6 [ib_ipoib]
      [ 289.757111] RSP: 0018:ffff880178eeb6d8 EFLAGS: 00010246
      [ 289.757111] RAX: 0000000000000000 RBX: ffff880177a80010 RCX: 000000007fffffff
      [ 289.757111] RDX: ffffffff81d5f118 RSI: 0000000000000000 RDI: ffff880177a80010
      [ 289.757111] RBP: ffff880178eeb6d8 R08: 0000000000000082 R09: 0000000000000283
      [ 289.757111] R10: 0000000000000000 R11: 0000000000000000 R12: ffff880175a00000
      [ 289.757111] R13: ffff880177a80080 R14: 0000000000000000 R15: 0000000000000001
      [ 289.757111] FS: 00007fe2ee346880(0000) GS:ffff88017fc00000(0000) knlGS:0000000000000000
      [ 289.757111] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [ 289.757111] CR2: 00007fffca979020 CR3: 00000001792e4000 CR4: 00000000000006f0
      [ 289.757111] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      [ 289.757111] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
      [ 289.757111] Stack:
      [ 289.796027] ffff880178eeb6f0 ffffffffa05251f5 ffff880177a80000 ffff880178eeb718
      [ 289.796027] ffffffffa0528505 ffff880175a00000 ffff880177a80000 0000000000000000
      [ 289.796027] ffff880178eeb748 ffffffffa051f0ab ffff880175a00000 ffffffffa0537d60
      [ 289.796027] Call Trace:
      [ 289.796027] [<ffffffffa05251f5>] napi_enable+0x25/0x30 [ib_ipoib]
      [ 289.796027] [<ffffffffa0528505>] ipoib_ib_dev_open+0x175/0x190 [ib_ipoib]
      [ 289.796027] [<ffffffffa051f0ab>] ipoib_open+0x4b/0x160 [ib_ipoib]
      [ 289.796027] [<ffffffff814fe33f>] _dev_open+0xbf/0x130
      [ 289.796027] [<ffffffff814fe62d>] __dev_change_flags+0x9d/0x170
      [ 289.796027] [<ffffffff814fe729>] dev_change_flags+0x29/0x60
      [ 289.796027] [<ffffffff8150caf7>] do_setlink+0x397/0xa40
      
      Fixes: cd565b4b ('IB/IPoIB: Support acceleration options callbacks')
      Signed-off-by: NAlex Vesker <valex@mellanox.com>
      Signed-off-by: NLeon Romanovsky <leon@kernel.org>
      Signed-off-by: NDoug Ledford <dledford@redhat.com>
      560b7c3f
    • A
      IB/ipoib: Delete napi in device uninit default · b53d4566
      Alex Vesker 提交于
      This patch mekas init_default and uninit_default symmetric
      with a call to delete napi. Additionally, the uninit_default
      gained delete napi call in case of init_default fails.
      
      Fixes: 515ed4f3 ('IB/IPoIB: Separate control and data related initializations')
      Signed-off-by: NAlex Vesker <valex@mellanox.com>
      Signed-off-by: NLeon Romanovsky <leon@kernel.org>
      Signed-off-by: NDoug Ledford <dledford@redhat.com>
      b53d4566
    • A
      IB/ipoib: Limit call to free rdma_netdev for capable devices · 022d038a
      Alex Vesker 提交于
      Limit calls to free_rdma_netdev() for capable devices only.
      
      Fixes: cd565b4b ('IB/IPoIB: Support acceleration options callbacks')
      Signed-off-by: NAlex Vesker <valex@mellanox.com>
      Signed-off-by: NLeon Romanovsky <leon@kernel.org>
      Signed-off-by: NDoug Ledford <dledford@redhat.com>
      022d038a
    • A
      IB/ipoib: Fix memory leaks for child interfaces priv · ab156afd
      Alex Vesker 提交于
      There is a need to free priv explicitly and not just to release
      the device, child priv is freed explicitly on remove flow and this
      patch also includes priv free on error flow in P_key creation
      and also in add_port.
      
      Fixes: cd565b4b ('IB/IPoIB: Support acceleration options callbacks')
      Signed-off-by: NAlex Vesker <valex@mellanox.com>
      Signed-off-by: NLeon Romanovsky <leon@kernel.org>
      Signed-off-by: NDoug Ledford <dledford@redhat.com>
      ab156afd
  12. 02 6月, 2017 4 次提交
    • M
      RDMA/SA: Fix kernel panic in CMA request handler flow · d3957b86
      Majd Dibbiny 提交于
      Commit 9fdca4da (IB/SA: Split struct sa_path_rec based on IB and
      ROCE specific fields) moved the service_id to be specific attribute
      for IB and OPA SA Path Record, and thus wasn't assigned for RoCE.
      
      This caused to the following kernel panic in the CMA request handler flow:
      
      [   27.074594] BUG: unable to handle kernel NULL pointer dereference at 0000000000000008
      [   27.074731] IP: __radix_tree_lookup+0x1d/0xe0
      ...
      [   27.075356] Workqueue: ib_cm cm_work_handler [ib_cm]
      [   27.075401] task: ffff88022e3b8000 task.stack: ffffc90001298000
      [   27.075449] RIP: 0010:__radix_tree_lookup+0x1d/0xe0
      ...
      [   27.075979] Call Trace:
      [   27.076015]  radix_tree_lookup+0xd/0x10
      [   27.076055]  cma_ps_find+0x59/0x70 [rdma_cm]
      [   27.076097]  cma_id_from_event+0xd2/0x470 [rdma_cm]
      [   27.076144]  ? ib_init_ah_from_path+0x39a/0x590 [ib_core]
      [   27.076193]  cma_req_handler+0x25/0x480 [rdma_cm]
      [   27.076237]  cm_process_work+0x25/0x120 [ib_cm]
      [   27.076280]  ? cm_get_bth_pkey.isra.62+0x3c/0xa0 [ib_cm]
      [   27.076350]  cm_req_handler+0xb03/0xd40 [ib_cm]
      [   27.076430]  ? sched_clock_cpu+0x11/0xb0
      [   27.076478]  cm_work_handler+0x194/0x1588 [ib_cm]
      [   27.076525]  process_one_work+0x160/0x410
      [   27.076565]  worker_thread+0x137/0x4a0
      [   27.076614]  kthread+0x112/0x150
      [   27.076684]  ? max_active_store+0x60/0x60
      [   27.077642]  ? kthread_park+0x90/0x90
      [   27.078530]  ret_from_fork+0x2c/0x40
      
      This patch moves it back to the common SA Path Record structure
      and removes the redundant setter and getter.
      
      Tested on Connect-IB and Connect-X4 in Infiniband and RoCE respectively.
      
      Fixes: 9fdca4da (IB/SA: Split struct sa_path_rec based on IB ands
      	ROCE specific fields)
      Signed-off-by: NMajd Dibbiny <majd@mellanox.com>
      Reviewed-by: NParav Pandit <parav@mellanox.com>
      Signed-off-by: NLeon Romanovsky <leon@kernel.org>
      Signed-off-by: NDoug Ledford <dledford@redhat.com>
      d3957b86
    • I
      RDMA/srp: Fix NULL deref at srp_destroy_qp() · 95c2ef50
      Israel Rukshin 提交于
      If srp_init_qp() fails at srp_create_ch_ib() then ch->send_cq
      may be NULL.
      Calling directly to ib_destroy_qp() is sufficient because
      no work requests were posted on the created qp.
      
      Fixes: 9294000d ("IB/srp: Drain the send queue before destroying a QP")
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NIsrael Rukshin <israelr@mellanox.com>
      Reviewed-by: NMax Gurtovoy <maxg@mellanox.com>
      Reviewed-by: Bart van Assche <bart.vanassche@sandisk.com>--
      Signed-off-by: NDoug Ledford <dledford@redhat.com>
      95c2ef50
    • L
      RDMA/IPoIB: Limit the ipoib_dev_uninit_default scope · 0a1a9726
      Leon Romanovsky 提交于
      ipoib_dev_uninit_default() call is used in ipoib_main.c file only
      and it generates the following warning from smatch tool:
      	drivers/infiniband/ulp/ipoib/ipoib_main.c:1593:6: warning:
      	symbol 'ipoib_dev_uninit_default' was not declared. Should it
      	be static?
      
      so let's declare that function as static.
      Signed-off-by: NLeon Romanovsky <leonro@mellanox.com>
      Reviewed-by: NYuval Shaia <yuval.shaia@oracle.com>
      Signed-off-by: NDoug Ledford <dledford@redhat.com>
      0a1a9726
    • H
      RDMA/IPoIB: Replace netdev_priv with ipoib_priv for ipoib_get_link_ksettings · 8c490669
      Honggang Li 提交于
      ipoib_dev_init accesses the wrong private data for the IPoIB device.
      Commit cd565b4b (IB/IPoIB: Support acceleration options callbacks)
      changed ipoib_priv from being identical to netdev_priv to being an
      area inside of, but not the same pointer as, the netdev_priv pointer.
      As such, the struct we want is the ipoib_priv area, not the netdev_priv
      area, so use the right accessor, otherwise we kernel panic.
      
      [   27.271938] IPv6: ADDRCONF(NETDEV_CHANGE): mlx5_ib0.8006: link becomes ready
      [   28.156790] BUG: unable to handle kernel NULL pointer dereference at 000000000000067c
      [   28.166309] IP: ib_query_port+0x30/0x180 [ib_core]
      ...
      [   28.306282] RIP: 0010:ib_query_port+0x30/0x180 [ib_core]
      ...
      [   28.393337] Call Trace:
      [   28.397594]  ipoib_get_link_ksettings+0x66/0xe0 [ib_ipoib]
      [   28.405274]  __ethtool_get_link_ksettings+0xa0/0x1c0
      [   28.412353]  speed_show+0x74/0xa0
      [   28.417503]  dev_attr_show+0x20/0x50
      [   28.422922]  ? mutex_lock+0x12/0x40
      [   28.428179]  sysfs_kf_seq_show+0xbf/0x1a0
      [   28.434002]  kernfs_seq_show+0x21/0x30
      [   28.439470]  seq_read+0x116/0x3b0
      [   28.444445]  ? do_filp_open+0xa5/0x100
      [   28.449774]  kernfs_fop_read+0xff/0x180
      [   28.455220]  __vfs_read+0x37/0x150
      [   28.460167]  ? security_file_permission+0x9d/0xc0
      [   28.466560]  vfs_read+0x8c/0x130
      [   28.471318]  SyS_read+0x55/0xc0
      [   28.475950]  do_syscall_64+0x67/0x150
      [   28.481163]  entry_SYSCALL64_slow_path+0x25/0x25
      ...
      [   28.584493] ---[ end trace 3549968a4bf0aa5d ]---
      
      Fixes: cd565b4b (IB/IPoIB: Support acceleration options callbacks)
      Fixes: 0d7e2d21 (IB/ipoib: add get_link_ksettings in ethtool)
      Signed-off-by: NHonggang Li <honli@redhat.com>
      Reviewed-by: NYuval Shaia <yuval.shaia@oracle.com>
      Reviewed-by: NLeon Romanovsky <leonro@mellanox.com>
      Signed-off-by: NDoug Ledford <dledford@redhat.com>
      8c490669
  13. 08 5月, 2017 2 次提交
    • B
      IB/srpt: Avoid that aborting a command triggers a kernel warning · bd2c52d7
      Bart Van Assche 提交于
      Avoid that the following warning is triggered:
      
      WARNING: CPU: 10 PID: 166 at ../drivers/infiniband/ulp/srpt/ib_srpt.c:2674 srpt_release_cmd+0x139/0x140 [ib_srpt]
      CPU: 10 PID: 166 Comm: kworker/u24:8 Not tainted 4.9.4-1-default #1
      Workqueue: tmr-fileio target_tmr_work [target_core_mod]
      Call Trace:
       [<ffffffffaa3c4f70>] dump_stack+0x63/0x83
       [<ffffffffaa0844eb>] __warn+0xcb/0xf0
       [<ffffffffaa0845dd>] warn_slowpath_null+0x1d/0x20
       [<ffffffffc06ba429>] srpt_release_cmd+0x139/0x140 [ib_srpt]
       [<ffffffffc06e4377>] target_release_cmd_kref+0xb7/0x120 [target_core_mod]
       [<ffffffffc06e4d7f>] target_put_sess_cmd+0x2f/0x60 [target_core_mod]
       [<ffffffffc06e15e0>] core_tmr_lun_reset+0x340/0x790 [target_core_mod]
       [<ffffffffc06e4816>] target_tmr_work+0xe6/0x140 [target_core_mod]
       [<ffffffffaa09e4d3>] process_one_work+0x1f3/0x4d0
       [<ffffffffaa09e7f8>] worker_thread+0x48/0x4e0
       [<ffffffffaa09e7b0>] ? process_one_work+0x4d0/0x4d0
       [<ffffffffaa0a46da>] kthread+0xca/0xe0
       [<ffffffffaa0a4610>] ? kthread_park+0x60/0x60
       [<ffffffffaa71b775>] ret_from_fork+0x25/0x30
      Signed-off-by: NBart Van Assche <bart.vanassche@sandisk.com>
      Reviewed-by: NHannes Reinecke <hare@suse.com>
      Cc: Doug Ledford <dledford@redhat.com>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: David Disseldorp <ddiss@suse.de>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      bd2c52d7
    • B
      IB/srpt: Fix abort handling · 55d69427
      Bart Van Assche 提交于
      Let the target core check the CMD_T_ABORTED flag instead of the SRP
      target driver. Hence remove the transport_check_aborted_status()
      call. Since state == SRPT_STATE_CMD_RSP_SENT is something that really
      should not happen, do not try to recover if srpt_queue_response() is
      called for an I/O context that is in that state. This patch is a bug
      fix because the srpt_abort_cmd() call is misplaced - if that function
      is called from srpt_queue_response() it should either be called
      before the command state is changed or after the response has been
      sent.
      Signed-off-by: NBart Van Assche <bart.vanassche@sandisk.com>
      Reviewed-by: NHannes Reinecke <hare@suse.com>
      Cc: Doug Ledford <dledford@redhat.com>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Andy Grover <agrover@redhat.com>
      Cc: David Disseldorp <ddiss@suse.de>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      55d69427
  14. 05 5月, 2017 1 次提交
  15. 02 5月, 2017 2 次提交