blob: abea08f87fe20e4dc14b75bea5c7bbe67c659ba3 [file] [log] [blame]
David Howells76181c12007-10-16 23:29:46 -07001/* Request a key from userspace
Linus Torvalds1da177e2005-04-16 15:20:36 -07002 *
David Howells76181c12007-10-16 23:29:46 -07003 * Copyright (C) 2004-2007 Red Hat, Inc. All Rights Reserved.
Linus Torvalds1da177e2005-04-16 15:20:36 -07004 * Written by David Howells (dhowells@redhat.com)
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version
9 * 2 of the License, or (at your option) any later version.
David Howellsf1a9bad2005-10-07 15:04:52 +010010 *
11 * See Documentation/keys-request-key.txt
Linus Torvalds1da177e2005-04-16 15:20:36 -070012 */
13
14#include <linux/module.h>
15#include <linux/sched.h>
16#include <linux/kmod.h>
17#include <linux/err.h>
David Howells3e301482005-06-23 22:00:56 -070018#include <linux/keyctl.h>
Robert P. J. Dayfdb89bc2008-04-29 01:01:32 -070019#include <linux/slab.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070020#include "internal.h"
21
David Howells76181c12007-10-16 23:29:46 -070022/*
23 * wait_on_bit() sleep function for uninterruptible waiting
24 */
25static int key_wait_bit(void *flags)
26{
27 schedule();
28 return 0;
29}
Linus Torvalds1da177e2005-04-16 15:20:36 -070030
David Howells76181c12007-10-16 23:29:46 -070031/*
32 * wait_on_bit() sleep function for interruptible waiting
33 */
34static int key_wait_bit_intr(void *flags)
35{
36 schedule();
37 return signal_pending(current) ? -ERESTARTSYS : 0;
38}
Linus Torvalds1da177e2005-04-16 15:20:36 -070039
David Howells76181c12007-10-16 23:29:46 -070040/*
41 * call to complete the construction of a key
42 */
43void complete_request_key(struct key_construction *cons, int error)
44{
45 kenter("{%d,%d},%d", cons->key->serial, cons->authkey->serial, error);
46
47 if (error < 0)
48 key_negate_and_link(cons->key, key_negative_timeout, NULL,
49 cons->authkey);
50 else
51 key_revoke(cons->authkey);
52
53 key_put(cons->key);
54 key_put(cons->authkey);
55 kfree(cons);
56}
57EXPORT_SYMBOL(complete_request_key);
58
Linus Torvalds1da177e2005-04-16 15:20:36 -070059/*
60 * request userspace finish the construction of a key
David Howellsb5f545c2006-01-08 01:02:47 -080061 * - execute "/sbin/request-key <op> <key> <uid> <gid> <keyring> <keyring> <keyring>"
Linus Torvalds1da177e2005-04-16 15:20:36 -070062 */
David Howells76181c12007-10-16 23:29:46 -070063static int call_sbin_request_key(struct key_construction *cons,
David Howells4e54f082006-06-29 02:24:28 -070064 const char *op,
65 void *aux)
Linus Torvalds1da177e2005-04-16 15:20:36 -070066{
67 struct task_struct *tsk = current;
Linus Torvalds1da177e2005-04-16 15:20:36 -070068 key_serial_t prkey, sskey;
David Howells76181c12007-10-16 23:29:46 -070069 struct key *key = cons->key, *authkey = cons->authkey, *keyring;
David Howellsb5f545c2006-01-08 01:02:47 -080070 char *argv[9], *envp[3], uid_str[12], gid_str[12];
Linus Torvalds1da177e2005-04-16 15:20:36 -070071 char key_str[12], keyring_str[3][12];
David Howellsb5f545c2006-01-08 01:02:47 -080072 char desc[20];
David Howells3e301482005-06-23 22:00:56 -070073 int ret, i;
74
David Howellsb5f545c2006-01-08 01:02:47 -080075 kenter("{%d},{%d},%s", key->serial, authkey->serial, op);
David Howells3e301482005-06-23 22:00:56 -070076
David Howells1f8f5cf2008-11-10 19:00:05 +000077 ret = install_user_keyrings(tsk);
78 if (ret < 0)
79 goto error_alloc;
80
David Howellsb5f545c2006-01-08 01:02:47 -080081 /* allocate a new session keyring */
82 sprintf(desc, "_req.%u", key->serial);
83
David Howells7e047ef2006-06-26 00:24:50 -070084 keyring = keyring_alloc(desc, current->fsuid, current->fsgid, current,
85 KEY_ALLOC_QUOTA_OVERRUN, NULL);
David Howellsb5f545c2006-01-08 01:02:47 -080086 if (IS_ERR(keyring)) {
87 ret = PTR_ERR(keyring);
88 goto error_alloc;
David Howells3e301482005-06-23 22:00:56 -070089 }
Linus Torvalds1da177e2005-04-16 15:20:36 -070090
David Howellsb5f545c2006-01-08 01:02:47 -080091 /* attach the auth key to the session keyring */
92 ret = __key_link(keyring, authkey);
93 if (ret < 0)
94 goto error_link;
95
Linus Torvalds1da177e2005-04-16 15:20:36 -070096 /* record the UID and GID */
97 sprintf(uid_str, "%d", current->fsuid);
98 sprintf(gid_str, "%d", current->fsgid);
99
100 /* we say which key is under construction */
101 sprintf(key_str, "%d", key->serial);
102
103 /* we specify the process's default keyrings */
104 sprintf(keyring_str[0], "%d",
105 tsk->thread_keyring ? tsk->thread_keyring->serial : 0);
106
107 prkey = 0;
108 if (tsk->signal->process_keyring)
109 prkey = tsk->signal->process_keyring->serial;
110
Linus Torvalds1da177e2005-04-16 15:20:36 -0700111 sprintf(keyring_str[1], "%d", prkey);
David Howells3e301482005-06-23 22:00:56 -0700112
113 if (tsk->signal->session_keyring) {
114 rcu_read_lock();
115 sskey = rcu_dereference(tsk->signal->session_keyring)->serial;
116 rcu_read_unlock();
David Howells76181c12007-10-16 23:29:46 -0700117 } else {
David Howells3e301482005-06-23 22:00:56 -0700118 sskey = tsk->user->session_keyring->serial;
119 }
120
Linus Torvalds1da177e2005-04-16 15:20:36 -0700121 sprintf(keyring_str[2], "%d", sskey);
122
123 /* set up a minimal environment */
124 i = 0;
125 envp[i++] = "HOME=/";
126 envp[i++] = "PATH=/sbin:/bin:/usr/sbin:/usr/bin";
127 envp[i] = NULL;
128
129 /* set up the argument list */
130 i = 0;
131 argv[i++] = "/sbin/request-key";
132 argv[i++] = (char *) op;
133 argv[i++] = key_str;
134 argv[i++] = uid_str;
135 argv[i++] = gid_str;
136 argv[i++] = keyring_str[0];
137 argv[i++] = keyring_str[1];
138 argv[i++] = keyring_str[2];
Linus Torvalds1da177e2005-04-16 15:20:36 -0700139 argv[i] = NULL;
140
141 /* do it */
Jeremy Fitzhardinge86313c42007-07-17 18:37:03 -0700142 ret = call_usermodehelper_keys(argv[0], argv, envp, keyring,
143 UMH_WAIT_PROC);
David Howells76181c12007-10-16 23:29:46 -0700144 kdebug("usermode -> 0x%x", ret);
145 if (ret >= 0) {
146 /* ret is the exit/wait code */
147 if (test_bit(KEY_FLAG_USER_CONSTRUCT, &key->flags) ||
148 key_validate(key) < 0)
149 ret = -ENOKEY;
150 else
151 /* ignore any errors from userspace if the key was
152 * instantiated */
153 ret = 0;
154 }
David Howells3e301482005-06-23 22:00:56 -0700155
David Howellsb5f545c2006-01-08 01:02:47 -0800156error_link:
157 key_put(keyring);
David Howells3e301482005-06-23 22:00:56 -0700158
David Howellsb5f545c2006-01-08 01:02:47 -0800159error_alloc:
David Howells3e301482005-06-23 22:00:56 -0700160 kleave(" = %d", ret);
David Howells76181c12007-10-16 23:29:46 -0700161 complete_request_key(cons, ret);
David Howells3e301482005-06-23 22:00:56 -0700162 return ret;
David Howells76181c12007-10-16 23:29:46 -0700163}
Linus Torvalds1da177e2005-04-16 15:20:36 -0700164
Linus Torvalds1da177e2005-04-16 15:20:36 -0700165/*
David Howells76181c12007-10-16 23:29:46 -0700166 * call out to userspace for key construction
Linus Torvalds1da177e2005-04-16 15:20:36 -0700167 * - we ignore program failure and go on key status instead
168 */
David Howells4a38e122008-04-29 01:01:24 -0700169static int construct_key(struct key *key, const void *callout_info,
170 size_t callout_len, void *aux)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700171{
David Howells76181c12007-10-16 23:29:46 -0700172 struct key_construction *cons;
David Howellsb5f545c2006-01-08 01:02:47 -0800173 request_key_actor_t actor;
David Howells76181c12007-10-16 23:29:46 -0700174 struct key *authkey;
175 int ret;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700176
David Howells4a38e122008-04-29 01:01:24 -0700177 kenter("%d,%p,%zu,%p", key->serial, callout_info, callout_len, aux);
David Howells3e301482005-06-23 22:00:56 -0700178
David Howells76181c12007-10-16 23:29:46 -0700179 cons = kmalloc(sizeof(*cons), GFP_KERNEL);
180 if (!cons)
181 return -ENOMEM;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700182
David Howellsb5f545c2006-01-08 01:02:47 -0800183 /* allocate an authorisation key */
David Howells4a38e122008-04-29 01:01:24 -0700184 authkey = request_key_auth_new(key, callout_info, callout_len);
David Howellsb5f545c2006-01-08 01:02:47 -0800185 if (IS_ERR(authkey)) {
David Howells76181c12007-10-16 23:29:46 -0700186 kfree(cons);
David Howellsb5f545c2006-01-08 01:02:47 -0800187 ret = PTR_ERR(authkey);
188 authkey = NULL;
David Howells76181c12007-10-16 23:29:46 -0700189 } else {
190 cons->authkey = key_get(authkey);
191 cons->key = key_get(key);
192
193 /* make the call */
194 actor = call_sbin_request_key;
195 if (key->type->request_key)
196 actor = key->type->request_key;
197
198 ret = actor(cons, "create", aux);
199
200 /* check that the actor called complete_request_key() prior to
201 * returning an error */
202 WARN_ON(ret < 0 &&
203 !test_bit(KEY_FLAG_REVOKED, &authkey->flags));
204 key_put(authkey);
David Howellsb5f545c2006-01-08 01:02:47 -0800205 }
206
David Howells76181c12007-10-16 23:29:46 -0700207 kleave(" = %d", ret);
208 return ret;
209}
Linus Torvalds1da177e2005-04-16 15:20:36 -0700210
Linus Torvalds1da177e2005-04-16 15:20:36 -0700211/*
David Howells76181c12007-10-16 23:29:46 -0700212 * link a key to the appropriate destination keyring
213 * - the caller must hold a write lock on the destination keyring
Linus Torvalds1da177e2005-04-16 15:20:36 -0700214 */
David Howells76181c12007-10-16 23:29:46 -0700215static void construct_key_make_link(struct key *key, struct key *dest_keyring)
David Howells3e301482005-06-23 22:00:56 -0700216{
217 struct task_struct *tsk = current;
218 struct key *drop = NULL;
219
220 kenter("{%d},%p", key->serial, dest_keyring);
221
222 /* find the appropriate keyring */
223 if (!dest_keyring) {
224 switch (tsk->jit_keyring) {
225 case KEY_REQKEY_DEFL_DEFAULT:
226 case KEY_REQKEY_DEFL_THREAD_KEYRING:
227 dest_keyring = tsk->thread_keyring;
228 if (dest_keyring)
229 break;
230
231 case KEY_REQKEY_DEFL_PROCESS_KEYRING:
232 dest_keyring = tsk->signal->process_keyring;
233 if (dest_keyring)
234 break;
235
236 case KEY_REQKEY_DEFL_SESSION_KEYRING:
237 rcu_read_lock();
238 dest_keyring = key_get(
239 rcu_dereference(tsk->signal->session_keyring));
240 rcu_read_unlock();
241 drop = dest_keyring;
242
243 if (dest_keyring)
244 break;
245
246 case KEY_REQKEY_DEFL_USER_SESSION_KEYRING:
David Howells76181c12007-10-16 23:29:46 -0700247 dest_keyring = tsk->user->session_keyring;
David Howells3e301482005-06-23 22:00:56 -0700248 break;
249
250 case KEY_REQKEY_DEFL_USER_KEYRING:
David Howells76181c12007-10-16 23:29:46 -0700251 dest_keyring = tsk->user->uid_keyring;
David Howells3e301482005-06-23 22:00:56 -0700252 break;
253
254 case KEY_REQKEY_DEFL_GROUP_KEYRING:
255 default:
256 BUG();
257 }
258 }
259
260 /* and attach the key to it */
David Howells76181c12007-10-16 23:29:46 -0700261 __key_link(dest_keyring, key);
David Howells3e301482005-06-23 22:00:56 -0700262 key_put(drop);
David Howells3e301482005-06-23 22:00:56 -0700263 kleave("");
David Howells76181c12007-10-16 23:29:46 -0700264}
David Howells3e301482005-06-23 22:00:56 -0700265
David Howells76181c12007-10-16 23:29:46 -0700266/*
267 * allocate a new key in under-construction state and attempt to link it in to
268 * the requested place
269 * - may return a key that's already under construction instead
270 */
271static int construct_alloc_key(struct key_type *type,
272 const char *description,
273 struct key *dest_keyring,
274 unsigned long flags,
275 struct key_user *user,
276 struct key **_key)
277{
278 struct key *key;
279 key_ref_t key_ref;
David Howells3e301482005-06-23 22:00:56 -0700280
David Howells76181c12007-10-16 23:29:46 -0700281 kenter("%s,%s,,,", type->name, description);
282
283 mutex_lock(&user->cons_lock);
284
285 key = key_alloc(type, description,
286 current->fsuid, current->fsgid, current, KEY_POS_ALL,
287 flags);
288 if (IS_ERR(key))
289 goto alloc_failed;
290
291 set_bit(KEY_FLAG_USER_CONSTRUCT, &key->flags);
292
293 if (dest_keyring)
294 down_write(&dest_keyring->sem);
295
296 /* attach the key to the destination keyring under lock, but we do need
297 * to do another check just in case someone beat us to it whilst we
298 * waited for locks */
299 mutex_lock(&key_construction_mutex);
300
301 key_ref = search_process_keyrings(type, description, type->match,
302 current);
303 if (!IS_ERR(key_ref))
304 goto key_already_present;
305
306 if (dest_keyring)
307 construct_key_make_link(key, dest_keyring);
308
309 mutex_unlock(&key_construction_mutex);
310 if (dest_keyring)
311 up_write(&dest_keyring->sem);
312 mutex_unlock(&user->cons_lock);
313 *_key = key;
314 kleave(" = 0 [%d]", key_serial(key));
315 return 0;
316
317key_already_present:
318 mutex_unlock(&key_construction_mutex);
319 if (dest_keyring)
320 up_write(&dest_keyring->sem);
321 mutex_unlock(&user->cons_lock);
322 key_put(key);
323 *_key = key = key_ref_to_ptr(key_ref);
324 kleave(" = -EINPROGRESS [%d]", key_serial(key));
325 return -EINPROGRESS;
326
327alloc_failed:
328 mutex_unlock(&user->cons_lock);
329 *_key = NULL;
330 kleave(" = %ld", PTR_ERR(key));
331 return PTR_ERR(key);
332}
333
334/*
335 * commence key construction
336 */
337static struct key *construct_key_and_link(struct key_type *type,
338 const char *description,
339 const char *callout_info,
David Howells4a38e122008-04-29 01:01:24 -0700340 size_t callout_len,
David Howells76181c12007-10-16 23:29:46 -0700341 void *aux,
342 struct key *dest_keyring,
343 unsigned long flags)
344{
345 struct key_user *user;
346 struct key *key;
347 int ret;
348
349 user = key_user_lookup(current->fsuid);
350 if (!user)
351 return ERR_PTR(-ENOMEM);
352
353 ret = construct_alloc_key(type, description, dest_keyring, flags, user,
354 &key);
355 key_user_put(user);
356
357 if (ret == 0) {
David Howells4a38e122008-04-29 01:01:24 -0700358 ret = construct_key(key, callout_info, callout_len, aux);
David Howells76181c12007-10-16 23:29:46 -0700359 if (ret < 0)
360 goto construction_failed;
361 }
362
363 return key;
364
365construction_failed:
366 key_negate_and_link(key, key_negative_timeout, NULL, NULL);
367 key_put(key);
368 return ERR_PTR(ret);
369}
370
David Howells3e301482005-06-23 22:00:56 -0700371/*
Linus Torvalds1da177e2005-04-16 15:20:36 -0700372 * request a key
373 * - search the process's keyrings
374 * - check the list of keys being created or updated
David Howells3e301482005-06-23 22:00:56 -0700375 * - call out to userspace for a key if supplementary info was provided
376 * - cache the key in an appropriate keyring
Linus Torvalds1da177e2005-04-16 15:20:36 -0700377 */
David Howells3e301482005-06-23 22:00:56 -0700378struct key *request_key_and_link(struct key_type *type,
379 const char *description,
David Howells4a38e122008-04-29 01:01:24 -0700380 const void *callout_info,
381 size_t callout_len,
David Howells4e54f082006-06-29 02:24:28 -0700382 void *aux,
David Howells7e047ef2006-06-26 00:24:50 -0700383 struct key *dest_keyring,
384 unsigned long flags)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700385{
Linus Torvalds1da177e2005-04-16 15:20:36 -0700386 struct key *key;
David Howells664cceb2005-09-28 17:03:15 +0100387 key_ref_t key_ref;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700388
David Howells4a38e122008-04-29 01:01:24 -0700389 kenter("%s,%s,%p,%zu,%p,%p,%lx",
390 type->name, description, callout_info, callout_len, aux,
David Howells4e54f082006-06-29 02:24:28 -0700391 dest_keyring, flags);
David Howells3e301482005-06-23 22:00:56 -0700392
Linus Torvalds1da177e2005-04-16 15:20:36 -0700393 /* search all the process keyrings for a key */
David Howells664cceb2005-09-28 17:03:15 +0100394 key_ref = search_process_keyrings(type, description, type->match,
395 current);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700396
David Howells664cceb2005-09-28 17:03:15 +0100397 if (!IS_ERR(key_ref)) {
398 key = key_ref_to_ptr(key_ref);
David Howells76181c12007-10-16 23:29:46 -0700399 } else if (PTR_ERR(key_ref) != -EAGAIN) {
David Howellse231c2e2008-02-07 00:15:26 -0800400 key = ERR_CAST(key_ref);
David Howells76181c12007-10-16 23:29:46 -0700401 } else {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700402 /* the search failed, but the keyrings were searchable, so we
403 * should consult userspace if we can */
404 key = ERR_PTR(-ENOKEY);
405 if (!callout_info)
406 goto error;
407
David Howells76181c12007-10-16 23:29:46 -0700408 key = construct_key_and_link(type, description, callout_info,
David Howells4a38e122008-04-29 01:01:24 -0700409 callout_len, aux, dest_keyring,
410 flags);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700411 }
412
David Howells3e301482005-06-23 22:00:56 -0700413error:
414 kleave(" = %p", key);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700415 return key;
David Howells76181c12007-10-16 23:29:46 -0700416}
Linus Torvalds1da177e2005-04-16 15:20:36 -0700417
David Howells76181c12007-10-16 23:29:46 -0700418/*
419 * wait for construction of a key to complete
420 */
421int wait_for_key_construction(struct key *key, bool intr)
422{
423 int ret;
David Howells3e301482005-06-23 22:00:56 -0700424
David Howells76181c12007-10-16 23:29:46 -0700425 ret = wait_on_bit(&key->flags, KEY_FLAG_USER_CONSTRUCT,
426 intr ? key_wait_bit_intr : key_wait_bit,
427 intr ? TASK_INTERRUPTIBLE : TASK_UNINTERRUPTIBLE);
428 if (ret < 0)
429 return ret;
430 return key_validate(key);
431}
432EXPORT_SYMBOL(wait_for_key_construction);
David Howells3e301482005-06-23 22:00:56 -0700433
David Howells3e301482005-06-23 22:00:56 -0700434/*
435 * request a key
436 * - search the process's keyrings
437 * - check the list of keys being created or updated
438 * - call out to userspace for a key if supplementary info was provided
David Howells76181c12007-10-16 23:29:46 -0700439 * - waits uninterruptible for creation to complete
David Howells3e301482005-06-23 22:00:56 -0700440 */
441struct key *request_key(struct key_type *type,
442 const char *description,
443 const char *callout_info)
444{
David Howells76181c12007-10-16 23:29:46 -0700445 struct key *key;
David Howells4a38e122008-04-29 01:01:24 -0700446 size_t callout_len = 0;
David Howells76181c12007-10-16 23:29:46 -0700447 int ret;
David Howells3e301482005-06-23 22:00:56 -0700448
David Howells4a38e122008-04-29 01:01:24 -0700449 if (callout_info)
450 callout_len = strlen(callout_info);
451 key = request_key_and_link(type, description, callout_info, callout_len,
452 NULL, NULL, KEY_ALLOC_IN_QUOTA);
David Howells76181c12007-10-16 23:29:46 -0700453 if (!IS_ERR(key)) {
454 ret = wait_for_key_construction(key, false);
455 if (ret < 0) {
456 key_put(key);
457 return ERR_PTR(ret);
458 }
459 }
460 return key;
461}
Linus Torvalds1da177e2005-04-16 15:20:36 -0700462EXPORT_SYMBOL(request_key);
David Howells4e54f082006-06-29 02:24:28 -0700463
David Howells4e54f082006-06-29 02:24:28 -0700464/*
465 * request a key with auxiliary data for the upcaller
466 * - search the process's keyrings
467 * - check the list of keys being created or updated
468 * - call out to userspace for a key if supplementary info was provided
David Howells76181c12007-10-16 23:29:46 -0700469 * - waits uninterruptible for creation to complete
David Howells4e54f082006-06-29 02:24:28 -0700470 */
471struct key *request_key_with_auxdata(struct key_type *type,
472 const char *description,
David Howells4a38e122008-04-29 01:01:24 -0700473 const void *callout_info,
474 size_t callout_len,
David Howells4e54f082006-06-29 02:24:28 -0700475 void *aux)
476{
David Howells76181c12007-10-16 23:29:46 -0700477 struct key *key;
478 int ret;
479
David Howells4a38e122008-04-29 01:01:24 -0700480 key = request_key_and_link(type, description, callout_info, callout_len,
481 aux, NULL, KEY_ALLOC_IN_QUOTA);
David Howells76181c12007-10-16 23:29:46 -0700482 if (!IS_ERR(key)) {
483 ret = wait_for_key_construction(key, false);
484 if (ret < 0) {
485 key_put(key);
486 return ERR_PTR(ret);
487 }
488 }
489 return key;
490}
491EXPORT_SYMBOL(request_key_with_auxdata);
492
493/*
494 * request a key (allow async construction)
495 * - search the process's keyrings
496 * - check the list of keys being created or updated
497 * - call out to userspace for a key if supplementary info was provided
498 */
499struct key *request_key_async(struct key_type *type,
500 const char *description,
David Howells4a38e122008-04-29 01:01:24 -0700501 const void *callout_info,
502 size_t callout_len)
David Howells76181c12007-10-16 23:29:46 -0700503{
David Howells4a38e122008-04-29 01:01:24 -0700504 return request_key_and_link(type, description, callout_info,
505 callout_len, NULL, NULL,
506 KEY_ALLOC_IN_QUOTA);
David Howells76181c12007-10-16 23:29:46 -0700507}
508EXPORT_SYMBOL(request_key_async);
509
510/*
511 * request a key with auxiliary data for the upcaller (allow async construction)
512 * - search the process's keyrings
513 * - check the list of keys being created or updated
514 * - call out to userspace for a key if supplementary info was provided
515 */
516struct key *request_key_async_with_auxdata(struct key_type *type,
517 const char *description,
David Howells4a38e122008-04-29 01:01:24 -0700518 const void *callout_info,
519 size_t callout_len,
David Howells76181c12007-10-16 23:29:46 -0700520 void *aux)
521{
David Howells4a38e122008-04-29 01:01:24 -0700522 return request_key_and_link(type, description, callout_info,
523 callout_len, aux, NULL, KEY_ALLOC_IN_QUOTA);
David Howells76181c12007-10-16 23:29:46 -0700524}
525EXPORT_SYMBOL(request_key_async_with_auxdata);