1. 13 6月, 2015 1 次提交
  2. 31 3月, 2015 14 次提交
  3. 07 3月, 2015 1 次提交
  4. 24 2月, 2015 1 次提交
    • C
      xprtrdma: Store RDMA credits in unsigned variables · 9b1dcbc8
      Chuck Lever 提交于
      Dan Carpenter's static checker pointed out:
      
         net/sunrpc/xprtrdma/rpc_rdma.c:879 rpcrdma_reply_handler()
         warn: can 'credits' be negative?
      
      "credits" is defined as an int. The credits value comes from the
      server as a 32-bit unsigned integer.
      
      A malicious or broken server can plant a large unsigned integer in
      that field which would result in an underflow in the following
      logic, potentially triggering a deadlock of the mount point by
      blocking the client from issuing more RPC requests.
      
      net/sunrpc/xprtrdma/rpc_rdma.c:
      
        876          credits = be32_to_cpu(headerp->rm_credit);
        877          if (credits == 0)
        878                  credits = 1;    /* don't deadlock */
        879          else if (credits > r_xprt->rx_buf.rb_max_requests)
        880                  credits = r_xprt->rx_buf.rb_max_requests;
        881
        882          cwnd = xprt->cwnd;
        883          xprt->cwnd = credits << RPC_CWNDSHIFT;
        884          if (xprt->cwnd > cwnd)
        885                  xprt_release_rqst_cong(rqst->rq_task);
      Reported-by: NDan Carpenter <dan.carpenter@oracle.com>
      Fixes: eba8ff66 ("xprtrdma: Move credit update to RPC . . .")
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NAnna Schumaker <Anna.Schumaker@Netapp.com>
      9b1dcbc8
  5. 06 2月, 2015 1 次提交
  6. 31 1月, 2015 1 次提交
  7. 30 1月, 2015 20 次提交
  8. 16 1月, 2015 1 次提交
    • C
      svcrdma: Handle additional inline content · a97c331f
      Chuck Lever 提交于
      Most NFS RPCs place their large payload argument at the end of the
      RPC header (eg, NFSv3 WRITE). For NFSv3 WRITE and SYMLINK, RPC/RDMA
      sends the complete RPC header inline, and the payload argument in
      the read list. Data in the read list is the last part of the XDR
      stream.
      
      One important case is not like this, however. NFSv4 COMPOUND is a
      counted array of operations. A WRITE operation, with its large data
      payload, can appear in the middle of the compound's operations
      array. Thus NFSv4 WRITE compounds can have header content after the
      WRITE payload.
      
      The Linux client, for example, performs an NFSv4 WRITE like this:
      
        { PUTFH, WRITE, GETATTR }
      
      Though RFC 5667 is not precise about this, the proper way to convey
      this compound is to place the GETATTR inline, _after_ the front of
      the RPC header. The receiver inserts the read list payload into the
      XDR stream after the initial WRITE arguments, and before the GETATTR
      operation, thanks to the value of the read list "position" field.
      
      The Linux client currently sends the GETATTR at the end of the
      RPC/RDMA read list, which is incorrect. It will be corrected in the
      future.
      
      The Linux server currently rejects NFSv4 compounds with inline
      content after the read list. For the above NFSv4 WRITE compound, the
      NFS compound header indicates there are three operations, but the
      server finds nonsense when it looks in the XDR stream for the third
      operation, and the compound fails with OP_ILLEGAL.
      
      Move trailing inline content to the end of the XDR buffer's page
      list. This presents incoming NFSv4 WRITE compounds to NFSD in the
      same way the socket transport does.
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Reviewed-by: NSteve Wise <swise@opengridcomputing.com>
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      a97c331f