10 Jun, 2009

1 commit


24 Dec, 2008

14 commits

  • This patch extends the new upcall with a "service" field that currently
    can have 2 values: "*" or "nfs". These values specify matching rules for
    principals in the keytab file. The "*" means that gssd is allowed to use
    "root", "nfs", or "host" keytab entries while the other option requires
    "nfs".

    Restricting gssd to use the "nfs" principal is needed for when the
    server performs a callback to the client. The server in this case has
    to authenticate itself as an "nfs" principal.

    We also need "service" field to distiguish between two client-side cases
    both currently using a uid of 0: the case of regular file access by the
    root user, and the case of state-management calls (such as setclientid)
    which should use a keytab for authentication. (And the upcall should
    fail if an appropriate principal can't be found.)

    Signed-off: Olga Kornievskaia
    Signed-off-by: J. Bruce Fields
    Signed-off-by: Trond Myklebust

    Olga Kornievskaia
     
  • This patch extends the new upcall by adding a "target" field
    communicating who we want to authenticate to (equivalently, the service
    principal that we want to acquire a ticket for).

    Signed-off: Olga Kornievskaia
    Signed-off-by: J. Bruce Fields
    Signed-off-by: Trond Myklebust

    Olga Kornievskaia
     
  • This patch adds client-side support to allow for callbacks other than
    AUTH_SYS.

    Signed-off-by: Olga Kornievskaia
    Signed-off-by: J. Bruce Fields
    Signed-off-by: Trond Myklebust

    Olga Kornievskaia
     
  • Two principals are involved in krb5 authentication: the target, who we
    authenticate *to* (normally the name of the server, like
    nfs/server.citi.umich.edu@CITI.UMICH.EDU), and the source, we we
    authenticate *as* (normally a user, like bfields@UMICH.EDU)

    In the case of NFSv4 callbacks, the target of the callback should be the
    source of the client's setclientid call, and the source should be the
    nfs server's own principal.

    Therefore we allow svcgssd to pass down the name of the principal that
    just authenticated, so that on setclientid we can store that principal
    name with the new client, to be used later on callbacks.

    Signed-off-by: Olga Kornievskaia
    Signed-off-by: J. Bruce Fields
    Signed-off-by: Trond Myklebust

    Olga Kornievskaia
     
  • Implement the new upcall. We decide which version of the upcall gssd
    will use (new or old), by creating both pipes (the new one named "gssd",
    the old one named after the mechanism (e.g., "krb5")), and then waiting
    to see which version gssd actually opens.

    We don't permit pipes of the two different types to be opened at once.

    Signed-off-by: J. Bruce Fields
    Signed-off-by: Trond Myklebust

    \"J. Bruce Fields\
     
  • Keep a pointer to the inode that the message is queued on in the struct
    gss_upcall_msg. This will be convenient, especially after we have a
    choice of two pipes that an upcall could be queued on.

    Signed-off-by: J. Bruce Fields
    Signed-off-by: Trond Myklebust

    \"J. Bruce Fields\
     
  • Introduce a global variable pipe_version which will eventually be used
    to keep track of which version of the upcall gssd is using.

    For now, though, it only keeps track of whether any pipe is open or not;
    it is negative if not, zero if one is opened. We use this to wait for
    the first gssd to open a pipe.

    (Minor digression: note this waits only for the very first open of any
    pipe, not for the first open of a pipe for a given auth; thus we still
    need the RPC_PIPE_WAIT_FOR_OPEN behavior to wait for gssd to open new
    pipes that pop up on subsequent mounts.)

    Signed-off-by: J. Bruce Fields
    Signed-off-by: Trond Myklebust

    \"J. Bruce Fields\
     
  • Keep a count of the number of pipes open plus the number of messages on
    a pipe. This count isn't used yet.

    Signed-off-by: J. Bruce Fields
    Signed-off-by: Trond Myklebust

    \"J. Bruce Fields\
     
  • I want to add a little more code here, so it'll be convenient to have
    this flatter.

    Also, I'll want to add another error condition, so it'll be more
    convenient to return -ENOMEM than NULL in the error case. The only
    caller is already converting NULL to -ENOMEM anyway.

    Signed-off-by: J. Bruce Fields
    Signed-off-by: Trond Myklebust

    \"J. Bruce Fields\
     
  • We'll want to call this from elsewhere soon. And this is a bit nicer
    anyway.

    Signed-off-by: J. Bruce Fields
    Signed-off-by: Trond Myklebust

    \"J. Bruce Fields\
     
  • We're just about to kfree() gss_auth, so there's no point to setting any
    of its fields.

    Signed-off-by: J. Bruce Fields
    Signed-off-by: Trond Myklebust

    \"J. Bruce Fields\
     
  • There's a bit of a chicken and egg problem when it comes to destroying
    auth_gss credentials. When we destroy the last instance of a GSSAPI RPC
    credential, we should send a NULL RPC call with a GSS procedure of
    RPCSEC_GSS_DESTROY to hint to the server that it can destroy those
    creds.

    This isn't happening because we're setting clearing the uptodate bit on
    the credentials and then setting the operations to the gss_nullops. When
    we go to do the RPC call, we try to refresh the creds. That fails with
    -EACCES and the call fails.

    Fix this by not clearing the UPTODATE bit for the credentials and adding
    a new crdestroy op for gss_nullops that just tears down the cred without
    trying to destroy the context.

    The only difference between this patch and the first one is the removal
    of some minor formatting deltas.

    Signed-off-by: Jeff Layton
    Signed-off-by: Trond Myklebust

    Jeff Layton
     
  • Signed-off-by: Trond Myklebust

    Trond Myklebust
     
  • Somehow, this escaped the previous purge. There should be no need to keep
    any extra locks in the XDR callbacks.

    The NFS client XDR code only writes into private objects, whereas all reads
    of shared objects are confined to fields that do not change, such as
    filehandles...

    Ditto for lockd, the NFSv2/v3 client mount code, and rpcbind.

    The nfsd XDR code may require the BKL, but since it does a synchronous RPC
    call from a thread that already holds the lock, that issue is moot.

    Signed-off-by: Trond Myklebust

    Trond Myklebust
     

21 Jul, 2008

1 commit

  • * 'for-2.6.27' of git://linux-nfs.org/~bfields/linux: (51 commits)
    nfsd: nfs4xdr.c do-while is not a compound statement
    nfsd: Use C99 initializers in fs/nfsd/nfs4xdr.c
    lockd: Pass "struct sockaddr *" to new failover-by-IP function
    lockd: get host reference in nlmsvc_create_block() instead of callers
    lockd: minor svclock.c style fixes
    lockd: eliminate duplicate nlmsvc_lookup_host call from nlmsvc_lock
    lockd: eliminate duplicate nlmsvc_lookup_host call from nlmsvc_testlock
    lockd: nlm_release_host() checks for NULL, caller needn't
    file lock: reorder struct file_lock to save space on 64 bit builds
    nfsd: take file and mnt write in nfs4_upgrade_open
    nfsd: document open share bit tracking
    nfsd: tabulate nfs4 xdr encoding functions
    nfsd: dprint operation names
    svcrdma: Change WR context get/put to use the kmem cache
    svcrdma: Create a kmem cache for the WR contexts
    svcrdma: Add flush_scheduled_work to module exit function
    svcrdma: Limit ORD based on client's advertised IRD
    svcrdma: Remove unused wait q from svcrdma_xprt structure
    svcrdma: Remove unneeded spin locks from __svc_rdma_free
    svcrdma: Add dma map count and WARN_ON
    ...

    Linus Torvalds
     

18 Jul, 2008

1 commit


10 Jul, 2008

3 commits


04 Jul, 2008

1 commit

  • To return garbage_args, the accept_stat must be 0, and we must have a
    verifier. So we shouldn't be resetting the write pointer as we reject
    the call.

    Also, we must add the two placeholder words here regardless of success
    of the unwrap, to ensure the output buffer is left in a consistent state
    for svcauth_gss_release().

    This fixes a BUG() in svcauth_gss.c:svcauth_gss_release().

    Thanks to Aime Le Rouzic for bug report, debugging help, and testing.

    Signed-off-by: J. Bruce Fields
    Tested-by: Aime Le Rouzic
    Signed-off-by: Linus Torvalds

    J. Bruce Fields
     

24 Jun, 2008

3 commits


12 Jun, 2008

1 commit


25 Apr, 2008

2 commits

  • * git://git.linux-nfs.org/projects/trondmy/nfs-2.6: (80 commits)
    SUNRPC: Invalidate the RPCSEC_GSS session if the server dropped the request
    make nfs_automount_list static
    NFS: remove duplicate flags assignment from nfs_validate_mount_data
    NFS - fix potential NULL pointer dereference v2
    SUNRPC: Don't change the RPCSEC_GSS context on a credential that is in use
    SUNRPC: Fix a race in gss_refresh_upcall()
    SUNRPC: Don't disconnect more than once if retransmitting NFSv4 requests
    SUNRPC: Remove the unused export of xprt_force_disconnect
    SUNRPC: remove XS_SENDMSG_RETRY
    SUNRPC: Protect creds against early garbage collection
    NFSv4: Attempt to use machine credentials in SETCLIENTID calls
    NFSv4: Reintroduce machine creds
    NFSv4: Don't use cred->cr_ops->cr_name in nfs4_proc_setclientid()
    nfs: fix printout of multiword bitfields
    nfs: return negative error value from nfs{,4}_stat_to_errno
    NLM/lockd: Ensure client locking calls use correct credentials
    NFS: Remove the buggy lock-if-signalled case from do_setlk()
    NLM/lockd: Fix a race when cancelling a blocking lock
    NLM/lockd: Ensure that nlmclnt_cancel() returns results of the CANCEL call
    NLM: Remove the signal masking in nlmclnt_proc/nlmclnt_cancel
    ...

    Linus Torvalds
     
  • Trond Myklebust
     

24 Apr, 2008

5 commits


20 Apr, 2008

5 commits

  • When a server rejects our credential with an AUTH_REJECTEDCRED or similar,
    we need to refresh the credential and then retry the request.
    However, we do want to allow any requests that are in flight to finish
    executing, so that we can at least attempt to process the replies that
    depend on this instance of the credential.

    The solution is to ensure that gss_refresh() looks up an entirely new
    RPCSEC_GSS credential instead of attempting to create a context for the
    existing invalid credential.

    Signed-off-by: Trond Myklebust

    Trond Myklebust
     
  • If the downcall completes before we get the spin_lock then we currently
    fail to refresh the credential.

    Signed-off-by: Trond Myklebust

    Trond Myklebust
     
  • We need to try to ensure that we always use the same credentials whenever
    we re-establish the clientid on the server. If not, the server won't
    recognise that we're the same client, and so may not allow us to recover
    state.

    Signed-off-by: Trond Myklebust

    Trond Myklebust
     
  • With the recent change to generic creds, we can no longer use
    cred->cr_ops->cr_name to distinguish between RPCSEC_GSS principals and
    AUTH_SYS/AUTH_NULL identities. Replace it with the rpc_authops->au_name
    instead...

    Signed-off-by: Trond Myklebust

    Trond Myklebust
     
  • ..and always destroy using a 'soft' RPC call. Destroying GSS credentials
    isn't mandatory; the server can always cope with a few credentials not
    getting destroyed in a timely fashion.

    This actually fixes a hang situation. Basically, some servers will decide
    that the client is crazy if it tries to destroy an RPC context for which
    they have sent an RPCSEC_GSS_CREDPROBLEM, and so will refuse to talk to it
    for a while.
    The regression therefor probably was introduced by commit
    0df7fb74fbb709591301871a38aac7735a1d6583.

    Signed-off-by: Trond Myklebust

    Trond Myklebust
     

18 Mar, 2008

2 commits


15 Mar, 2008

1 commit