11 May, 2013

1 commit

  • Pull nfsd fixes from Bruce Fields:
    "Small fixes for two bugs and two warnings"

    * 'for-3.10' of git://linux-nfs.org/~bfields/linux:
    nfsd: fix oops when legacy_recdir_name_error is passed a -ENOENT error
    SUNRPC: fix decoding of optional gss-proxy xdr fields
    SUNRPC: Refactor gssx_dec_option_array() to kill uninitialized warning
    nfsd4: don't allow owner override on 4.1 CLAIM_FH opens

    Linus Torvalds
     

10 May, 2013

1 commit

  • Pull more NFS client bugfixes from Trond Myklebust:

    - Ensure that we match the 'sec=' mount flavour against the server list

    - Fix the NFSv4 byte range locking in the presence of delegations

    - Ensure that we conform to the NFSv4.1 spec w.r.t. freeing lock
    stateids

    - Fix a pNFS data server connection race

    * tag 'nfs-for-3.10-2' of git://git.linux-nfs.org/projects/trondmy/linux-nfs:
    NFS4.1 Fix data server connection race
    NFSv3: match sec= flavor against server list
    NFSv4.1: Ensure that we free the lock stateid on the server
    NFSv4: Convert nfs41_free_stateid to use an asynchronous RPC call
    SUNRPC: Don't spam syslog with "Pseudoflavor not found" messages
    NFSv4.x: Fix handling of partially delegated locks

    Linus Torvalds
     

08 May, 2013

1 commit


06 May, 2013

1 commit


04 May, 2013

