]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Add flags to enable NFS over TLS to the NFS client and server.
authorrmacklem <rmacklem@FreeBSD.org>
Thu, 27 Aug 2020 23:57:30 +0000 (23:57 +0000)
committerrmacklem <rmacklem@FreeBSD.org>
Thu, 27 Aug 2020 23:57:30 +0000 (23:57 +0000)
commit6990ab23ef8aa8b7d0fc7cfffd0013de594773e0
tree4e29cfd14c5950aac386359c00d4af864d40173c
parent1bc6309d0dd788efe939cd8a6eb4eb54b0d981e2
Add flags to enable NFS over TLS to the NFS client and server.

An Internet Draft titled "Towards Remote Procedure Call Encryption By Default"
(soon to be an RFC I think) describes how Sun RPC is to use TLS with NFS
as a specific application case.
Various commits prepared the NFS code to use KERN_TLS, mainly enabling use
of ext_pgs mbufs for large RPC messages.
r364475 added TLS support to the kernel RPC.

This commit (which is the final one for kernel changes required to do
NFS over TLS) adds support for three export flags:
MNT_EXTLS - Requires a TLS connection.
MNT_EXTLSCERT - Requires a TLS connection where the client presents a valid
            X.509 certificate during TLS handshake.
MNT_EXTLSCERTUSER - Requires a TLS connection where the client presents a
            valid X.509 certificate with "user@domain" in the otherName
            field of the SubjectAltName during TLS handshake.
Without these export options, clients are permitted, but not required, to
use TLS.

For the client, a new nmount(2) option called "tls" makes the client do
a STARTTLS Null RPC and TLS handshake for all TCP connections used for the
mount. The CLSET_TLS client control option is used to indicate to the kernel RPC
that this should be done.

Unless the above export flags or "tls" option is used, semantics should
not change for the NFS client nor server.

For NFS over TLS to work, the userspace daemons rpctlscd(8) { for client }
or rpctlssd(8) daemon { for server } must be running.
sys/fs/nfs/nfs_commonkrpc.c
sys/fs/nfs/nfsdport.h
sys/fs/nfs/nfsport.h
sys/fs/nfsclient/nfs_clkrpc.c
sys/fs/nfsclient/nfs_clvfsops.c
sys/fs/nfsclient/nfsmount.h
sys/fs/nfsserver/nfs_nfsdkrpc.c
sys/fs/nfsserver/nfs_nfsdport.c
sys/fs/nfsserver/nfs_nfsdserv.c
sys/fs/nfsserver/nfs_nfsdsubs.c