1 =========================================
2 rpcsec_gss support for kernel RPC servers
3 =========================================
5 This document gives references to the standards and protocols used to
6 implement RPCGSS authentication in kernel RPC servers such as the NFS
7 server and the NFS client's NFSv4.0 callback server. (But note that
8 NFSv4.1 and higher don't require the client to act as a server for the
9 purposes of authentication.)
11 RPCGSS is specified in a few IETF documents:
13 - RFC2203 v1: http://tools.ietf.org/rfc/rfc2203.txt
14 - RFC5403 v2: http://tools.ietf.org/rfc/rfc5403.txt
16 and there is a 3rd version being proposed:
18 - http://tools.ietf.org/id/draft-williams-rpcsecgssv3.txt
19 (At draft n. 02 at the time of writing)
24 The RPCGSS Authentication method describes a way to perform GSSAPI
25 Authentication for NFS. Although GSSAPI is itself completely mechanism
26 agnostic, in many cases only the KRB5 mechanism is supported by NFS
29 The Linux kernel, at the moment, supports only the KRB5 mechanism, and
30 depends on GSSAPI extensions that are KRB5 specific.
32 GSSAPI is a complex library, and implementing it completely in kernel is
33 unwarranted. However GSSAPI operations are fundementally separable in 2
36 - initial context establishment
37 - integrity/privacy protection (signing and encrypting of individual
40 The former is more complex and policy-independent, but less
41 performance-sensitive. The latter is simpler and needs to be very fast.
43 Therefore, we perform per-packet integrity and privacy protection in the
44 kernel, but leave the initial context establishment to userspace. We
45 need upcalls to request userspace to perform context establishment.
47 NFS Server Legacy Upcall Mechanism
48 ==================================
50 The classic upcall mechanism uses a custom text based upcall mechanism
51 to talk to a custom daemon called rpc.svcgssd that is provide by the
54 This upcall mechanism has 2 limitations:
56 A) It can handle tokens that are no bigger than 2KiB
58 In some Kerberos deployment GSSAPI tokens can be quite big, up and
59 beyond 64KiB in size due to various authorization extensions attacked to
60 the Kerberos tickets, that needs to be sent through the GSS layer in
61 order to perform context establishment.
63 B) It does not properly handle creds where the user is member of more
64 than a few thousand groups (the current hard limit in the kernel is 65K
65 groups) due to limitation on the size of the buffer that can be send
66 back to the kernel (4KiB).
68 NFS Server New RPC Upcall Mechanism
69 ===================================
71 The newer upcall mechanism uses RPC over a unix socket to a daemon
72 called gss-proxy, implemented by a userspace program called Gssproxy.
74 The gss_proxy RPC protocol is currently documented `here
75 <https://fedorahosted.org/gss-proxy/wiki/ProtocolDocumentation>`_.
77 This upcall mechanism uses the kernel rpc client and connects to the gssproxy
78 userspace program over a regular unix socket. The gssproxy protocol does not
79 suffer from the size limitations of the legacy protocol.
81 Negotiating Upcall Mechanisms
82 =============================
84 To provide backward compatibility, the kernel defaults to using the
85 legacy mechanism. To switch to the new mechanism, gss-proxy must bind
86 to /var/run/gssproxy.sock and then write "1" to
87 /proc/net/rpc/use-gss-proxy. If gss-proxy dies, it must repeat both
90 Once the upcall mechanism is chosen, it cannot be changed. To prevent
91 locking into the legacy mechanisms, the above steps must be performed
92 before starting nfsd. Whoever starts nfsd can guarantee this by reading
93 from /proc/net/rpc/use-gss-proxy and checking that it contains a
94 "1"--the read will block until gss-proxy has done its write to the file.