1. 21 3月, 2018 6 次提交
  2. 20 3月, 2018 3 次提交
  3. 06 2月, 2018 2 次提交
  4. 28 11月, 2017 12 次提交
  5. 08 11月, 2017 7 次提交
    • A
      nfsd: deal with revoked delegations appropriately · 95da1b3a
      Andrew Elble 提交于
      If a delegation has been revoked by the server, operations using that
      delegation should error out with NFS4ERR_DELEG_REVOKED in the >4.1
      case, and NFS4ERR_BAD_STATEID otherwise.
      
      The server needs NFSv4.1 clients to explicitly free revoked delegations.
      If the server returns NFS4ERR_DELEG_REVOKED, the client will do that;
      otherwise it may just forget about the delegation and be unable to
      recover when it later sees SEQ4_STATUS_RECALLABLE_STATE_REVOKED set on a
      SEQUENCE reply.  That can cause the Linux 4.1 client to loop in its
      stage manager.
      Signed-off-by: NAndrew Elble <aweits@rit.edu>
      Reviewed-by: NTrond Myklebust <trond.myklebust@primarydata.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      95da1b3a
    • V
      nfsd: use nfs->ns.inum as net ID · 7e981a8a
      Vasily Averin 提交于
      Publishing of net pointer is not safe,
      let's use nfs->ns.inum instead
      Signed-off-by: NVasily Averin <vvs@virtuozzo.com>
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      7e981a8a
    • E
      fs, nfsd: convert nfs4_file.fi_ref from atomic_t to refcount_t · 818a34eb
      Elena Reshetova 提交于
      atomic_t variables are currently used to implement reference
      counters with the following properties:
       - counter is initialized to 1 using atomic_set()
       - a resource is freed upon counter reaching zero
       - once counter reaches zero, its further
         increments aren't allowed
       - counter schema uses basic atomic operations
         (set, inc, inc_not_zero, dec_and_test, etc.)
      
      Such atomic variables should be converted to a newly provided
      refcount_t type and API that prevents accidental counter overflows
      and underflows. This is important since overflows and underflows
      can lead to use-after-free situation and be exploitable.
      
      The variable nfs4_file.fi_ref is used as pure reference counter.
      Convert it to refcount_t and fix up the operations.
      Suggested-by: NKees Cook <keescook@chromium.org>
      Reviewed-by: NDavid Windsor <dwindsor@gmail.com>
      Reviewed-by: NHans Liljestrand <ishkamiel@gmail.com>
      Signed-off-by: NElena Reshetova <elena.reshetova@intel.com>
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      818a34eb
    • E
      fs, nfsd: convert nfs4_cntl_odstate.co_odcount from atomic_t to refcount_t · cff7cb2e
      Elena Reshetova 提交于
      atomic_t variables are currently used to implement reference
      counters with the following properties:
       - counter is initialized to 1 using atomic_set()
       - a resource is freed upon counter reaching zero
       - once counter reaches zero, its further
         increments aren't allowed
       - counter schema uses basic atomic operations
         (set, inc, inc_not_zero, dec_and_test, etc.)
      
      Such atomic variables should be converted to a newly provided
      refcount_t type and API that prevents accidental counter overflows
      and underflows. This is important since overflows and underflows
      can lead to use-after-free situation and be exploitable.
      
      The variable nfs4_cntl_odstate.co_odcount is used as pure reference counter.
      Convert it to refcount_t and fix up the operations.
      Suggested-by: NKees Cook <keescook@chromium.org>
      Reviewed-by: NDavid Windsor <dwindsor@gmail.com>
      Reviewed-by: NHans Liljestrand <ishkamiel@gmail.com>
      Signed-off-by: NElena Reshetova <elena.reshetova@intel.com>
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      cff7cb2e
    • E
      fs, nfsd: convert nfs4_stid.sc_count from atomic_t to refcount_t · a15dfcd5
      Elena Reshetova 提交于
      atomic_t variables are currently used to implement reference
      counters with the following properties:
       - counter is initialized to 1 using atomic_set()
       - a resource is freed upon counter reaching zero
       - once counter reaches zero, its further
         increments aren't allowed
       - counter schema uses basic atomic operations
         (set, inc, inc_not_zero, dec_and_test, etc.)
      
      Such atomic variables should be converted to a newly provided
      refcount_t type and API that prevents accidental counter overflows
      and underflows. This is important since overflows and underflows
      can lead to use-after-free situation and be exploitable.
      
      The variable nfs4_stid.sc_count is used as pure reference counter.
      Convert it to refcount_t and fix up the operations.
      Suggested-by: NKees Cook <keescook@chromium.org>
      Reviewed-by: NDavid Windsor <dwindsor@gmail.com>
      Reviewed-by: NHans Liljestrand <ishkamiel@gmail.com>
      Signed-off-by: NElena Reshetova <elena.reshetova@intel.com>
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      a15dfcd5
    • J
      nfsd4: catch some false session retries · 53da6a53
      J. Bruce Fields 提交于
      The spec allows us to return NFS4ERR_SEQ_FALSE_RETRY if we notice that
      the client is making a call that matches a previous (slot, seqid) pair
      but that *isn't* actually a replay, because some detail of the call
      doesn't actually match the previous one.
      
      Catching every such case is difficult, but we may as well catch a few
      easy ones.  This also handles the case described in the previous patch,
      in a different way.
      
      The spec does however require us to catch the case where the difference
      is in the rpc credentials.  This prevents somebody from snooping another
      user's replies by fabricating retries.
      
      (But the practical value of the attack is limited by the fact that the
      replies with the most sensitive data are READ replies, which are not
      normally cached.)
      Tested-by: NOlga Kornievskaia <aglo@umich.edu>
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      53da6a53
    • J
      nfsd4: fix cached replies to solo SEQUENCE compounds · 085def3a
      J. Bruce Fields 提交于
      Currently our handling of 4.1+ requests without "cachethis" set is
      confusing and not quite correct.
      
      Suppose a client sends a compound consisting of only a single SEQUENCE
      op, and it matches the seqid in a session slot (so it's a retry), but
      the previous request with that seqid did not have "cachethis" set.
      
      The obvious thing to do might be to return NFS4ERR_RETRY_UNCACHED_REP,
      but the protocol only allows that to be returned on the op following the
      SEQUENCE, and there is no such op in this case.
      
      The protocol permits us to cache replies even if the client didn't ask
      us to.  And it's easy to do so in the case of solo SEQUENCE compounds.
      
      So, when we get a solo SEQUENCE, we can either return the previously
      cached reply or NFSERR_SEQ_FALSE_RETRY if we notice it differs in some
      way from the original call.
      
      Currently, we're returning a corrupt reply in the case a solo SEQUENCE
      matches a previous compound with more ops.  This actually matters
      because the Linux client recently started doing this as a way to recover
      from lost replies to idempotent operations in the case the process doing
      the original reply was killed: in that case it's difficult to keep the
      original arguments around to do a real retry, and the client no longer
      cares what the result is anyway, but it would like to make sure that the
      slot's sequence id has been incremented, and the solo SEQUENCE assures
      that: if the server never got the original reply, it will increment the
      sequence id.  If it did get the original reply, it won't increment, and
      nothing else that about the reply really matters much.  But we can at
      least attempt to return valid xdr!
      Tested-by: NOlga Kornievskaia <aglo@umich.edu>
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      085def3a
  6. 05 10月, 2017 1 次提交
  7. 14 7月, 2017 3 次提交
  8. 15 5月, 2017 3 次提交
  9. 26 4月, 2017 1 次提交
  10. 25 2月, 2017 1 次提交
  11. 18 2月, 2017 1 次提交