1. 11 May, 2018 1 commit
  2. 01 May, 2018 2 commits
    • Chuck Lever's avatar
      sunrpc: Fix latency trace point crashes · 98eb6cf2
      Chuck Lever authored
      If the rpc_task survived longer than the transport, task->tk_xprt
      points to freed memory by the time rpc_count_iostats_metrics runs.
      Replace the references to task->tk_xprt with references to the
      task's tk_client.
      
      Reported-by: syzbot+27db1f90e2b972a5f2d3@syzkaller.appspotmail.com
      Fixes: 40bf7eb3 ('sunrpc: Add static trace point to report ...')
      Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: default avatarAnna Schumaker <Anna.Schumaker@Netapp.com>
      98eb6cf2
    • Chuck Lever's avatar
      xprtrdma: Fix list corruption / DMAR errors during MR recovery · 054f1557
      Chuck Lever authored
      The ro_release_mr methods check whether mr->mr_list is empty.
      Therefore, be sure to always use list_del_init when removing an MR
      linked into a list using that field. Otherwise, when recovering from
      transport failures or device removal, list corruption can result, or
      MRs can get mapped or unmapped an odd number of times, resulting in
      IOMMU-related failures.
      
      In general this fix is appropriate back to v4.8. However, code
      changes since then make it impossible to apply this patch directly
      to stable kernels. The fix would have to be applied by hand or
      reworked for kernels earlier than v4.16.
      
      Backport guidance -- there are several cases:
      - When creating an MR, initialize mr_list so that using list_empty
        on an as-yet-unused MR is safe.
      - When an MR is being handled by the remote invalidation path,
        ensure that mr_list is reinitialized when it is removed from
        rl_registered.
      - When an MR is being handled by rpcrdma_destroy_mrs, it is removed
        from mr_all, but it may still be on an rl_registered list. In
        that case, the MR needs to be removed from that list before being
        released.
      - Other cases are covered by using list_del_init in rpcrdma_mr_pop.
      
      Fixes: 9d6b0409 ('xprtrdma: Place registered MWs on a ... ')
      Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: default avatarAnna Schumaker <Anna.Schumaker@Netapp.com>
      054f1557
  3. 10 Apr, 2018 37 commits