1. 13 7月, 2014 1 次提交
  2. 18 4月, 2014 1 次提交
  3. 17 2月, 2014 2 次提交
  4. 11 2月, 2014 1 次提交
  5. 28 1月, 2014 1 次提交
    • J
      sunrpc: turn warn_gssd() log message into a dprintk() · 0ea9de0e
      Jeff Layton 提交于
      The original printk() made sense when the GSSAPI codepaths were called
      only when sec=krb5* was explicitly requested. Now however, in many cases
      the nfs client will try to acquire GSSAPI credentials by default, even
      when it's not requested.
      
      Since we don't have a great mechanism to distinguish between the two
      cases, just turn the pr_warn into a dprintk instead. With this change we
      can also get rid of the ratelimiting.
      
      We do need to keep the EXPORT_SYMBOL(gssd_running) in place since
      auth_gss.ko needs it and sunrpc.ko provides it. We can however,
      eliminate the gssd_running call in the nfs code since that's a bit of a
      layering violation.
      Signed-off-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NTrond Myklebust <trond.myklebust@primarydata.com>
      0ea9de0e
  6. 07 12月, 2013 1 次提交
  7. 27 11月, 2013 1 次提交
  8. 29 10月, 2013 2 次提交
  9. 18 9月, 2013 1 次提交
    • J
      RPCSEC_GSS: fix crash on destroying gss auth · a0f6ed8e
      J. Bruce Fields 提交于
      This fixes a regression since  eb6dc19d
      "RPCSEC_GSS: Share all credential caches on a per-transport basis" which
      could cause an occasional oops in the nfsd code (see below).
      
      The problem was that an auth was left referencing a client that had been
      freed.  To avoid this we need to ensure that auths are shared only
      between descendants of a common client; the fact that a clone of an
      rpc_client takes a reference on its parent then ensures that the parent
      client will last as long as the auth.
      
      Also add a comment explaining what I think was the intention of this
      code.
      
        general protection fault: 0000 [#1] PREEMPT SMP
        Modules linked in: rpcsec_gss_krb5 nfsd auth_rpcgss oid_registry nfs_acl lockd sunrpc
        CPU: 3 PID: 4071 Comm: kworker/u8:2 Not tainted 3.11.0-rc2-00182-g025145f #1665
        Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011
        Workqueue: nfsd4_callbacks nfsd4_do_callback_rpc [nfsd]
        task: ffff88003e206080 ti: ffff88003c384000 task.ti: ffff88003c384000
        RIP: 0010:[<ffffffffa00001f3>]  [<ffffffffa00001f3>] rpc_net_ns+0x53/0x70 [sunrpc]
        RSP: 0000:ffff88003c385ab8  EFLAGS: 00010246
        RAX: 6b6b6b6b6b6b6b6b RBX: ffff88003af9a800 RCX: 0000000000000002
        RDX: ffffffffa00001a5 RSI: 0000000000000001 RDI: ffffffff81e284e0
        RBP: ffff88003c385ad8 R08: 0000000000000001 R09: 0000000000000000
        R10: 0000000000000000 R11: 0000000000000015 R12: ffff88003c990840
        R13: ffff88003c990878 R14: ffff88003c385ba8 R15: ffff88003e206080
        FS:  0000000000000000(0000) GS:ffff88003fd80000(0000) knlGS:0000000000000000
        CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
        CR2: 00007fcdf737e000 CR3: 000000003ad2b000 CR4: 00000000000006e0
        Stack:
         ffffffffa00001a5 0000000000000006 0000000000000006 ffff88003af9a800
         ffff88003c385b08 ffffffffa00d52a4 ffff88003c385ba8 ffff88003c751bd8
         ffff88003c751bc0 ffff88003e113600 ffff88003c385b18 ffffffffa00d530c
        Call Trace:
         [<ffffffffa00001a5>] ? rpc_net_ns+0x5/0x70 [sunrpc]
         [<ffffffffa00d52a4>] __gss_pipe_release+0x54/0x90 [auth_rpcgss]
         [<ffffffffa00d530c>] gss_pipe_free+0x2c/0x30 [auth_rpcgss]
         [<ffffffffa00d678b>] gss_destroy+0x9b/0xf0 [auth_rpcgss]
         [<ffffffffa000de63>] rpcauth_release+0x23/0x30 [sunrpc]
         [<ffffffffa0001e81>] rpc_release_client+0x51/0xb0 [sunrpc]
         [<ffffffffa00020d5>] rpc_shutdown_client+0xe5/0x170 [sunrpc]
         [<ffffffff81098a14>] ? cpuacct_charge+0xa4/0xb0
         [<ffffffff81098975>] ? cpuacct_charge+0x5/0xb0
         [<ffffffffa019556f>] nfsd4_process_cb_update.isra.17+0x2f/0x210 [nfsd]
         [<ffffffff819a4ac0>] ? _raw_spin_unlock_irq+0x30/0x60
         [<ffffffff819a4acb>] ? _raw_spin_unlock_irq+0x3b/0x60
         [<ffffffff810703ab>] ? process_one_work+0x15b/0x510
         [<ffffffffa01957dd>] nfsd4_do_callback_rpc+0x8d/0xa0 [nfsd]
         [<ffffffff8107041e>] process_one_work+0x1ce/0x510
         [<ffffffff810703ab>] ? process_one_work+0x15b/0x510
         [<ffffffff810712ab>] worker_thread+0x11b/0x370
         [<ffffffff81071190>] ? manage_workers.isra.24+0x2b0/0x2b0
         [<ffffffff8107854b>] kthread+0xdb/0xe0
         [<ffffffff819a4ac0>] ? _raw_spin_unlock_irq+0x30/0x60
         [<ffffffff81078470>] ? __init_kthread_worker+0x70/0x70
         [<ffffffff819ac7dc>] ret_from_fork+0x7c/0xb0
         [<ffffffff81078470>] ? __init_kthread_worker+0x70/0x70
        Code: a5 01 00 a0 31 d2 31 f6 48 c7 c7 e0 84 e2 81 e8 f4 91 0a e1 48 8b 43 60 48 c7 c2 a5 01 00 a0 be 01 00 00 00 48 c7 c7 e0 84 e2 81 <48> 8b 98 10 07 00 00 e8 91 8f 0a e1 e8
        +3c 4e 07 e1 48 83 c4 18
        RIP  [<ffffffffa00001f3>] rpc_net_ns+0x53/0x70 [sunrpc]
         RSP <ffff88003c385ab8>
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      a0f6ed8e
  10. 12 9月, 2013 1 次提交
  11. 04 9月, 2013 2 次提交
    • A
      SUNRPC refactor rpcauth_checkverf error returns · 35fa5f7b
      Andy Adamson 提交于
      Most of the time an error from the credops crvalidate function means the
      server has sent us a garbage verifier. The gss_validate function is the
      exception where there is an -EACCES case if the user GSS_context on the client
      has expired.
      Signed-off-by: NAndy Adamson <andros@netapp.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      35fa5f7b
    • A
      SUNRPC new rpc_credops to test credential expiry · 4de6caa2
      Andy Adamson 提交于
      This patch provides the RPC layer helper functions to allow NFS to manage
      data in the face of expired credentials - such as avoiding buffered WRITEs
      and COMMITs when the gss context will expire before the WRITEs are flushed
      and COMMITs are sent.
      
      These helper functions enable checking the expiration of an underlying
      credential key for a generic rpc credential, e.g. the gss_cred gss context
      gc_expiry which for Kerberos is set to the remaining TGT lifetime.
      
      A new rpc_authops key_timeout is only defined for the generic auth.
      A new rpc_credops crkey_to_expire is only defined for the generic cred.
      A new rpc_credops crkey_timeout is only defined for the gss cred.
      
      Set a credential key expiry watermark, RPC_KEY_EXPIRE_TIMEO set to 240 seconds
      as a default and can be set via a module parameter as we need to ensure there
      is time for any dirty data to be flushed.
      
      If key_timeout is called on a credential with an underlying credential key that
      will expire within watermark seconds, we set the RPC_CRED_KEY_EXPIRE_SOON
      flag in the generic_cred acred so that the NFS layer can clean up prior to
      key expiration.
      
      Checking a generic credential's underlying credential involves a cred lookup.
      To avoid this lookup in the normal case when the underlying credential has
      a key that is valid (before the watermark), a notify flag is set in
      the generic credential the first time the key_timeout is called. The
      generic credential then stops checking the underlying credential key expiry, and
      the underlying credential (gss_cred) match routine then checks the key
      expiration upon each normal use and sets a flag in the associated generic
      credential only when the key expiration is within the watermark.
      This in turn signals the generic credential key_timeout to perform the extra
      credential lookup thereafter.
      Signed-off-by: NAndy Adamson <andros@netapp.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      4de6caa2
  12. 03 9月, 2013 1 次提交
  13. 01 9月, 2013 2 次提交
  14. 30 8月, 2013 4 次提交
  15. 16 5月, 2013 3 次提交
  16. 04 5月, 2013 1 次提交
  17. 26 4月, 2013 1 次提交
  18. 30 3月, 2013 3 次提交
    • C
      SUNRPC: Refactor nfsd4_do_encode_secinfo() · a77c806f
      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: NChuck Lever <chuck.lever@oracle.com>
      Acked-by: NJ. Bruce Fields <bfields@redhat.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      a77c806f
    • C
      SUNRPC: Introduce rpcauth_get_pseudoflavor() · 9568c5e9
      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: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      9568c5e9
    • C
      SUNRPC: Missing module alias for auth_rpcgss.ko · 71afa85e
      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: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      71afa85e
  19. 23 2月, 2013 1 次提交
  20. 18 2月, 2013 1 次提交
    • J
      sunrpc: silence build warning in gss_fill_context · 173db309
      Jeff Layton 提交于
      Since commit 620038f6, gcc is throwing the following warning:
      
        CC [M]  net/sunrpc/auth_gss/auth_gss.o
      In file included from include/linux/sunrpc/types.h:14:0,
                       from include/linux/sunrpc/sched.h:14,
                       from include/linux/sunrpc/clnt.h:18,
                       from net/sunrpc/auth_gss/auth_gss.c:45:
      net/sunrpc/auth_gss/auth_gss.c: In function ‘gss_pipe_downcall’:
      include/linux/sunrpc/debug.h:45:10: warning: ‘timeout’ may be used
      uninitialized in this function [-Wmaybe-uninitialized]
          printk(KERN_DEFAULT args); \
                ^
      net/sunrpc/auth_gss/auth_gss.c:194:15: note: ‘timeout’ was declared here
        unsigned int timeout;
                     ^
      If simple_get_bytes returns an error, then we'll end up calling printk
      with an uninitialized timeout value. Reasonably harmless, but fairly
      simple to fix by removing the printout of the uninitialised parameters.
      
      Cc: Andy Adamson <andros@netapp.com>
      Signed-off-by: NJeff Layton <jlayton@redhat.com>
      [Trond: just remove the parameters rather than initialising timeout]
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      173db309
  21. 13 2月, 2013 4 次提交
  22. 01 2月, 2013 1 次提交
  23. 13 12月, 2012 1 次提交
  24. 02 10月, 2012 1 次提交
  25. 17 7月, 2012 1 次提交
    • C
      SUNRPC: Add rpcauth_list_flavors() · 6a1a1e34
      Chuck Lever 提交于
      The gss_mech_list_pseudoflavors() function provides a list of
      currently registered GSS pseudoflavors.  This list does not include
      any non-GSS flavors that have been registered with the RPC client.
      nfs4_find_root_sec() currently adds these extra flavors by hand.
      
      Instead, nfs4_find_root_sec() should be looking at the set of flavors
      that have been explicitly registered via rpcauth_register().  And,
      other areas of code will soon need the same kind of list that
      contains all flavors the kernel currently knows about (see below).
      
      Rather than cloning the open-coded logic in nfs4_find_root_sec() to
      those new places, introduce a generic RPC function that generates a
      full list of registered auth flavors and pseudoflavors.
      
      A new rpc_authops method is added that lists a flavor's
      pseudoflavors, if it has any.  I encountered an interesting module
      loader loop when I tried to get the RPC client to invoke
      gss_mech_list_pseudoflavors() by name.
      
      This patch is a pre-requisite for server trunking discovery, and a
      pre-requisite for fixing up the in-kernel mount client to do better
      automatic security flavor selection.
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      6a1a1e34
  26. 03 3月, 2012 1 次提交