blob: ba32ca6469bdf2e74a8b0f9cb94d27604b7251af [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 Howellsb5f545c2006-01-08 01:02:47 -080077 /* allocate a new session keyring */
78 sprintf(desc, "_req.%u", key->serial);
79
David Howells7e047ef2006-06-26 00:24:50 -070080 keyring = keyring_alloc(desc, current->fsuid, current->fsgid, current,
81 KEY_ALLOC_QUOTA_OVERRUN, NULL);
David Howellsb5f545c2006-01-08 01:02:47 -080082 if (IS_ERR(keyring)) {
83 ret = PTR_ERR(keyring);
84 goto error_alloc;
David Howells3e301482005-06-23 22:00:56 -070085 }
Linus Torvalds1da177e2005-04-16 15:20:36 -070086
David Howellsb5f545c2006-01-08 01:02:47 -080087 /* attach the auth key to the session keyring */
88 ret = __key_link(keyring, authkey);
89 if (ret < 0)
90 goto error_link;
91
Linus Torvalds1da177e2005-04-16 15:20:36 -070092 /* record the UID and GID */
93 sprintf(uid_str, "%d", current->fsuid);
94 sprintf(gid_str, "%d", current->fsgid);
95
96 /* we say which key is under construction */
97 sprintf(key_str, "%d", key->serial);
98
99 /* we specify the process's default keyrings */
100 sprintf(keyring_str[0], "%d",
101 tsk->thread_keyring ? tsk->thread_keyring->serial : 0);
102
103 prkey = 0;
104 if (tsk->signal->process_keyring)
105 prkey = tsk->signal->process_keyring->serial;
106
Linus Torvalds1da177e2005-04-16 15:20:36 -0700107 sprintf(keyring_str[1], "%d", prkey);
David Howells3e301482005-06-23 22:00:56 -0700108
109 if (tsk->signal->session_keyring) {
110 rcu_read_lock();
111 sskey = rcu_dereference(tsk->signal->session_keyring)->serial;
112 rcu_read_unlock();
David Howells76181c12007-10-16 23:29:46 -0700113 } else {
David Howells3e301482005-06-23 22:00:56 -0700114 sskey = tsk->user->session_keyring->serial;
115 }
116
Linus Torvalds1da177e2005-04-16 15:20:36 -0700117 sprintf(keyring_str[2], "%d", sskey);
118
119 /* set up a minimal environment */
120 i = 0;
121 envp[i++] = "HOME=/";
122 envp[i++] = "PATH=/sbin:/bin:/usr/sbin:/usr/bin";
123 envp[i] = NULL;
124
125 /* set up the argument list */
126 i = 0;
127 argv[i++] = "/sbin/request-key";
128 argv[i++] = (char *) op;
129 argv[i++] = key_str;
130 argv[i++] = uid_str;
131 argv[i++] = gid_str;
132 argv[i++] = keyring_str[0];
133 argv[i++] = keyring_str[1];
134 argv[i++] = keyring_str[2];
Linus Torvalds1da177e2005-04-16 15:20:36 -0700135 argv[i] = NULL;
136
137 /* do it */
Jeremy Fitzhardinge86313c42007-07-17 18:37:03 -0700138 ret = call_usermodehelper_keys(argv[0], argv, envp, keyring,
139 UMH_WAIT_PROC);
David Howells76181c12007-10-16 23:29:46 -0700140 kdebug("usermode -> 0x%x", ret);
141 if (ret >= 0) {
142 /* ret is the exit/wait code */
143 if (test_bit(KEY_FLAG_USER_CONSTRUCT, &key->flags) ||
144 key_validate(key) < 0)
145 ret = -ENOKEY;
146 else
147 /* ignore any errors from userspace if the key was
148 * instantiated */
149 ret = 0;
150 }
David Howells3e301482005-06-23 22:00:56 -0700151
David Howellsb5f545c2006-01-08 01:02:47 -0800152error_link:
153 key_put(keyring);
David Howells3e301482005-06-23 22:00:56 -0700154
David Howellsb5f545c2006-01-08 01:02:47 -0800155error_alloc:
David Howells3e301482005-06-23 22:00:56 -0700156 kleave(" = %d", ret);
David Howells76181c12007-10-16 23:29:46 -0700157 complete_request_key(cons, ret);
David Howells3e301482005-06-23 22:00:56 -0700158 return ret;
David Howells76181c12007-10-16 23:29:46 -0700159}
Linus Torvalds1da177e2005-04-16 15:20:36 -0700160
Linus Torvalds1da177e2005-04-16 15:20:36 -0700161/*
David Howells76181c12007-10-16 23:29:46 -0700162 * call out to userspace for key construction
Linus Torvalds1da177e2005-04-16 15:20:36 -0700163 * - we ignore program failure and go on key status instead
164 */
David Howells4a38e122008-04-29 01:01:24 -0700165static int construct_key(struct key *key, const void *callout_info,
166 size_t callout_len, void *aux)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700167{
David Howells76181c12007-10-16 23:29:46 -0700168 struct key_construction *cons;
David Howellsb5f545c2006-01-08 01:02:47 -0800169 request_key_actor_t actor;
David Howells76181c12007-10-16 23:29:46 -0700170 struct key *authkey;
171 int ret;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700172
David Howells4a38e122008-04-29 01:01:24 -0700173 kenter("%d,%p,%zu,%p", key->serial, callout_info, callout_len, aux);
David Howells3e301482005-06-23 22:00:56 -0700174
David Howells76181c12007-10-16 23:29:46 -0700175 cons = kmalloc(sizeof(*cons), GFP_KERNEL);
176 if (!cons)
177 return -ENOMEM;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700178
David Howellsb5f545c2006-01-08 01:02:47 -0800179 /* allocate an authorisation key */
David Howells4a38e122008-04-29 01:01:24 -0700180 authkey = request_key_auth_new(key, callout_info, callout_len);
David Howellsb5f545c2006-01-08 01:02:47 -0800181 if (IS_ERR(authkey)) {
David Howells76181c12007-10-16 23:29:46 -0700182 kfree(cons);
David Howellsb5f545c2006-01-08 01:02:47 -0800183 ret = PTR_ERR(authkey);
184 authkey = NULL;
David Howells76181c12007-10-16 23:29:46 -0700185 } else {
186 cons->authkey = key_get(authkey);
187 cons->key = key_get(key);
188
189 /* make the call */
190 actor = call_sbin_request_key;
191 if (key->type->request_key)
192 actor = key->type->request_key;
193
194 ret = actor(cons, "create", aux);
195
196 /* check that the actor called complete_request_key() prior to
197 * returning an error */
198 WARN_ON(ret < 0 &&
199 !test_bit(KEY_FLAG_REVOKED, &authkey->flags));
200 key_put(authkey);
David Howellsb5f545c2006-01-08 01:02:47 -0800201 }
202
David Howells76181c12007-10-16 23:29:46 -0700203 kleave(" = %d", ret);
204 return ret;
205}
Linus Torvalds1da177e2005-04-16 15:20:36 -0700206
Linus Torvalds1da177e2005-04-16 15:20:36 -0700207/*
David Howells76181c12007-10-16 23:29:46 -0700208 * link a key to the appropriate destination keyring
209 * - the caller must hold a write lock on the destination keyring
Linus Torvalds1da177e2005-04-16 15:20:36 -0700210 */
David Howells76181c12007-10-16 23:29:46 -0700211static void construct_key_make_link(struct key *key, struct key *dest_keyring)
David Howells3e301482005-06-23 22:00:56 -0700212{
213 struct task_struct *tsk = current;
214 struct key *drop = NULL;
215
216 kenter("{%d},%p", key->serial, dest_keyring);
217
218 /* find the appropriate keyring */
219 if (!dest_keyring) {
220 switch (tsk->jit_keyring) {
221 case KEY_REQKEY_DEFL_DEFAULT:
222 case KEY_REQKEY_DEFL_THREAD_KEYRING:
223 dest_keyring = tsk->thread_keyring;
224 if (dest_keyring)
225 break;
226
227 case KEY_REQKEY_DEFL_PROCESS_KEYRING:
228 dest_keyring = tsk->signal->process_keyring;
229 if (dest_keyring)
230 break;
231
232 case KEY_REQKEY_DEFL_SESSION_KEYRING:
233 rcu_read_lock();
234 dest_keyring = key_get(
235 rcu_dereference(tsk->signal->session_keyring));
236 rcu_read_unlock();
237 drop = dest_keyring;
238
239 if (dest_keyring)
240 break;
241
242 case KEY_REQKEY_DEFL_USER_SESSION_KEYRING:
David Howells76181c12007-10-16 23:29:46 -0700243 dest_keyring = tsk->user->session_keyring;
David Howells3e301482005-06-23 22:00:56 -0700244 break;
245
246 case KEY_REQKEY_DEFL_USER_KEYRING:
David Howells76181c12007-10-16 23:29:46 -0700247 dest_keyring = tsk->user->uid_keyring;
David Howells3e301482005-06-23 22:00:56 -0700248 break;
249
250 case KEY_REQKEY_DEFL_GROUP_KEYRING:
251 default:
252 BUG();
253 }
254 }
255
256 /* and attach the key to it */
David Howells76181c12007-10-16 23:29:46 -0700257 __key_link(dest_keyring, key);
David Howells3e301482005-06-23 22:00:56 -0700258 key_put(drop);
David Howells3e301482005-06-23 22:00:56 -0700259 kleave("");
David Howells76181c12007-10-16 23:29:46 -0700260}
David Howells3e301482005-06-23 22:00:56 -0700261
David Howells76181c12007-10-16 23:29:46 -0700262/*
263 * allocate a new key in under-construction state and attempt to link it in to
264 * the requested place
265 * - may return a key that's already under construction instead
266 */
267static int construct_alloc_key(struct key_type *type,
268 const char *description,
269 struct key *dest_keyring,
270 unsigned long flags,
271 struct key_user *user,
272 struct key **_key)
273{
274 struct key *key;
275 key_ref_t key_ref;
David Howells3e301482005-06-23 22:00:56 -0700276
David Howells76181c12007-10-16 23:29:46 -0700277 kenter("%s,%s,,,", type->name, description);
278
279 mutex_lock(&user->cons_lock);
280
281 key = key_alloc(type, description,
282 current->fsuid, current->fsgid, current, KEY_POS_ALL,
283 flags);
284 if (IS_ERR(key))
285 goto alloc_failed;
286
287 set_bit(KEY_FLAG_USER_CONSTRUCT, &key->flags);
288
289 if (dest_keyring)
290 down_write(&dest_keyring->sem);
291
292 /* attach the key to the destination keyring under lock, but we do need
293 * to do another check just in case someone beat us to it whilst we
294 * waited for locks */
295 mutex_lock(&key_construction_mutex);
296
297 key_ref = search_process_keyrings(type, description, type->match,
298 current);
299 if (!IS_ERR(key_ref))
300 goto key_already_present;
301
302 if (dest_keyring)
303 construct_key_make_link(key, dest_keyring);
304
305 mutex_unlock(&key_construction_mutex);
306 if (dest_keyring)
307 up_write(&dest_keyring->sem);
308 mutex_unlock(&user->cons_lock);
309 *_key = key;
310 kleave(" = 0 [%d]", key_serial(key));
311 return 0;
312
313key_already_present:
314 mutex_unlock(&key_construction_mutex);
315 if (dest_keyring)
316 up_write(&dest_keyring->sem);
317 mutex_unlock(&user->cons_lock);
318 key_put(key);
319 *_key = key = key_ref_to_ptr(key_ref);
320 kleave(" = -EINPROGRESS [%d]", key_serial(key));
321 return -EINPROGRESS;
322
323alloc_failed:
324 mutex_unlock(&user->cons_lock);
325 *_key = NULL;
326 kleave(" = %ld", PTR_ERR(key));
327 return PTR_ERR(key);
328}
329
330/*
331 * commence key construction
332 */
333static struct key *construct_key_and_link(struct key_type *type,
334 const char *description,
335 const char *callout_info,
David Howells4a38e122008-04-29 01:01:24 -0700336 size_t callout_len,
David Howells76181c12007-10-16 23:29:46 -0700337 void *aux,
338 struct key *dest_keyring,
339 unsigned long flags)
340{
341 struct key_user *user;
342 struct key *key;
343 int ret;
344
345 user = key_user_lookup(current->fsuid);
346 if (!user)
347 return ERR_PTR(-ENOMEM);
348
349 ret = construct_alloc_key(type, description, dest_keyring, flags, user,
350 &key);
351 key_user_put(user);
352
353 if (ret == 0) {
David Howells4a38e122008-04-29 01:01:24 -0700354 ret = construct_key(key, callout_info, callout_len, aux);
David Howells76181c12007-10-16 23:29:46 -0700355 if (ret < 0)
356 goto construction_failed;
357 }
358
359 return key;
360
361construction_failed:
362 key_negate_and_link(key, key_negative_timeout, NULL, NULL);
363 key_put(key);
364 return ERR_PTR(ret);
365}
366
David Howells3e301482005-06-23 22:00:56 -0700367/*
Linus Torvalds1da177e2005-04-16 15:20:36 -0700368 * request a key
369 * - search the process's keyrings
370 * - check the list of keys being created or updated
David Howells3e301482005-06-23 22:00:56 -0700371 * - call out to userspace for a key if supplementary info was provided
372 * - cache the key in an appropriate keyring
Linus Torvalds1da177e2005-04-16 15:20:36 -0700373 */
David Howells3e301482005-06-23 22:00:56 -0700374struct key *request_key_and_link(struct key_type *type,
375 const char *description,
David Howells4a38e122008-04-29 01:01:24 -0700376 const void *callout_info,
377 size_t callout_len,
David Howells4e54f082006-06-29 02:24:28 -0700378 void *aux,
David Howells7e047ef2006-06-26 00:24:50 -0700379 struct key *dest_keyring,
380 unsigned long flags)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700381{
Linus Torvalds1da177e2005-04-16 15:20:36 -0700382 struct key *key;
David Howells664cceb2005-09-28 17:03:15 +0100383 key_ref_t key_ref;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700384
David Howells4a38e122008-04-29 01:01:24 -0700385 kenter("%s,%s,%p,%zu,%p,%p,%lx",
386 type->name, description, callout_info, callout_len, aux,
David Howells4e54f082006-06-29 02:24:28 -0700387 dest_keyring, flags);
David Howells3e301482005-06-23 22:00:56 -0700388
Linus Torvalds1da177e2005-04-16 15:20:36 -0700389 /* search all the process keyrings for a key */
David Howells664cceb2005-09-28 17:03:15 +0100390 key_ref = search_process_keyrings(type, description, type->match,
391 current);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700392
David Howells664cceb2005-09-28 17:03:15 +0100393 if (!IS_ERR(key_ref)) {
394 key = key_ref_to_ptr(key_ref);
David Howells76181c12007-10-16 23:29:46 -0700395 } else if (PTR_ERR(key_ref) != -EAGAIN) {
David Howellse231c2e2008-02-07 00:15:26 -0800396 key = ERR_CAST(key_ref);
David Howells76181c12007-10-16 23:29:46 -0700397 } else {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700398 /* the search failed, but the keyrings were searchable, so we
399 * should consult userspace if we can */
400 key = ERR_PTR(-ENOKEY);
401 if (!callout_info)
402 goto error;
403
David Howells76181c12007-10-16 23:29:46 -0700404 key = construct_key_and_link(type, description, callout_info,
David Howells4a38e122008-04-29 01:01:24 -0700405 callout_len, aux, dest_keyring,
406 flags);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700407 }
408
David Howells3e301482005-06-23 22:00:56 -0700409error:
410 kleave(" = %p", key);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700411 return key;
David Howells76181c12007-10-16 23:29:46 -0700412}
Linus Torvalds1da177e2005-04-16 15:20:36 -0700413
David Howells76181c12007-10-16 23:29:46 -0700414/*
415 * wait for construction of a key to complete
416 */
417int wait_for_key_construction(struct key *key, bool intr)
418{
419 int ret;
David Howells3e301482005-06-23 22:00:56 -0700420
David Howells76181c12007-10-16 23:29:46 -0700421 ret = wait_on_bit(&key->flags, KEY_FLAG_USER_CONSTRUCT,
422 intr ? key_wait_bit_intr : key_wait_bit,
423 intr ? TASK_INTERRUPTIBLE : TASK_UNINTERRUPTIBLE);
424 if (ret < 0)
425 return ret;
426 return key_validate(key);
427}
428EXPORT_SYMBOL(wait_for_key_construction);
David Howells3e301482005-06-23 22:00:56 -0700429
David Howells3e301482005-06-23 22:00:56 -0700430/*
431 * request a key
432 * - search the process's keyrings
433 * - check the list of keys being created or updated
434 * - call out to userspace for a key if supplementary info was provided
David Howells76181c12007-10-16 23:29:46 -0700435 * - waits uninterruptible for creation to complete
David Howells3e301482005-06-23 22:00:56 -0700436 */
437struct key *request_key(struct key_type *type,
438 const char *description,
439 const char *callout_info)
440{
David Howells76181c12007-10-16 23:29:46 -0700441 struct key *key;
David Howells4a38e122008-04-29 01:01:24 -0700442 size_t callout_len = 0;
David Howells76181c12007-10-16 23:29:46 -0700443 int ret;
David Howells3e301482005-06-23 22:00:56 -0700444
David Howells4a38e122008-04-29 01:01:24 -0700445 if (callout_info)
446 callout_len = strlen(callout_info);
447 key = request_key_and_link(type, description, callout_info, callout_len,
448 NULL, NULL, KEY_ALLOC_IN_QUOTA);
David Howells76181c12007-10-16 23:29:46 -0700449 if (!IS_ERR(key)) {
450 ret = wait_for_key_construction(key, false);
451 if (ret < 0) {
452 key_put(key);
453 return ERR_PTR(ret);
454 }
455 }
456 return key;
457}
Linus Torvalds1da177e2005-04-16 15:20:36 -0700458EXPORT_SYMBOL(request_key);
David Howells4e54f082006-06-29 02:24:28 -0700459
David Howells4e54f082006-06-29 02:24:28 -0700460/*
461 * request a key with auxiliary data for the upcaller
462 * - search the process's keyrings
463 * - check the list of keys being created or updated
464 * - call out to userspace for a key if supplementary info was provided
David Howells76181c12007-10-16 23:29:46 -0700465 * - waits uninterruptible for creation to complete
David Howells4e54f082006-06-29 02:24:28 -0700466 */
467struct key *request_key_with_auxdata(struct key_type *type,
468 const char *description,
David Howells4a38e122008-04-29 01:01:24 -0700469 const void *callout_info,
470 size_t callout_len,
David Howells4e54f082006-06-29 02:24:28 -0700471 void *aux)
472{
David Howells76181c12007-10-16 23:29:46 -0700473 struct key *key;
474 int ret;
475
David Howells4a38e122008-04-29 01:01:24 -0700476 key = request_key_and_link(type, description, callout_info, callout_len,
477 aux, NULL, KEY_ALLOC_IN_QUOTA);
David Howells76181c12007-10-16 23:29:46 -0700478 if (!IS_ERR(key)) {
479 ret = wait_for_key_construction(key, false);
480 if (ret < 0) {
481 key_put(key);
482 return ERR_PTR(ret);
483 }
484 }
485 return key;
486}
487EXPORT_SYMBOL(request_key_with_auxdata);
488
489/*
490 * request a key (allow async construction)
491 * - search the process's keyrings
492 * - check the list of keys being created or updated
493 * - call out to userspace for a key if supplementary info was provided
494 */
495struct key *request_key_async(struct key_type *type,
496 const char *description,
David Howells4a38e122008-04-29 01:01:24 -0700497 const void *callout_info,
498 size_t callout_len)
David Howells76181c12007-10-16 23:29:46 -0700499{
David Howells4a38e122008-04-29 01:01:24 -0700500 return request_key_and_link(type, description, callout_info,
501 callout_len, NULL, NULL,
502 KEY_ALLOC_IN_QUOTA);
David Howells76181c12007-10-16 23:29:46 -0700503}
504EXPORT_SYMBOL(request_key_async);
505
506/*
507 * request a key with auxiliary data for the upcaller (allow async construction)
508 * - search the process's keyrings
509 * - check the list of keys being created or updated
510 * - call out to userspace for a key if supplementary info was provided
511 */
512struct key *request_key_async_with_auxdata(struct key_type *type,
513 const char *description,
David Howells4a38e122008-04-29 01:01:24 -0700514 const void *callout_info,
515 size_t callout_len,
David Howells76181c12007-10-16 23:29:46 -0700516 void *aux)
517{
David Howells4a38e122008-04-29 01:01:24 -0700518 return request_key_and_link(type, description, callout_info,
519 callout_len, aux, NULL, KEY_ALLOC_IN_QUOTA);
David Howells76181c12007-10-16 23:29:46 -0700520}
521EXPORT_SYMBOL(request_key_async_with_auxdata);