1. 02 5月, 2021 2 次提交
    • C
      xprtrdma: Fix a NULL dereference in frwr_unmap_sync() · 9e895cd9
      Chuck Lever 提交于
      The normal mechanism that invalidates and unmaps MRs is
      frwr_unmap_async(). frwr_unmap_sync() is used only when an RPC
      Reply bearing Write or Reply chunks has been lost (ie, almost
      never).
      
      Coverity found that after commit 9a301caf ("xprtrdma: Move
      fr_linv_done field to struct rpcrdma_mr"), the while() loop in
      frwr_unmap_sync() exits only once @mr is NULL, unconditionally
      causing subsequent dereferences of @mr to Oops.
      
      I've tested this fix by creating a client that skips invoking
      frwr_unmap_async() when RPC Replies complete. That forces all
      invalidation tasks to fall upon frwr_unmap_sync(). Simple workloads
      with this fix applied to the adulterated client work as designed.
      Reported-by: Ncoverity-bot <keescook+coverity-bot@chromium.org>
      Addresses-Coverity-ID: 1504556 ("Null pointer dereferences")
      Fixes: 9a301caf ("xprtrdma: Move fr_linv_done field to struct rpcrdma_mr")
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NTrond Myklebust <trond.myklebust@hammerspace.com>
      9e895cd9
    • B
      sunrpc: Fix misplaced barrier in call_decode · f8f7e0fb
      Baptiste Lepers 提交于
      Fix a misplaced barrier in call_decode. The struct rpc_rqst is modified
      as follows by xprt_complete_rqst:
      
      req->rq_private_buf.len = copied;
      /* Ensure all writes are done before we update */
      /* req->rq_reply_bytes_recvd */
      smp_wmb();
      req->rq_reply_bytes_recvd = copied;
      
      And currently read as follows by call_decode:
      
      smp_rmb(); // misplaced
      if (!req->rq_reply_bytes_recvd)
         goto out;
      req->rq_rcv_buf.len = req->rq_private_buf.len;
      
      This patch places the smp_rmb after the if to ensure that
      rq_reply_bytes_recvd and rq_private_buf.len are read in order.
      
      Fixes: 9ba82886 ("SUNRPC: Don't try to parse incomplete RPC messages")
      Signed-off-by: NBaptiste Lepers <baptiste.lepers@gmail.com>
      Signed-off-by: NTrond Myklebust <trond.myklebust@hammerspace.com>
      f8f7e0fb
  2. 26 4月, 2021 24 次提交
  3. 21 4月, 2021 1 次提交
  4. 19 4月, 2021 2 次提交
  5. 16 4月, 2021 2 次提交
  6. 14 4月, 2021 9 次提交