1. 14 2月, 2019 5 次提交
  2. 16 1月, 2019 2 次提交
  3. 03 1月, 2019 1 次提交
  4. 20 12月, 2018 4 次提交
    • N
      NFS/NFSD/SUNRPC: replace generic creds with 'struct cred'. · a52458b4
      NeilBrown 提交于
      SUNRPC has two sorts of credentials, both of which appear as
      "struct rpc_cred".
      There are "generic credentials" which are supplied by clients
      such as NFS and passed in 'struct rpc_message' to indicate
      which user should be used to authorize the request, and there
      are low-level credentials such as AUTH_NULL, AUTH_UNIX, AUTH_GSS
      which describe the credential to be sent over the wires.
      
      This patch replaces all the generic credentials by 'struct cred'
      pointers - the credential structure used throughout Linux.
      
      For machine credentials, there is a special 'struct cred *' pointer
      which is statically allocated and recognized where needed as
      having a special meaning.  A look-up of a low-level cred will
      map this to a machine credential.
      Signed-off-by: NNeilBrown <neilb@suse.com>
      Acked-by: NJ. Bruce Fields <bfields@redhat.com>
      Signed-off-by: NAnna Schumaker <Anna.Schumaker@Netapp.com>
      a52458b4
    • N
      SUNRPC: add side channel to use non-generic cred for rpc call. · 1de7eea9
      NeilBrown 提交于
      The credential passed in rpc_message.rpc_cred is always a
      generic credential except in one instance.
      When gss_destroying_context() calls rpc_call_null(), it passes
      a specific credential that it needs to destroy.
      In this case the RPC acts *on* the credential rather than
      being authorized by it.
      
      This special case deserves explicit support and providing that will
      mean that rpc_message.rpc_cred is *always* generic, allowing
      some optimizations.
      
      So add "tk_op_cred" to rpc_task and "rpc_op_cred" to the setup data.
      Use this to pass the cred down from rpc_call_null(), and have
      rpcauth_bindcred() notice it and bind it in place.
      
      Credit to kernel test robot <fengguang.wu@intel.com> for finding
      a bug in earlier version of this patch.
      Signed-off-by: NNeilBrown <neilb@suse.com>
      Signed-off-by: NAnna Schumaker <Anna.Schumaker@Netapp.com>
      1de7eea9
    • N
      SUNRPC: introduce RPC_TASK_NULLCREDS to request auth_none · a68a72e1
      NeilBrown 提交于
      In almost all cases the credential stored in rpc_message.rpc_cred
      is a "generic" credential.  One of the two expections is when an
      AUTH_NULL credential is used such as for RPC ping requests.
      
      To improve consistency, don't pass an explicit credential in
      these cases, but instead pass NULL and set a task flag,
      similar to RPC_TASK_ROOTCREDS, which requests that NULL credentials
      be used by default.
      Signed-off-by: NNeilBrown <neilb@suse.com>
      Signed-off-by: NAnna Schumaker <Anna.Schumaker@Netapp.com>
      a68a72e1
    • N
      NFS/SUNRPC: don't lookup machine credential until rpcauth_bindcred(). · 5e16923b
      NeilBrown 提交于
      When NFS creates a machine credential, it is a "generic" credential,
      not tied to any auth protocol, and is really just a container for
      the princpal name.
      This doesn't get linked to a genuine credential until rpcauth_bindcred()
      is called.
      The lookup always succeeds, so various places that test if the machine
      credential is NULL, are pointless.
      
      As a step towards getting rid of generic credentials, this patch gets
      rid of generic machine credentials.  The nfs_client and rpc_client
      just hold a pointer to a constant principal name.
      When a machine credential is wanted, a special static 'struct rpc_cred'
      pointer is used. rpcauth_bindcred() recognizes this, finds the
      principal from the client, and binds the correct credential.
      Signed-off-by: NNeilBrown <neilb@suse.com>
      Signed-off-by: NAnna Schumaker <Anna.Schumaker@Netapp.com>
      5e16923b
  5. 19 12月, 2018 1 次提交
  6. 02 12月, 2018 2 次提交
  7. 01 10月, 2018 16 次提交
  8. 01 8月, 2018 2 次提交
  9. 07 5月, 2018 1 次提交
  10. 11 4月, 2018 2 次提交
  11. 13 2月, 2018 1 次提交
    • D
      net: make getname() functions return length rather than use int* parameter · 9b2c45d4
      Denys Vlasenko 提交于
      Changes since v1:
      Added changes in these files:
          drivers/infiniband/hw/usnic/usnic_transport.c
          drivers/staging/lustre/lnet/lnet/lib-socket.c
          drivers/target/iscsi/iscsi_target_login.c
          drivers/vhost/net.c
          fs/dlm/lowcomms.c
          fs/ocfs2/cluster/tcp.c
          security/tomoyo/network.c
      
      Before:
      All these functions either return a negative error indicator,
      or store length of sockaddr into "int *socklen" parameter
      and return zero on success.
      
      "int *socklen" parameter is awkward. For example, if caller does not
      care, it still needs to provide on-stack storage for the value
      it does not need.
      
      None of the many FOO_getname() functions of various protocols
      ever used old value of *socklen. They always just overwrite it.
      
      This change drops this parameter, and makes all these functions, on success,
      return length of sockaddr. It's always >= 0 and can be differentiated
      from an error.
      
      Tests in callers are changed from "if (err)" to "if (err < 0)", where needed.
      
      rpc_sockname() lost "int buflen" parameter, since its only use was
      to be passed to kernel_getsockname() as &buflen and subsequently
      not used in any way.
      
      Userspace API is not changed.
      
          text    data     bss      dec     hex filename
      30108430 2633624  873672 33615726 200ef6e vmlinux.before.o
      30108109 2633612  873672 33615393 200ee21 vmlinux.o
      Signed-off-by: NDenys Vlasenko <dvlasenk@redhat.com>
      CC: David S. Miller <davem@davemloft.net>
      CC: linux-kernel@vger.kernel.org
      CC: netdev@vger.kernel.org
      CC: linux-bluetooth@vger.kernel.org
      CC: linux-decnet-user@lists.sourceforge.net
      CC: linux-wireless@vger.kernel.org
      CC: linux-rdma@vger.kernel.org
      CC: linux-sctp@vger.kernel.org
      CC: linux-nfs@vger.kernel.org
      CC: linux-x25@vger.kernel.org
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      9b2c45d4
  12. 15 1月, 2018 1 次提交
  13. 01 12月, 2017 1 次提交
  14. 18 11月, 2017 1 次提交