aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/filesystems/nfs
diff options
context:
space:
mode:
authorSimo Sorce <simo@redhat.com>2012-05-25 18:09:56 -0400
committerJ. Bruce Fields <bfields@redhat.com>2013-04-26 11:41:28 -0400
commit030d794bf49855f5e2a9e8dfbfad34211d1eb08b (patch)
treeb92b6fecf0856d48d232f266d7ac7e2b0ff09a17 /Documentation/filesystems/nfs
parent1d658336b05f8697d6445834f8867f8ad5e4f735 (diff)
SUNRPC: Use gssproxy upcall for server RPCGSS authentication.
The main advantge of this new upcall mechanism is that it can handle big tickets as seen in Kerberos implementations where tickets carry authorization data like the MS-PAC buffer with AD or the Posix Authorization Data being discussed in IETF on the krbwg working group. The Gssproxy program is used to perform the accept_sec_context call on the kernel's behalf. The code is changed to also pass the input buffer straight to upcall mechanism to avoid allocating and copying many pages as tokens can be as big (potentially more in future) as 64KiB. Signed-off-by: Simo Sorce <simo@redhat.com> [bfields: containerization, negotiation api] Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'Documentation/filesystems/nfs')
-rw-r--r--Documentation/filesystems/nfs/00-INDEX2
-rw-r--r--Documentation/filesystems/nfs/rpc-server-gss.txt91
2 files changed, 93 insertions, 0 deletions
diff --git a/Documentation/filesystems/nfs/00-INDEX b/Documentation/filesystems/nfs/00-INDEX
index 1716874a651e..66eb6c8c5334 100644
--- a/Documentation/filesystems/nfs/00-INDEX
+++ b/Documentation/filesystems/nfs/00-INDEX
@@ -20,3 +20,5 @@ rpc-cache.txt
20 - introduction to the caching mechanisms in the sunrpc layer. 20 - introduction to the caching mechanisms in the sunrpc layer.
21idmapper.txt 21idmapper.txt
22 - information for configuring request-keys to be used by idmapper 22 - information for configuring request-keys to be used by idmapper
23knfsd-rpcgss.txt
24 - Information on GSS authentication support in the NFS Server
diff --git a/Documentation/filesystems/nfs/rpc-server-gss.txt b/Documentation/filesystems/nfs/rpc-server-gss.txt
new file mode 100644
index 000000000000..716f4be8e8b3
--- /dev/null
+++ b/Documentation/filesystems/nfs/rpc-server-gss.txt
@@ -0,0 +1,91 @@
1
2rpcsec_gss support for kernel RPC servers
3=========================================
4
5This document gives references to the standards and protocols used to
6implement RPCGSS authentication in kernel RPC servers such as the NFS
7server and the NFS client's NFSv4.0 callback server. (But note that
8NFSv4.1 and higher don't require the client to act as a server for the
9purposes of authentication.)
10
11RPCGSS is specified in a few IETF documents:
12 - RFC2203 v1: http://tools.ietf.org/rfc/rfc2203.txt
13 - RFC5403 v2: http://tools.ietf.org/rfc/rfc5403.txt
14and there is a 3rd version being proposed:
15 - http://tools.ietf.org/id/draft-williams-rpcsecgssv3.txt
16 (At draft n. 02 at the time of writing)
17
18Background
19----------
20
21The RPCGSS Authentication method describes a way to perform GSSAPI
22Authentication for NFS. Although GSSAPI is itself completely mechanism
23agnostic, in many cases only the KRB5 mechanism is supported by NFS
24implementations.
25
26The Linux kernel, at the moment, supports only the KRB5 mechanism, and
27depends on GSSAPI extensions that are KRB5 specific.
28
29GSSAPI is a complex library, and implementing it completely in kernel is
30unwarranted. However GSSAPI operations are fundementally separable in 2
31parts:
32- initial context establishment
33- integrity/privacy protection (signing and encrypting of individual
34 packets)
35
36The former is more complex and policy-independent, but less
37performance-sensitive. The latter is simpler and needs to be very fast.
38
39Therefore, we perform per-packet integrity and privacy protection in the
40kernel, but leave the initial context establishment to userspace. We
41need upcalls to request userspace to perform context establishment.
42
43NFS Server Legacy Upcall Mechanism
44----------------------------------
45
46The classic upcall mechanism uses a custom text based upcall mechanism
47to talk to a custom daemon called rpc.svcgssd that is provide by the
48nfs-utils package.
49
50This upcall mechanism has 2 limitations:
51
52A) It can handle tokens that are no bigger than 2KiB
53
54In some Kerberos deployment GSSAPI tokens can be quite big, up and
55beyond 64KiB in size due to various authorization extensions attacked to
56the Kerberos tickets, that needs to be sent through the GSS layer in
57order to perform context establishment.
58
59B) It does not properly handle creds where the user is member of more
60than a few housand groups (the current hard limit in the kernel is 65K
61groups) due to limitation on the size of the buffer that can be send
62back to the kernel (4KiB).
63
64NFS Server New RPC Upcall Mechanism
65-----------------------------------
66
67The newer upcall mechanism uses RPC over a unix socket to a daemon
68called gss-proxy, implemented by a userspace program called Gssproxy.
69
70The gss_proxy RPC protocol is currently documented here:
71
72 https://fedorahosted.org/gss-proxy/wiki/ProtocolDocumentation
73
74This upcall mechanism uses the kernel rpc client and connects to the gssproxy
75userspace program over a regular unix socket. The gssproxy protocol does not
76suffer from the size limitations of the legacy protocol.
77
78Negotiating Upcall Mechanisms
79-----------------------------
80
81To provide backward compatibility, the kernel defaults to using the
82legacy mechanism. To switch to the new mechanism, gss-proxy must bind
83to /var/run/gssproxy.sock and then write "1" to
84/proc/net/rpc/use-gss-proxy. If gss-proxy dies, it must repeat both
85steps.
86
87Once the upcall mechanism is chosen, it cannot be changed. To prevent
88locking into the legacy mechanisms, the above steps must be performed
89before starting nfsd. Whoever starts nfsd can guarantee this by reading
90from /proc/net/rpc/use-gss-proxy and checking that it contains a
91"1"--the read will block until gss-proxy has done its write to the file.