brintos

brintos / linux-shallow public Read only

0
0
Text · 3.6 KiB · 5c1a1c5 Raw
94 lines · plain
1=========================================2rpcsec_gss support for kernel RPC servers3=========================================4 5This document gives references to the standards and protocols used to6implement RPCGSS authentication in kernel RPC servers such as the NFS7server and the NFS client's NFSv4.0 callback server.  (But note that8NFSv4.1 and higher don't require the client to act as a server for the9purposes of authentication.)10 11RPCGSS is specified in a few IETF documents:12 13 - RFC2203 v1: https://tools.ietf.org/rfc/rfc2203.txt14 - RFC5403 v2: https://tools.ietf.org/rfc/rfc5403.txt15 16There is a third version that we don't currently implement:17 18 - RFC7861 v3: https://tools.ietf.org/rfc/rfc7861.txt19 20Background21==========22 23The RPCGSS Authentication method describes a way to perform GSSAPI24Authentication for NFS.  Although GSSAPI is itself completely mechanism25agnostic, in many cases only the KRB5 mechanism is supported by NFS26implementations.27 28The Linux kernel, at the moment, supports only the KRB5 mechanism, and29depends on GSSAPI extensions that are KRB5 specific.30 31GSSAPI is a complex library, and implementing it completely in kernel is32unwarranted. However GSSAPI operations are fundamentally separable in 233parts:34 35- initial context establishment36- integrity/privacy protection (signing and encrypting of individual37  packets)38 39The former is more complex and policy-independent, but less40performance-sensitive.  The latter is simpler and needs to be very fast.41 42Therefore, we perform per-packet integrity and privacy protection in the43kernel, but leave the initial context establishment to userspace.  We44need upcalls to request userspace to perform context establishment.45 46NFS Server Legacy Upcall Mechanism47==================================48 49The classic upcall mechanism uses a custom text based upcall mechanism50to talk to a custom daemon called rpc.svcgssd that is provide by the51nfs-utils package.52 53This upcall mechanism has 2 limitations:54 55A) It can handle tokens that are no bigger than 2KiB56 57In some Kerberos deployment GSSAPI tokens can be quite big, up and58beyond 64KiB in size due to various authorization extensions attacked to59the Kerberos tickets, that needs to be sent through the GSS layer in60order to perform context establishment.61 62B) It does not properly handle creds where the user is member of more63than a few thousand groups (the current hard limit in the kernel is 65K64groups) due to limitation on the size of the buffer that can be send65back to the kernel (4KiB).66 67NFS Server New RPC Upcall Mechanism68===================================69 70The newer upcall mechanism uses RPC over a unix socket to a daemon71called gss-proxy, implemented by a userspace program called Gssproxy.72 73The gss_proxy RPC protocol is currently documented `here74<https://fedorahosted.org/gss-proxy/wiki/ProtocolDocumentation>`_.75 76This upcall mechanism uses the kernel rpc client and connects to the gssproxy77userspace program over a regular unix socket. The gssproxy protocol does not78suffer from the size limitations of the legacy protocol.79 80Negotiating Upcall Mechanisms81=============================82 83To provide backward compatibility, the kernel defaults to using the84legacy mechanism.  To switch to the new mechanism, gss-proxy must bind85to /var/run/gssproxy.sock and then write "1" to86/proc/net/rpc/use-gss-proxy.  If gss-proxy dies, it must repeat both87steps.88 89Once the upcall mechanism is chosen, it cannot be changed.  To prevent90locking into the legacy mechanisms, the above steps must be performed91before starting nfsd.  Whoever starts nfsd can guarantee this by reading92from /proc/net/rpc/use-gss-proxy and checking that it contains a93"1"--the read will block until gss-proxy has done its write to the file.94