08 Sep, 2013

2 commits


07 Sep, 2013

1 commit

  • Commit 4edaa308 "NFS: Use "krb5i" to establish NFSv4 state whenever possible"
    uses the nfs_client cl_rpcclient for all state management operations, and
    will use krb5i or auth_sys with no regard to the mount command authflavor
    choice.

    The MDS, as any NFSv4.1 mount point, uses the nfs_server rpc client for all
    non-state management operations with a different nfs_server for each fsid
    encountered traversing the mount point, each with a potentially different
    auth flavor.

    pNFS data servers are not mounted in the normal sense as there is no associated
    nfs_server structure. Data servers can also export multiple fsids, each with
    a potentially different auth flavor.

    Data servers need to use the same authflavor as the MDS server rpc client for
    non-state management operations. Populate a list of rpc clients with the MDS
    server rpc client auth flavor for the DS to use.

    Signed-off-by: Andy Adamson
    Signed-off-by: Trond Myklebust

    Andy Adamson
     

04 Sep, 2013

1 commit


08 Aug, 2013

1 commit


29 Jun, 2013

3 commits

  • * labeled-nfs:
    NFS: Apply v4.1 capabilities to v4.2
    NFS: Add in v4.2 callback operation
    NFS: Make callbacks minor version generic
    Kconfig: Add Kconfig entry for Labeled NFS V4 client
    NFS: Extend NFS xattr handlers to accept the security namespace
    NFS: Client implementation of Labeled-NFS
    NFS: Add label lifecycle management
    NFS:Add labels to client function prototypes
    NFSv4: Extend fattr bitmaps to support all 3 words
    NFSv4: Introduce new label structure
    NFSv4: Add label recommended attribute and NFSv4 flags
    NFSv4.2: Added NFS v4.2 support to the NFS client
    SELinux: Add new labeling type native labels
    LSM: Add flags field to security_sb_set_mnt_opts for in kernel mount data.
    Security: Add Hook to test if the particular xattr is part of a MAC model.
    Security: Add hook to calculate context based on a negative dentry.
    NFS: Add NFSv4.2 protocol constants

    Conflicts:
    fs/nfs/nfs4proc.c

    Trond Myklebust
     
  • NFS_CS_MIGRATION makes sense only for NFSv4 mounts. Introduced by
    commit 89652617 (NFS: Introduce "migration" mount option) Fri Sep 14
    17:24:11 2012.

    Signed-off-by: Chuck Lever
    Signed-off-by: Trond Myklebust

    Chuck Lever
     
  • nfs4_init_session was originally written to be called prior to
    nfs4_init_channel_attrs, setting the session target_max response and request
    sizes that nfs4_init_channel_attrs would pay attention to.

    In the current code flow, nfs4_init_session, just like nfs4_init_ds_session
    for the data server case, is called after the session is all negotiated, and
    is actually used in a RECLAIM COMPLETE call to the server.

    Remove the un-needed fc_target_max response and request fields from
    nfs4_session and just set the max_resp_sz and max_rqst_sz in
    nfs4_init_channel_attrs.

    Signed-off-by: Andy Adamson
    Signed-off-by: Trond Myklebust

    Andy Adamson
     

09 Jun, 2013

2 commits


24 May, 2013

1 commit


24 Apr, 2013

2 commits

  • Fix up a conflict between the linux-next branch and mainline.
    Conflicts:
    fs/nfs/nfs4proc.c

    Trond Myklebust
     
  • * rpcsec_gss-from_cel: (21 commits)
    NFS: Retry SETCLIENTID with AUTH_SYS instead of AUTH_NONE
    NFSv4: Don't clear the machine cred when client establish returns EACCES
    NFSv4: Fix issues in nfs4_discover_server_trunking
    NFSv4: Fix the fallback to AUTH_NULL if krb5i is not available
    NFS: Use server-recommended security flavor by default (NFSv3)
    SUNRPC: Don't recognize RPC_AUTH_MAXFLAVOR
    NFS: Use "krb5i" to establish NFSv4 state whenever possible
    NFS: Try AUTH_UNIX when PUTROOTFH gets NFS4ERR_WRONGSEC
    NFS: Use static list of security flavors during root FH lookup recovery
    NFS: Avoid PUTROOTFH when managing leases
    NFS: Clean up nfs4_proc_get_rootfh
    NFS: Handle missing rpc.gssd when looking up root FH
    SUNRPC: Remove EXPORT_SYMBOL_GPL() from GSS mech switch
    SUNRPC: Make gss_mech_get() static
    SUNRPC: Refactor nfsd4_do_encode_secinfo()
    SUNRPC: Consider qop when looking up pseudoflavors
    SUNRPC: Load GSS kernel module by OID
    SUNRPC: Introduce rpcauth_get_pseudoflavor()
    SUNRPC: Define rpcsec_gss_info structure
    NFS: Remove unneeded forward declaration
    ...

    Trond Myklebust
     

