aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/security
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2019-06-26 16:02:33 -0400
committerDavid Howells <dhowells@redhat.com>2019-06-27 18:02:12 -0400
commita58946c158a040068e7c94dc1d58bbd273258068 (patch)
treee655258b700359cdfd9f762c099b7587dc0eed9b /Documentation/security
parent9b242610514fe387ef957bce05e1fdd3efd60359 (diff)
keys: Pass the network namespace into request_key mechanism
Create a request_key_net() function and use it to pass the network namespace domain tag into DNS revolver keys and rxrpc/AFS keys so that keys for different domains can coexist in the same keyring. Signed-off-by: David Howells <dhowells@redhat.com> cc: netdev@vger.kernel.org cc: linux-nfs@vger.kernel.org cc: linux-cifs@vger.kernel.org cc: linux-afs@lists.infradead.org
Diffstat (limited to 'Documentation/security')
-rw-r--r--Documentation/security/keys/core.rst28
-rw-r--r--Documentation/security/keys/request-key.rst29
2 files changed, 43 insertions, 14 deletions
diff --git a/Documentation/security/keys/core.rst b/Documentation/security/keys/core.rst
index ae930ae9d590..0e74f372e58c 100644
--- a/Documentation/security/keys/core.rst
+++ b/Documentation/security/keys/core.rst
@@ -1102,26 +1102,42 @@ payload contents" for more information.
1102 See also Documentation/security/keys/request-key.rst. 1102 See also Documentation/security/keys/request-key.rst.
1103 1103
1104 1104
1105 * To search for a key in a specific domain, call:
1106
1107 struct key *request_key_tag(const struct key_type *type,
1108 const char *description,
1109 struct key_tag *domain_tag,
1110 const char *callout_info);
1111
1112 This is identical to request_key(), except that a domain tag may be
1113 specifies that causes search algorithm to only match keys matching that
1114 tag. The domain_tag may be NULL, specifying a global domain that is
1115 separate from any nominated domain.
1116
1117
1105 * To search for a key, passing auxiliary data to the upcaller, call:: 1118 * To search for a key, passing auxiliary data to the upcaller, call::
1106 1119
1107 struct key *request_key_with_auxdata(const struct key_type *type, 1120 struct key *request_key_with_auxdata(const struct key_type *type,
1108 const char *description, 1121 const char *description,
1122 struct key_tag *domain_tag,
1109 const void *callout_info, 1123 const void *callout_info,
1110 size_t callout_len, 1124 size_t callout_len,
1111 void *aux); 1125 void *aux);
1112 1126
1113 This is identical to request_key(), except that the auxiliary data is 1127 This is identical to request_key_tag(), except that the auxiliary data is
1114 passed to the key_type->request_key() op if it exists, and the callout_info 1128 passed to the key_type->request_key() op if it exists, and the
1115 is a blob of length callout_len, if given (the length may be 0). 1129 callout_info is a blob of length callout_len, if given (the length may be
1130 0).
1116 1131
1117 1132
1118 * To search for a key under RCU conditions, call:: 1133 * To search for a key under RCU conditions, call::
1119 1134
1120 struct key *request_key_rcu(const struct key_type *type, 1135 struct key *request_key_rcu(const struct key_type *type,
1121 const char *description); 1136 const char *description,
1137 struct key_tag *domain_tag);
1122 1138
1123 which is similar to request_key() except that it does not check for keys 1139 which is similar to request_key_tag() except that it does not check for
1124 that are under construction and it will not call out to userspace to 1140 keys that are under construction and it will not call out to userspace to
1125 construct a key if it can't find a match. 1141 construct a key if it can't find a match.
1126 1142
1127 1143
diff --git a/Documentation/security/keys/request-key.rst b/Documentation/security/keys/request-key.rst
index 5a210baa583a..35f2296b704a 100644
--- a/Documentation/security/keys/request-key.rst
+++ b/Documentation/security/keys/request-key.rst
@@ -15,8 +15,16 @@ The process starts by either the kernel requesting a service by calling
15 15
16or:: 16or::
17 17
18 struct key *request_key_tag(const struct key_type *type,
19 const char *description,
20 const struct key_tag *domain_tag,
21 const char *callout_info);
22
23or::
24
18 struct key *request_key_with_auxdata(const struct key_type *type, 25 struct key *request_key_with_auxdata(const struct key_type *type,
19 const char *description, 26 const char *description,
27 const struct key_tag *domain_tag,
20 const char *callout_info, 28 const char *callout_info,
21 size_t callout_len, 29 size_t callout_len,
22 void *aux); 30 void *aux);
@@ -24,7 +32,8 @@ or::
24or:: 32or::
25 33
26 struct key *request_key_rcu(const struct key_type *type, 34 struct key *request_key_rcu(const struct key_type *type,
27 const char *description); 35 const char *description,
36 const struct key_tag *domain_tag);
28 37
29Or by userspace invoking the request_key system call:: 38Or by userspace invoking the request_key system call::
30 39
@@ -38,14 +47,18 @@ does not need to link the key to a keyring to prevent it from being immediately
38destroyed. The kernel interface returns a pointer directly to the key, and 47destroyed. The kernel interface returns a pointer directly to the key, and
39it's up to the caller to destroy the key. 48it's up to the caller to destroy the key.
40 49
41The request_key_with_auxdata() calls is like the in-kernel request_key() call, 50The request_key_tag() call is like the in-kernel request_key(), except that it
42except that they permit auxiliary data to be passed to the upcaller (the 51also takes a domain tag that allows keys to be separated by namespace and
43default is NULL). This is only useful for those key types that define their 52killed off as a group.
44own upcall mechanism rather than using /sbin/request-key. 53
54The request_key_with_auxdata() calls is like the request_key_tag() call, except
55that they permit auxiliary data to be passed to the upcaller (the default is
56NULL). This is only useful for those key types that define their own upcall
57mechanism rather than using /sbin/request-key.
45 58
46The request_key_rcu() call is like the in-kernel request_key() call, except 59The request_key_rcu() call is like the request_key_tag() call, except that it
47that it doesn't check for keys that are under construction and doesn't attempt 60doesn't check for keys that are under construction and doesn't attempt to
48to construct missing keys. 61construct missing keys.
49 62
50The userspace interface links the key to a keyring associated with the process 63The userspace interface links the key to a keyring associated with the process
51to prevent the key from going away, and returns the serial number of the key to 64to prevent the key from going away, and returns the serial number of the key to