1. 14 7月, 2016 2 次提交
  2. 16 6月, 2016 3 次提交
  3. 14 5月, 2016 1 次提交
  4. 02 3月, 2016 3 次提交
  5. 07 1月, 2016 1 次提交
  6. 08 12月, 2015 1 次提交
  7. 25 11月, 2015 4 次提交
    • J
      nfsd4: fix gss-proxy 4.1 mounts for some AD principals · 414ca017
      J. Bruce Fields 提交于
      The principal name on a gss cred is used to setup the NFSv4.0 callback,
      which has to have a client principal name to authenticate to.
      
      That code wants the name to be in the form servicetype@hostname.
      rpc.svcgssd passes down such names (and passes down no principal name at
      all in the case the principal isn't a service principal).
      
      gss-proxy always passes down the principal name, and passes it down in
      the form servicetype/hostname@REALM.  So we've been munging the name
      gss-proxy passes down into the format the NFSv4.0 callback code expects,
      or throwing away the name if we can't.
      
      Since the introduction of the MACH_CRED enforcement in NFSv4.1, we've
      also been using the principal name to verify that certain operations are
      done as the same principal as was used on the original EXCHANGE_ID call.
      
      For that application, the original name passed down by gss-proxy is also
      useful.
      
      Lack of that name in some cases was causing some kerberized NFSv4.1
      mount failures in an Active Directory environment.
      
      This fix only works in the gss-proxy case.  The fix for legacy
      rpc.svcgssd would be more involved, and rpc.svcgssd already has other
      problems in the AD case.
      Reported-and-tested-by: NJames Ralston <ralston@pobox.com>
      Acked-by: NSimo Sorce <simo@redhat.com>
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      414ca017
    • J
      nfsd: fix unlikely NULL deref in mach_creds_match · 920dd9bb
      J. Bruce Fields 提交于
      We really shouldn't allow a client to be created with cl_mach_cred set
      unless it also has a principal name.
      
      This also allows us to fail such cases immediately on EXCHANGE_ID as
      opposed to waiting and incorrectly returning WRONG_CRED on the following
      CREATE_SESSION.
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      920dd9bb
    • J
      nfsd: minor consolidation of mach_cred handling code · 50c7b948
      J. Bruce Fields 提交于
      Minor cleanup, no change in functionality.
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      50c7b948
    • J
      nfsd: helper for dup of possibly NULL string · 50043859
      J. Bruce Fields 提交于
      Technically the initialization in the NULL case isn't even needed as the
      only caller already has target zeroed out, but it seems safer to keep
      copy_cred generic.
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      50043859
  8. 24 11月, 2015 2 次提交
  9. 10 11月, 2015 2 次提交
    • A
      nfsd: fix race with open / open upgrade stateids · 7fc0564e
      Andrew Elble 提交于
      We observed multiple open stateids on the server for files that
      seemingly should have been closed.
      
      nfsd4_process_open2() tests for the existence of a preexisting
      stateid. If one is not found, the locks are dropped and a new
      one is created. The problem is that init_open_stateid(), which
      is also responsible for hashing the newly initialized stateid,
      doesn't check to see if another open has raced in and created
      a matching stateid. This fix is to enable init_open_stateid() to
      return the matching stateid and have nfsd4_process_open2()
      swap to that stateid and switch to the open upgrade path.
      In testing this patch, coverage to the newly created
      path indicates that the race was indeed happening.
      Signed-off-by: NAndrew Elble <aweits@rit.edu>
      Reviewed-by: NJeff Layton <jlayton@poochiereds.net>
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      7fc0564e
    • A
      nfsd: eliminate sending duplicate and repeated delegations · 34ed9872
      Andrew Elble 提交于
      We've observed the nfsd server in a state where there are
      multiple delegations on the same nfs4_file for the same client.
      The nfs client does attempt to DELEGRETURN these when they are presented to
      it - but apparently under some (unknown) circumstances the client does not
      manage to return all of them. This leads to the eventual
      attempt to CB_RECALL more than one delegation with the same nfs
      filehandle to the same client. The first recall will succeed, but the
      next recall will fail with NFS4ERR_BADHANDLE. This leads to the server
      having delegations on cl_revoked that the client has no way to FREE
      or DELEGRETURN, with resulting inability to recover. The state manager
      on the server will continually assert SEQ4_STATUS_RECALLABLE_STATE_REVOKED,
      and the state manager on the client will be looping unable to satisfy
      the server.
      
      List discussion also reports a race between OPEN and DELEGRETURN that
      will be avoided by only sending the delegation once to the
      client. This is also logically in accordance with RFC5561 9.1.1 and 10.2.
      
      So, let's:
      
      1.) Not hand out duplicate delegations.
      2.) Only send them to the client once.
      
      RFC 5561:
      
      9.1.1:
      "Delegations and layouts, on the other hand, are not associated with a
      specific owner but are associated with the client as a whole
      (identified by a client ID)."
      
      10.2:
      "...the stateid for a delegation is associated with a client ID and may be
      used on behalf of all the open-owners for the given client.  A
      delegation is made to the client as a whole and not to any specific
      process or thread of control within it."
      Reported-by: NEric Meddaugh <etmsys@rit.edu>
      Cc: Trond Myklebust <trond.myklebust@primarydata.com>
      Cc: Olga Kornievskaia <aglo@umich.edu>
      Signed-off-by: NAndrew Elble <aweits@rit.edu>
      Cc: stable@vger.kernel.org
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      34ed9872
  10. 24 10月, 2015 3 次提交
    • J
      nfsd: ensure that seqid morphing operations are atomic wrt to copies · 9767feb2
      Jeff Layton 提交于
      Bruce points out that the increment of the seqid in stateids is not
      serialized in any way, so it's possible for racing calls to bump it
      twice and end up sending the same stateid. While we don't have any
      reports of this problem it _is_ theoretically possible, and could lead
      to spurious state recovery by the client.
      
      In the current code, update_stateid is always followed by a memcpy of
      that stateid, so we can combine the two operations. For better
      atomicity, we add a spinlock to the nfs4_stid and hold that when bumping
      the seqid and copying the stateid.
      Signed-off-by: NJeff Layton <jeff.layton@primarydata.com>
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      9767feb2
    • J
      nfsd: improve client_has_state to check for unused openowners · 4eaea134
      J. Bruce Fields 提交于
      At least in the v4.0 case openowners can hang around for a while after
      last close, but they shouldn't really block (for example), a new mount
      with a different principal.
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      4eaea134
    • J
      nfsd: fix clid_inuse on mount with security change · 2b634821
      J. Bruce Fields 提交于
      In bakeathon testing Solaris client was getting CLID_INUSE error when
      doing a krb5 mount soon after an auth_sys mount, or vice versa.
      
      That's not really necessary since in this case the old client doesn't
      have any state any more:
      
      	http://tools.ietf.org/html/rfc7530#page-103
      
      	"when the server gets a SETCLIENTID for a client ID that
      	currently has no state, or it has state but the lease has
      	expired, rather than returning NFS4ERR_CLID_INUSE, the server
      	MUST allow the SETCLIENTID and confirm the new client ID if
      	followed by the appropriate SETCLIENTID_CONFIRM."
      
      This doesn't fix the problem completely since our client_has_state()
      check counts openowners left around to handle close replays, which we
      should probably just remove in this case.
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      2b634821
  11. 13 10月, 2015 1 次提交
    • J
      nfsd: serialize state seqid morphing operations · 35a92fe8
      Jeff Layton 提交于
      Andrew was seeing a race occur when an OPEN and OPEN_DOWNGRADE were
      running in parallel. The server would receive the OPEN_DOWNGRADE first
      and check its seqid, but then an OPEN would race in and bump it. The
      OPEN_DOWNGRADE would then complete and bump the seqid again.  The result
      was that the OPEN_DOWNGRADE would be applied after the OPEN, even though
      it should have been rejected since the seqid changed.
      
      The only recourse we have here I think is to serialize operations that
      bump the seqid in a stateid, particularly when we're given a seqid in
      the call. To address this, we add a new rw_semaphore to the
      nfs4_ol_stateid struct. We do a down_write prior to checking the seqid
      after looking up the stateid to ensure that nothing else is going to
      bump it while we're operating on it.
      
      In the case of OPEN, we do a down_read, as the call doesn't contain a
      seqid. Those can run in parallel -- we just need to serialize them when
      there is a concurrent OPEN_DOWNGRADE or CLOSE.
      
      LOCK and LOCKU however always take the write lock as there is no
      opportunity for parallelizing those.
      Reported-and-Tested-by: NAndrew W Elble <aweits@rit.edu>
      Signed-off-by: NJeff Layton <jeff.layton@primarydata.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      35a92fe8
  12. 02 9月, 2015 2 次提交
  13. 01 9月, 2015 3 次提交
  14. 13 8月, 2015 1 次提交
  15. 11 8月, 2015 11 次提交