15 Apr, 2013

1 commit


11 Apr, 2013

1 commit


06 Apr, 2013

1 commit

  • It is unsafe to use list_for_each_entry_safe() here, because
    when we drop the nn->nfs_client_lock, we pin the _current_ list
    entry and ensure that it stays in the list, but we don't do the
    same for the _next_ list entry. Use of list_for_each_entry() is
    therefore the correct thing to do.

    Also fix the refcounting in nfs41_walk_client_list().

    Finally, ensure that the nfs_client has finished being initialised
    and, in the case of NFSv4.1, that the session is set up.

    Signed-off-by: Trond Myklebust
    Cc: Chuck Lever
    Cc: Bryan Schumaker
    Cc: stable@vger.kernel.org [>= 3.7]

    Trond Myklebust
     

05 Apr, 2013

1 commit


30 Mar, 2013

1 commit

  • Currently our client uses AUTH_UNIX for state management on Kerberos
    NFS mounts in some cases. For example, if the first mount of a
    server specifies "sec=sys," the SETCLIENTID operation is performed
    with AUTH_UNIX. Subsequent mounts using stronger security flavors
    can not change the flavor used for lease establishment. This might
    be less security than an administrator was expecting.

    Dave Noveck's migration issues draft recommends the use of an
    integrity-protecting security flavor for the SETCLIENTID operation.
    Let's ignore the mount's sec= setting and use krb5i as the default
    security flavor for SETCLIENTID.

    If our client can't establish a GSS context (eg. because it doesn't
    have a keytab or the server doesn't support Kerberos) we fall back
    to using AUTH_NULL. For an operation that requires a
    machine credential (which never represents a particular user)
    AUTH_NULL is as secure as AUTH_UNIX.

    Signed-off-by: Chuck Lever
    Signed-off-by: Trond Myklebust

    Chuck Lever
     

26 Mar, 2013

1 commit


01 Mar, 2013

1 commit

  • Pull nfsd changes from J Bruce Fields:
    "Miscellaneous bugfixes, plus:

    - An overhaul of the DRC cache by Jeff Layton. The main effect is
    just to make it larger. This decreases the chances of intermittent
    errors especially in the UDP case. But we'll need to watch for any
    reports of performance regressions.

    - Containerized nfsd: with some limitations, we now support
    per-container nfs-service, thanks to extensive work from Stanislav
    Kinsbursky over the last year."

    Some notes about conflicts, since there were *two* non-data semantic
    conflicts here:

    - idr_remove_all() had been added by a memory leak fix, but has since
    become deprecated since idr_destroy() does it for us now.

    - xs_local_connect() had been added by this branch to make AF_LOCAL
    connections be synchronous, but in the meantime Trond had changed the
    calling convention in order to avoid a RCU dereference.

    There were a couple of more obvious actual source-level conflicts due to
    the hlist traversal changes and one just due to code changes next to
    each other, but those were trivial.

    * 'for-3.9' of git://linux-nfs.org/~bfields/linux: (49 commits)
    SUNRPC: make AF_LOCAL connect synchronous
    nfsd: fix compiler warning about ambiguous types in nfsd_cache_csum
    svcrpc: fix rpc server shutdown races
    svcrpc: make svc_age_temp_xprts enqueue under sv_lock
    lockd: nlmclnt_reclaim(): avoid stack overflow
    nfsd: enable NFSv4 state in containers
    nfsd: disable usermode helper client tracker in container
    nfsd: use proper net while reading "exports" file
    nfsd: containerize NFSd filesystem
    nfsd: fix comments on nfsd_cache_lookup
    SUNRPC: move cache_detail->cache_request callback call to cache_read()
    SUNRPC: remove "cache_request" argument in sunrpc_cache_pipe_upcall() function
    SUNRPC: rework cache upcall logic
    SUNRPC: introduce cache_detail->cache_request callback
    NFS: simplify and clean cache library
    NFS: use SUNRPC cache creation and destruction helper for DNS cache
    nfsd4: free_stid can be static
    nfsd: keep a checksum of the first 256 bytes of request
    sunrpc: trim off trailing checksum before returning decrypted or integrity authenticated buffer
    sunrpc: fix comment in struct xdr_buf definition
    ...

    Linus Torvalds
     