2 commits

  • Pull nfsd changes from J Bruce Fields:
    "Highlights include:

    - Some more DRC cleanup and performance work from Jeff Layton

    - A gss-proxy upcall from Simo Sorce: currently krb5 mounts to the
    server using credentials from Active Directory often fail due to
    limitations of the svcgssd upcall interface. This replacement
    lifts those limitations. The existing upcall is still supported
    for backwards compatibility.

    - More NFSv4.1 support: at this point, if a user with a current
    client who upgrades from 4.0 to 4.1 should see no regressions. In
    theory we do everything a 4.1 server is required to do. Patches
    for a couple minor exceptions are ready for 3.11, and with those
    and some more testing I'd like to turn 4.1 on by default in 3.11."

    Fix up semantic conflict as per Stephen Rothwell and linux-next:

    Commit 030d794bf498 ("SUNRPC: Use gssproxy upcall for server RPCGSS
    authentication") adds two new users of "PDE(inode)->data", but we're
    supposed to use "PDE_DATA(inode)" instead since commit d9dda78bad87
    ("procfs: new helper - PDE_DATA(inode)").

    The old PDE() macro is no longer available since commit c30480b92cf4
    ("proc: Make the PROC_I() and PDE() macros internal to procfs")

    * 'for-3.10' of git://linux-nfs.org/~bfields/linux: (60 commits)
    NFSD: SECINFO doesn't handle unsupported pseudoflavors correctly
    NFSD: Simplify GSS flavor encoding in nfsd4_do_encode_secinfo()
    nfsd: make symbol nfsd_reply_cache_shrinker static
    svcauth_gss: fix error return code in rsc_parse()
    nfsd4: don't remap EISDIR errors in rename
    svcrpc: fix gss-proxy to respect user namespaces
    SUNRPC: gssp_procedures[] can be static
    SUNRPC: define {create,destroy}_use_gss_proxy_proc_entry in !PROC case
    nfsd4: better error return to indicate SSV non-support
    nfsd: fix EXDEV checking in rename
    SUNRPC: Use gssproxy upcall for server RPCGSS authentication.
    SUNRPC: Add RPC based upcall mechanism for RPCGSS auth
    SUNRPC: conditionally return endtime from import_sec_context
    SUNRPC: allow disabling idle timeout
    SUNRPC: attempt AF_LOCAL connect on setup
    nfsd: Decode and send 64bit time values
    nfsd4: put_client_renew_locked can be static
    nfsd4: remove unused macro
    nfsd4: remove some useless code
    nfsd4: implement SEQ4_STATUS_RECALLABLE_STATE_REVOKED
    ...

    Linus Torvalds
     
  • Just convert those messages to dprintk()s so that they can be used
    when debugging.

    Signed-off-by: Trond Myklebust

    Trond Myklebust
     

02 May, 2013

1 commit

  • Pull VFS updates from Al Viro,

    Misc cleanups all over the place, mainly wrt /proc interfaces (switch
    create_proc_entry to proc_create(), get rid of the deprecated
    create_proc_read_entry() in favor of using proc_create_data() and
    seq_file etc).

    7kloc removed.

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (204 commits)
    don't bother with deferred freeing of fdtables
    proc: Move non-public stuff from linux/proc_fs.h to fs/proc/internal.h
    proc: Make the PROC_I() and PDE() macros internal to procfs
    proc: Supply a function to remove a proc entry by PDE
    take cgroup_open() and cpuset_open() to fs/proc/base.c
    ppc: Clean up scanlog
    ppc: Clean up rtas_flash driver somewhat
    hostap: proc: Use remove_proc_subtree()
    drm: proc: Use remove_proc_subtree()
    drm: proc: Use minor->index to label things, not PDE->name
    drm: Constify drm_proc_list[]
    zoran: Don't print proc_dir_entry data in debug
    reiserfs: Don't access the proc_dir_entry in r_open(), r_start() r_show()
    proc: Supply an accessor for getting the data from a PDE's parent
    airo: Use remove_proc_subtree()
    rtl8192u: Don't need to save device proc dir PDE
    rtl8187se: Use a dir under /proc/net/r8180/
    proc: Add proc_mkdir_data()
    proc: Move some bits from linux/proc_fs.h to linux/{of.h,signal.h,tty.h}
    proc: Move PDE_NET() to fs/proc/proc_net.c
    ...

    Linus Torvalds
     

01 May, 2013

2 commits

  • Fix to return a negative error code from the error handling
    case instead of 0, as returned elsewhere in this function.

    Signed-off-by: Wei Yongjun
    Signed-off-by: J. Bruce Fields

    Wei Yongjun
     
  • Pull NFS client bugfixes and cleanups from Trond Myklebust:

    - NLM: stable fix for NFSv2/v3 blocking locks

    - NFSv4.x: stable fixes for the delegation recall error handling code

    - NFSv4.x: Security flavour negotiation fixes and cleanups by Chuck
    Lever

    - SUNRPC: A number of RPCSEC_GSS fixes and cleanups also from Chuck

    - NFSv4.x assorted state management and reboot recovery bugfixes

    - NFSv4.1: In cases where we have already looked up a file, and hold a
    valid filehandle, use the new open-by-filehandle operation instead of
    opening by name.

    - Allow the NFSv4.1 callback thread to freeze

    - NFSv4.x: ensure that file unlock waits for readahead to complete

    - NFSv4.1: ensure that the RPC layer doesn't override the NFS session
    table size negotiation by limiting the number of slots.

    - NFSv4.x: Fix SETATTR spec compatibility issues

    * tag 'nfs-for-3.10-1' of git://git.linux-nfs.org/projects/trondmy/linux-nfs: (67 commits)
    NFSv4: Warn once about servers that incorrectly apply open mode to setattr
    NFSv4: Servers should only check SETATTR stateid open mode on size change
    NFSv4: Don't recheck permissions on open in case of recovery cached open
    NFSv4.1: Don't do a delegated open for NFS4_OPEN_CLAIM_DELEG_CUR_FH modes
    NFSv4.1: Use the more efficient open_noattr call for open-by-filehandle
    NFS: Retry SETCLIENTID with AUTH_SYS instead of AUTH_NONE
    NFSv4: Ensure that we clear the NFS_OPEN_STATE flag when appropriate
    LOCKD: Ensure that nlmclnt_block resets block->b_status after a server reboot
    NFSv4: Ensure the LOCK call cannot use the delegation stateid
    NFSv4: Use the open stateid if the delegation has the wrong mode
    nfs: Send atime and mtime as a 64bit value
    NFSv4: Record the OPEN create mode used in the nfs4_opendata structure
    NFSv4.1: Set the RPC_CLNT_CREATE_INFINITE_SLOTS flag for NFSv4.1 transports
    SUNRPC: Allow rpc_create() to request that TCP slots be unlimited
    SUNRPC: Fix a livelock problem in the xprt->backlog queue
    NFSv4: Fix handling of revoked delegations by setattr
    NFSv4 release the sequence id in the return on close case
    nfs: remove unnecessary check for NULL inode->i_flock from nfs_delegation_claim_locks
    NFS: Ensure that NFS file unlock waits for readahead to complete
    NFS: Add functionality to allow waiting on all outstanding reads to complete
    ...

    Linus Torvalds
     

30 Apr, 2013

6 commits


26 Apr, 2013

6 commits

  • The main advantge of this new upcall mechanism is that it can handle
    big tickets as seen in Kerberos implementations where tickets carry
    authorization data like the MS-PAC buffer with AD or the Posix Authorization
    Data being discussed in IETF on the krbwg working group.

    The Gssproxy program is used to perform the accept_sec_context call on the
    kernel's behalf. The code is changed to also pass the input buffer straight
    to upcall mechanism to avoid allocating and copying many pages as tokens can
    be as big (potentially more in future) as 64KiB.

    Signed-off-by: Simo Sorce
    [bfields: containerization, negotiation api]
    Signed-off-by: J. Bruce Fields

    Simo Sorce
     
  • This patch implements a sunrpc client to use the services of the gssproxy
    userspace daemon.

    In particular it allows to perform calls in user space using an RPC
    call instead of custom hand-coded upcall/downcall messages.

    Currently only accept_sec_context is implemented as that is all is needed for
    the server case.

    File server modules like NFS and CIFS can use full gssapi services this way,
    once init_sec_context is also implemented.

    For the NFS server case this code allow to lift the limit of max 2k krb5
    tickets. This limit is prevents legitimate kerberos deployments from using krb5
    authentication with the Linux NFS server as they have normally ticket that are
    many kilobytes large.

    It will also allow to lift the limitation on the size of the credential set
    (uid,gid,gids) passed down from user space for users that have very many groups
    associated. Currently the downcall mechanism used by rpc.svcgssd is limited
    to around 2k secondary groups of the 65k allowed by kernel structures.

    Signed-off-by: Simo Sorce
    [bfields: containerization, concurrent upcalls, misc. fixes and cleanup]
    Signed-off-by: J. Bruce Fields

    Simo Sorce
     
  • We expose this parameter for a future caller.
    It will be used to extract the endtime from the gss-proxy upcall mechanism,
    in order to set the rsc cache expiration time.

    Signed-off-by: Simo Sorce
    Signed-off-by: J. Bruce Fields

    Simo Sorce
     
  • In the gss-proxy case we don't want to have to reconnect at random--we
    want to connect only on gss-proxy startup when we can steal gss-proxy's
    context to do the connect in the right namespace.

    So, provide a flag that allows the rpc_create caller to turn off the
    idle timeout.

    Signed-off-by: J. Bruce Fields

    J. Bruce Fields
     
  • In the gss-proxy case, setup time is when I know I'll have the right
    namespace for the connect.

    In other cases, it might be useful to get any connection errors
    earlier--though actually in practice it doesn't make any difference for
    rpcbind.

    Signed-off-by: J. Bruce Fields

    J. Bruce Fields
     
  • Merging Trond's nfs-for-next branch, mainly to get
    b7993cebb841b0da7a33e9d5ce301a9fd3209165 "SUNRPC: Allow rpc_create() to
    request that TCP slots be unlimited", which a small piece of the
    gss-proxy work depends on.

    J. Bruce Fields
     

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

2 commits


11 Apr, 2013

1 commit

  • Pull NFS client bugfixes from Trond Myklebust:
    - fix for memory corruption issues in nfs4[01]_walk_client_list (stable)
    - fix for an Oopsable bug in rpc_clone_client (stable)
    - another state manager deadlock in the NFSv4 open code
    - memory leaks in nfs4_discover_server_trunking and rpc_new_client

    * tag 'nfs-for-3.9-4' of git://git.linux-nfs.org/projects/trondmy/linux-nfs:
    NFSv4: Fix another potential state manager deadlock
    SUNRPC: Fix a potential memory leak in rpc_new_client
    NFSv4/4.1: Fix bugs in nfs4[01]_walk_client_list
    NFSv4: Fix a memory leak in nfs4_discover_server_trunking
    SUNRPC: Remove extra xprt_put()

    Linus Torvalds
     

10 Apr, 2013

1 commit

  • The only part of proc_dir_entry the code outside of fs/proc
    really cares about is PDE(inode)->data. Provide a helper
    for that; static inline for now, eventually will be moved
    to fs/proc, along with the knowledge of struct proc_dir_entry
    layout.

    Signed-off-by: Al Viro

    Al Viro
     

06 Apr, 2013

3 commits

  • The Kconfig entry for SUNRPC_SWAP selects NETVM. That select statement
    was added in commit a564b8f0398636ba30b07c0eaebdef7ff7837249 ("nfs:
    enable swap on NFS"). But there's no Kconfig symbol NETVM. It apparently
    was only in used in development versions of the swap over nfs
    functionality but never entered mainline. Anyhow, it is a nop and can
    safely be dropped.

    Signed-off-by: Paul Bolle
    Signed-off-by: Trond Myklebust

    Paul Bolle
     
  • If the call to rpciod_up() fails, we currently leak a reference to the
    struct rpc_xprt.
    As part of the fix, we also remove the redundant check for xprt!=NULL.
    This is already taken care of by the callers.

    Signed-off-by: Trond Myklebust

    Trond Myklebust
     
  • While testing error cases where rpc_new_client() fails, I saw
    some oopses.

    If rpc_new_client() fails, it already invokes xprt_put(). Thus
    __rpc_clone_client() does not need to invoke it again.

    Introduced by commit 1b63a751 "SUNRPC: Refactor rpc_clone_client()"
    Fri Sep 14, 2012.

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

    Chuck Lever
     

05 Apr, 2013

1 commit


04 Apr, 2013

1 commit


30 Mar, 2013

8 commits

  • Clean up: Reduce the symbol table footprint for auth_rpcgss.ko by
    removing exported symbols for functions that are no longer used
    outside of auth_rpcgss.ko.

    The remaining two EXPORTs in gss_mech_switch.c get documenting
    comments.

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

    Chuck Lever
     
  • gss_mech_get() is no longer used outside of gss_mech_switch.c.

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

    Chuck Lever
     
  • Clean up. This matches a similar API for the client side, and
    keeps ULP fingers out the of the GSS mech switch.

    Signed-off-by: Chuck Lever
    Acked-by: J. Bruce Fields
    Signed-off-by: Trond Myklebust

    Chuck Lever
     
  • The NFSv4 SECINFO operation returns a list of security flavors that
    the server supports for a particular share. An NFSv4 client is
    supposed to pick a pseudoflavor it supports that corresponds to one
    of the flavors returned by the server.

    GSS flavors in this list have a GSS tuple that identify a specific
    GSS pseudoflavor.

    Currently our client ignores the GSS tuple's "qop" value. A
    matching pseudoflavor is chosen based only on the OID and service
    value.

    So far this omission has not had much effect on Linux. The NFSv4
    protocol currently supports only one qop value: GSS_C_QOP_DEFAULT,
    also known as zero.

    However, if an NFSv4 server happens to return something other than
    zero in the qop field, our client won't notice. This could cause
    the client to behave in incorrect ways that could have security
    implications.

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

    Chuck Lever
     
  • The current GSS mech switch can find and load GSS pseudoflavor
    modules by name ("krb5") or pseudoflavor number ("390003"), but
    cannot find GSS modules by GSS tuple:

    [ "1.2.840.113554.1.2.2", GSS_C_QOP_DEFAULT, RPC_GSS_SVC_NONE ]

    This is important when dealing with a SECINFO request. A SECINFO
    reply contains a list of flavors the server supports for the
    requested export, but GSS flavors also have a GSS tuple that maps
    to a pseudoflavor (like 390003 for krb5).

    If the GSS module that supports the OID in the tuple is not loaded,
    our client is not able to load that module dynamically to support
    that pseudoflavor.

    Add a way for the GSS mech switch to load GSS pseudoflavor support
    by OID before searching for the pseudoflavor that matches the OID
    and service.

    Signed-off-by: Chuck Lever
    Cc: David Howells
    Signed-off-by: Trond Myklebust

    Chuck Lever
     
  • A SECINFO reply may contain flavors whose kernel module is not
    yet loaded by the client's kernel. A new RPC client API, called
    rpcauth_get_pseudoflavor(), is introduced to do proper checking
    for support of a security flavor.

    When this API is invoked, the RPC client now tries to load the
    module for each flavor first before performing the "is this
    supported?" check. This means if a module is available on the
    client, but has not been loaded yet, it will be loaded and
    registered automatically when the SECINFO reply is processed.

    The new API can take a full GSS tuple (OID, QoP, and service).
    Previously only the OID and service were considered.

    nfs_find_best_sec() is updated to verify all flavors requested in a
    SECINFO reply, including AUTH_NULL and AUTH_UNIX. Previously these
    two flavors were simply assumed to be supported without consulting
    the RPC client.

    Note that the replaced version of nfs_find_best_sec() can return
    RPC_AUTH_MAXFLAVOR if the server returns a recognized OID but an
    unsupported "service" value. nfs_find_best_sec() now returns
    RPC_AUTH_UNIX in this case.

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

    Chuck Lever
     
  • The NFSv4 SECINFO procedure returns a list of security flavors. Any
    GSS flavor also has a GSS tuple containing an OID, a quality-of-
    protection value, and a service value, which specifies a particular
    GSS pseudoflavor.

    For simplicity and efficiency, I'd like to return each GSS tuple
    from the NFSv4 SECINFO XDR decoder and pass it straight into the RPC
    client.

    Define a data structure that is visible to both the NFS client and
    the RPC client. Take structure and field names from the relevant
    standards to avoid confusion.

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

    Chuck Lever
     
  • Commit f344f6df "SUNRPC: Auto-load RPC authentication kernel
    modules", Mon Mar 20 13:44:08 2006, adds a request_module() call
    in rpcauth_create() to auto-load RPC security modules when a ULP
    tries to create a credential of that flavor.

    In rpcauth_create(), the name of the module to load is built like
    this:

    request_module("rpc-auth-%u", flavor);

    This means that for, say, RPC_AUTH_GSS, request_module() is looking
    for a module or alias called "rpc-auth-6".

    The GSS module is named "auth_rpcgss", and commit f344f6df does not
    add any new module aliases. There is also no such alias provided in
    /etc/modprobe.d on my system (Fedora 16). Without this alias, the
    GSS module is not loaded on demand.

    This is used by rpcauth_create(). The pseudoflavor_to_flavor() call
    can return RPC_AUTH_GSS, which is passed to request_module().

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

    Chuck Lever