From owner-cvs-src-old@FreeBSD.ORG Mon Nov 3 10:40:58 2008 Return-Path: Delivered-To: cvs-src-old@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 90AD510656BB for ; Mon, 3 Nov 2008 10:40:58 +0000 (UTC) (envelope-from dfr@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 7A1248FC1B for ; Mon, 3 Nov 2008 10:40:58 +0000 (UTC) (envelope-from dfr@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id mA3Aewio046933 for ; Mon, 3 Nov 2008 10:40:58 GMT (envelope-from dfr@repoman.freebsd.org) Received: (from svn2cvs@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id mA3Aeup4046931 for cvs-src-old@freebsd.org; Mon, 3 Nov 2008 10:40:56 GMT (envelope-from dfr@repoman.freebsd.org) Message-Id: <200811031040.mA3Aeup4046931@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: svn2cvs set sender to dfr@repoman.freebsd.org using -f From: Doug Rabson Date: Mon, 3 Nov 2008 10:38:00 +0000 (UTC) To: cvs-src-old@freebsd.org X-FreeBSD-CVS-Branch: HEAD Subject: cvs commit: src/etc/gss mech src/etc/rc.d Makefile gssd nfsd src/include/rpc xdr.h src/lib/libc/sys Symbol.map src/lib/libc/xdr Symbol.map xdr.c src/lib/librpcsec_gss svc_rpcsec_gss.c src/sbin/mount_nfs mount_nfs.c src/sys/compat/freebsd32 ... X-BeenThere: cvs-src-old@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: **OBSOLETE** CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Nov 2008 10:40:58 -0000 dfr 2008-11-03 10:38:00 UTC FreeBSD src repository Modified files: etc/gss mech etc/rc.d Makefile nfsd include/rpc xdr.h lib/libc/sys Symbol.map lib/libc/xdr Symbol.map xdr.c lib/librpcsec_gss svc_rpcsec_gss.c sbin/mount_nfs mount_nfs.c sys/compat/freebsd32 syscalls.master sys/conf files options sys/fs/unionfs union_vfsops.c sys/kern syscalls.master vfs_export.c vfs_mount.c sys/modules/nfsclient Makefile sys/modules/nfsserver Makefile sys/nfsclient nfs.h nfs_socket.c nfs_subs.c nfs_vfsops.c nfsmount.h sys/nfsserver nfs.h nfs_serv.c nfs_srvcache.c nfs_srvsock.c nfs_srvsubs.c nfs_syscalls.c nfsm_subs.h nfsrvcache.h sys/nlm nlm.h nlm_advlock.c nlm_prot_impl.c nlm_prot_svc.c sys/rpc auth.h auth_none.c auth_unix.c clnt.h clnt_dg.c clnt_rc.c clnt_vc.c rpc_com.h rpc_generic.c rpc_msg.h rpc_prot.c svc.c svc.h svc_auth.c svc_auth.h svc_auth_unix.c svc_dg.c svc_generic.c svc_vc.c xdr.h sys/sys mount.h sys/xdr xdr_mbuf.c usr.sbin Makefile usr.sbin/mountd exports.5 mountd.c usr.sbin/nfsd nfsd.c Added files: etc/rc.d gssd sys/kgssapi gss_accept_sec_context.c gss_acquire_cred.c gss_add_oid_set_member.c gss_canonicalize_name.c gss_create_empty_oid_set.c gss_delete_sec_context.c gss_display_status.c gss_export_name.c gss_get_mic.c gss_impl.c gss_import_name.c gss_init_sec_context.c gss_names.c gss_pname_to_uid.c gss_release_buffer.c gss_release_cred.c gss_release_name.c gss_release_oid_set.c gss_set_cred_option.c gss_test_oid_set_member.c gss_unwrap.c gss_verify_mic.c gss_wrap.c gss_wrap_size_limit.c gssapi.h gssapi_impl.h gssd.x gssd_prot.c gsstest.c kgss_if.m sys/kgssapi/krb5 kcrypto.c kcrypto.h kcrypto_aes.c kcrypto_arcfour.c kcrypto_des.c kcrypto_des3.c krb5_mech.c sys/modules/kgssapi Makefile sys/modules/kgssapi_krb5 Makefile sys/nfsclient nfs_krpc.c sys/nfsserver nfs_fha.c nfs_fha.h nfs_srvkrpc.c sys/rpc replay.c replay.h rpcsec_gss.h sys/rpc/rpcsec_gss rpcsec_gss.c rpcsec_gss_conf.c rpcsec_gss_int.h rpcsec_gss_misc.c rpcsec_gss_prot.c svc_rpcsec_gss.c tools/regression/kgssapi Makefile gsstest.c tools/regression/rpcsec_gss Makefile rpctest.c usr.sbin/gssd Makefile gssd.8 gssd.c Log: SVN rev 184588 on 2008-11-03 10:38:00Z by dfr Implement support for RPCSEC_GSS authentication to both the NFS client and server. This replaces the RPC implementation of the NFS client and server with the newer RPC implementation originally developed (actually ported from the userland sunrpc code) to support the NFS Lock Manager. I have tested this code extensively and I believe it is stable and that performance is at least equal to the legacy RPC implementation. The NFS code currently contains support for both the new RPC implementation and the older legacy implementation inherited from the original NFS codebase. The default is to use the new implementation - add the NFS_LEGACYRPC option to fall back to the old code. When I merge this support back to RELENG_7, I will probably change this so that users have to 'opt in' to get the new code. To use RPCSEC_GSS on either client or server, you must build a kernel which includes the KGSSAPI option and the crypto device. On the userland side, you must build at least a new libc, mountd, mount_nfs and gssd. You must install new versions of /etc/rc.d/gssd and /etc/rc.d/nfsd and add 'gssd_enable=YES' to /etc/rc.conf. As long as gssd is running, you should be able to mount an NFS filesystem from a server that requires RPCSEC_GSS authentication. The mount itself can happen without any kerberos credentials but all access to the filesystem will be denied unless the accessing user has a valid ticket file in the standard place (/tmp/krb5cc_). There is currently no support for situations where the ticket file is in a different place, such as when the user logged in via SSH and has delegated credentials from that login. This restriction is also present in Solaris and Linux. In theory, we could improve this in future, possibly using Brooks Davis' implementation of variant symlinks. Supporting RPCSEC_GSS on a server is nearly as simple. You must create service creds for the server in the form 'nfs/@' and install them in /etc/krb5.keytab. The standard heimdal utility ktutil makes this fairly easy. After the service creds have been created, you can add a '-sec=krb5' option to /etc/exports and restart both mountd and nfsd. The only other difference an administrator should notice is that nfsd doesn't fork to create service threads any more. In normal operation, there will be two nfsd processes, one in userland waiting for TCP connections and one in the kernel handling requests. The latter process will create as many kthreads as required - these should be visible via 'top -H'. The code has some support for varying the number of service threads according to load but initially at least, nfsd uses a fixed number of threads according to the value supplied to its '-n' option. Sponsored by: Isilon Systems MFC after: 1 month Revision Changes Path 1.4 +1 -1 src/etc/gss/mech 1.95 +1 -1 src/etc/rc.d/Makefile 1.1 +18 -0 src/etc/rc.d/gssd (new) 1.16 +1 -1 src/etc/rc.d/nfsd 1.24 +3 -0 src/include/rpc/xdr.h 1.19 +1 -0 src/lib/libc/sys/Symbol.map 1.3 +6 -0 src/lib/libc/xdr/Symbol.map 1.15 +92 -0 src/lib/libc/xdr/xdr.c 1.4 +31 -12 src/lib/librpcsec_gss/svc_rpcsec_gss.c 1.81 +53 -1 src/sbin/mount_nfs/mount_nfs.c 1.110 +2 -0 src/sys/compat/freebsd32/syscalls.master 1.1347 +91 -32 src/sys/conf/files 1.646 +9 -0 src/sys/conf/options 1.93 +1 -1 src/sys/fs/unionfs/union_vfsops.c 1.248 +2 -0 src/sys/kern/syscalls.master 1.345 +17 -1 src/sys/kern/vfs_export.c 1.295 +14 -0 src/sys/kern/vfs_mount.c 1.1 +138 -0 src/sys/kgssapi/gss_accept_sec_context.c (new) 1.1 +105 -0 src/sys/kgssapi/gss_acquire_cred.c (new) 1.1 +76 -0 src/sys/kgssapi/gss_add_oid_set_member.c (new) 1.1 +76 -0 src/sys/kgssapi/gss_canonicalize_name.c (new) 1.1 +55 -0 src/sys/kgssapi/gss_create_empty_oid_set.c (new) 1.1 +91 -0 src/sys/kgssapi/gss_delete_sec_context.c (new) 1.1 +79 -0 src/sys/kgssapi/gss_display_status.c (new) 1.1 +71 -0 src/sys/kgssapi/gss_export_name.c (new) 1.1 +89 -0 src/sys/kgssapi/gss_get_mic.c (new) 1.1 +266 -0 src/sys/kgssapi/gss_impl.c (new) 1.1 +79 -0 src/sys/kgssapi/gss_import_name.c (new) 1.1 +135 -0 src/sys/kgssapi/gss_init_sec_context.c (new) 1.1 +176 -0 src/sys/kgssapi/gss_names.c (new) 1.1 +122 -0 src/sys/kgssapi/gss_pname_to_uid.c (new) 1.1 +52 -0 src/sys/kgssapi/gss_release_buffer.c (new) 1.1 +69 -0 src/sys/kgssapi/gss_release_cred.c (new) 1.1 +74 -0 src/sys/kgssapi/gss_release_name.c (new) 1.1 +52 -0 src/sys/kgssapi/gss_release_oid_set.c (new) 1.1 +77 -0 src/sys/kgssapi/gss_set_cred_option.c (new) 1.1 +54 -0 src/sys/kgssapi/gss_test_oid_set_member.c (new) 1.1 +97 -0 src/sys/kgssapi/gss_unwrap.c (new) 1.1 +87 -0 src/sys/kgssapi/gss_verify_mic.c (new) 1.1 +96 -0 src/sys/kgssapi/gss_wrap.c (new) 1.1 +56 -0 src/sys/kgssapi/gss_wrap_size_limit.c (new) 1.1 +620 -0 src/sys/kgssapi/gssapi.h (new) 1.1 +67 -0 src/sys/kgssapi/gssapi_impl.h (new) 1.1 +265 -0 src/sys/kgssapi/gssd.x (new) 1.1 +244 -0 src/sys/kgssapi/gssd_prot.c (new) 1.1 +1141 -0 src/sys/kgssapi/gsstest.c (new) 1.1 +95 -0 src/sys/kgssapi/kgss_if.m (new) 1.1 +266 -0 src/sys/kgssapi/krb5/kcrypto.c (new) 1.1 +154 -0 src/sys/kgssapi/krb5/kcrypto.h (new) 1.1 +384 -0 src/sys/kgssapi/krb5/kcrypto_aes.c (new) 1.1 +220 -0 src/sys/kgssapi/krb5/kcrypto_arcfour.c (new) 1.1 +262 -0 src/sys/kgssapi/krb5/kcrypto_des.c (new) 1.1 +402 -0 src/sys/kgssapi/krb5/kcrypto_des3.c (new) 1.1 +2100 -0 src/sys/kgssapi/krb5/krb5_mech.c (new) 1.1 +55 -0 src/sys/modules/kgssapi/Makefile (new) 1.1 +21 -0 src/sys/modules/kgssapi_krb5/Makefile (new) 1.34 +2 -2 src/sys/modules/nfsclient/Makefile 1.27 +2 -2 src/sys/modules/nfsserver/Makefile 1.101 +21 -4 src/sys/nfsclient/nfs.h 1.1 +769 -0 src/sys/nfsclient/nfs_krpc.c (new) 1.164 +4 -0 src/sys/nfsclient/nfs_socket.c 1.158 +7 -1 src/sys/nfsclient/nfs_subs.c 1.219 +58 -3 src/sys/nfsclient/nfs_vfsops.c 1.35 +34 -0 src/sys/nfsclient/nfsmount.h 1.85 +68 -22 src/sys/nfsserver/nfs.h 1.1 +597 -0 src/sys/nfsserver/nfs_fha.c (new) 1.1 +28 -0 src/sys/nfsserver/nfs_fha.h (new) 1.190 +39 -28 src/sys/nfsserver/nfs_serv.c 1.47 +4 -0 src/sys/nfsserver/nfs_srvcache.c 1.1 +565 -0 src/sys/nfsserver/nfs_srvkrpc.c (new) 1.112 +5 -0 src/sys/nfsserver/nfs_srvsock.c 1.157 +55 -10 src/sys/nfsserver/nfs_srvsubs.c 1.123 +6 -2 src/sys/nfsserver/nfs_syscalls.c 1.40 +2 -3 src/sys/nfsserver/nfsm_subs.h 1.20 +4 -0 src/sys/nfsserver/nfsrvcache.h 1.3 +1 -1 src/sys/nlm/nlm.h 1.3 +5 -4 src/sys/nlm/nlm_advlock.c 1.15 +71 -45 src/sys/nlm/nlm_prot_impl.c 1.3 +44 -28 src/sys/nlm/nlm_prot_svc.c 1.2 +26 -21 src/sys/rpc/auth.h 1.2 +14 -6 src/sys/rpc/auth_none.c 1.6 +23 -11 src/sys/rpc/auth_unix.c 1.3 +51 -19 src/sys/rpc/clnt.h 1.4 +240 -68 src/sys/rpc/clnt_dg.c 1.6 +106 -20 src/sys/rpc/clnt_rc.c 1.4 +169 -68 src/sys/rpc/clnt_vc.c 1.1 +248 -0 src/sys/rpc/replay.c (new) 1.1 +85 -0 src/sys/rpc/replay.h (new) 1.2 +1 -0 src/sys/rpc/rpc_com.h 1.4 +134 -0 src/sys/rpc/rpc_generic.c 1.2 +1 -1 src/sys/rpc/rpc_msg.h 1.2 +53 -28 src/sys/rpc/rpc_prot.c 1.1 +189 -0 src/sys/rpc/rpcsec_gss.h (new) 1.1 +1064 -0 src/sys/rpc/rpcsec_gss/rpcsec_gss.c (new) 1.1 +163 -0 src/sys/rpc/rpcsec_gss/rpcsec_gss_conf.c (new) 1.1 +94 -0 src/sys/rpc/rpcsec_gss/rpcsec_gss_int.h (new) 1.1 +53 -0 src/sys/rpc/rpcsec_gss/rpcsec_gss_misc.c (new) 1.1 +359 -0 src/sys/rpc/rpcsec_gss/rpcsec_gss_prot.c (new) 1.1 +1485 -0 src/sys/rpc/rpcsec_gss/svc_rpcsec_gss.c (new) 1.3 +893 -153 src/sys/rpc/svc.c 1.2 +226 -18 src/sys/rpc/svc.h 1.2 +69 -6 src/sys/rpc/svc_auth.c 1.2 +18 -6 src/sys/rpc/svc_auth.h 1.3 +1 -2 src/sys/rpc/svc_auth_unix.c 1.3 +66 -91 src/sys/rpc/svc_dg.c 1.3 +2 -91 src/sys/rpc/svc_generic.c 1.4 +120 -127 src/sys/rpc/svc_vc.c 1.2 +2 -0 src/sys/rpc/xdr.h 1.236 +21 -3 src/sys/sys/mount.h 1.2 +65 -5 src/sys/xdr/xdr_mbuf.c 1.1 +9 -0 src/tools/regression/kgssapi/Makefile (new) 1.1 +307 -0 src/tools/regression/kgssapi/gsstest.c (new) 1.1 +9 -0 src/tools/regression/rpcsec_gss/Makefile (new) 1.1 +400 -0 src/tools/regression/rpcsec_gss/rpctest.c (new) 1.400 +5 -0 src/usr.sbin/Makefile 1.1 +29 -0 src/usr.sbin/gssd/Makefile (new) 1.1 +70 -0 src/usr.sbin/gssd/gssd.8 (new) 1.1 +610 -0 src/usr.sbin/gssd/gssd.c (new) 1.32 +22 -0 src/usr.sbin/mountd/exports.5 1.98 +86 -6 src/usr.sbin/mountd/mountd.c 1.35 +81 -34 src/usr.sbin/nfsd/nfsd.c