28 Feb, 2013

1 commit


05 Feb, 2013

1 commit


28 Jan, 2013

3 commits

  • We do need to start the lease recovery thread prior to waiting for the
    client initialisation to complete in NFSv4.1.

    Signed-off-by: Trond Myklebust
    Cc: Chuck Lever
    Cc: Ben Greear
    Cc: stable@vger.kernel.org [>=3.7]

    Trond Myklebust
     
  • If walking the list in nfs4[01]_walk_client_list fails, then the most
    likely explanation is that the server dropped the clientid before we
    actually managed to confirm it. As long as our nfs_client is the very
    last one in the list to be tested, the caller can be assured that this
    is the case when the final return value is NFS4ERR_STALE_CLIENTID.

    Reported-by: Ben Greear
    Signed-off-by: Trond Myklebust
    Cc: Chuck Lever
    Cc: stable@vger.kernel.org [>=3.7]
    Tested-by: Ben Greear

    Trond Myklebust
     
  • The reference counting in nfs4_init_client assumes wongly that it
    is safe for nfs4_discover_server_trunking() to return a pointer to a
    nfs_client prior to bumping the reference count.

    Signed-off-by: Trond Myklebust
    Cc: Chuck Lever
    Cc: Ben Greear
    Cc: stable@vger.kernel.org [>=3.7]

    Trond Myklebust
     

06 Dec, 2012

1 commit


05 Nov, 2012

1 commit


03 Oct, 2012

1 commit

  • Sparse identified an execution path in nfs41_walk_client_list()
    where the nfs_client_lock is not re-acquired before taking the next
    loop iteration.

    fs/nfs/nfs4client.c:437:9: sparse: context imbalance in
    'nfs41_walk_client_list' - different lock contexts for basic block

    Signed-off-by: Chuck Lever
    Cc: Fengguang Wu
    Signed-off-by: Trond Myklebust

    Chuck Lever
     

02 Oct, 2012

4 commits

  • Fix another compiler warning.

    Signed-off-by: Trond Myklebust

    Trond Myklebust
     
  • "Server trunking" is a fancy named for a multi-homed NFS server.
    Trunking might occur if a client sends NFS requests for a single
    workload to multiple network interfaces on the same server. There
    are some implications for NFSv4 state management that make it useful
    for a client to know if a single NFSv4 server instance is
    multi-homed. (Note this is only a consideration for NFSv4, not for
    legacy versions of NFS, which are stateless).

    If a client cares about server trunking, no NFSv4 operations can
    proceed until that client determines who it is talking to. Thus
    server IP trunking discovery must be done when the client first
    encounters an unfamiliar server IP address.

    The nfs_get_client() function walks the nfs_client_list and matches
    on server IP address. The outcome of that walk tells us immediately
    if we have an unfamiliar server IP address. It invokes
    nfs_init_client() in this case. Thus, nfs4_init_client() is a good
    spot to perform trunking discovery.

    Discovery requires a client to establish a fresh client ID, so our
    client will now send SETCLIENTID or EXCHANGE_ID as the first NFS
    operation after a successful ping, rather than waiting for an
    application to perform an operation that requires NFSv4 state.

    The exact process for detecting trunking is different for NFSv4.0 and
    NFSv4.1, so a minorversion-specific init_client callout method is
    introduced.

    CLID_INUSE recovery is important for the trunking discovery process.
    CLID_INUSE is a sign the server recognizes the client's nfs_client_id4
    id string, but the client is using the wrong principal this time for
    the SETCLIENTID operation. The SETCLIENTID must be retried with a
    series of different principals until one works, and then the rest of
    trunking discovery can proceed.

    Signed-off-by: Chuck Lever
    Signed-off-by: Trond Myklebust

    Chuck Lever
     
  • v4:
    1) Callback transport creation routine selection by version simlified.

    This new function in now called before nfs_minorversion_callback_svc_setup()).

    Also few small changes:
    1) current network namespace in nfs_callback_up() was replaced by transport net.
    2) svc_shutdown_net() was moved prior to callback usage counter decrement
    (because in case of per-net data allocation faulure svc_shutdown_net() have to
    be skipped).

    Signed-off-by: Stanislav Kinsbursky
    Signed-off-by: Trond Myklebust

    Stanislav Kinsbursky
     
  • Signed-off-by: Stanislav Kinsbursky
    Signed-off-by: Trond Myklebust

    Stanislav Kinsbursky
     

21 Aug, 2012

1 commit


31 Jul, 2012

3 commits


18 Jul, 2012

3 commits