Commit | Line | Data |
---|---|---|
76181c13 | 1 | /* Request a key from userspace |
1da177e4 | 2 | * |
76181c13 | 3 | * Copyright (C) 2004-2007 Red Hat, Inc. All Rights Reserved. |
1da177e4 LT |
4 | * 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. | |
f1a9badc DH |
10 | * |
11 | * See Documentation/keys-request-key.txt | |
1da177e4 LT |
12 | */ |
13 | ||
14 | #include <linux/module.h> | |
15 | #include <linux/sched.h> | |
16 | #include <linux/kmod.h> | |
17 | #include <linux/err.h> | |
3e30148c | 18 | #include <linux/keyctl.h> |
fdb89bce | 19 | #include <linux/slab.h> |
1da177e4 LT |
20 | #include "internal.h" |
21 | ||
e9e349b0 DH |
22 | #define key_negative_timeout 60 /* default timeout on a negative key's existence */ |
23 | ||
76181c13 DH |
24 | /* |
25 | * wait_on_bit() sleep function for uninterruptible waiting | |
26 | */ | |
27 | static int key_wait_bit(void *flags) | |
28 | { | |
29 | schedule(); | |
30 | return 0; | |
31 | } | |
32 | ||
33 | /* | |
34 | * wait_on_bit() sleep function for interruptible waiting | |
35 | */ | |
36 | static int key_wait_bit_intr(void *flags) | |
37 | { | |
38 | schedule(); | |
39 | return signal_pending(current) ? -ERESTARTSYS : 0; | |
40 | } | |
41 | ||
42 | /* | |
43 | * call to complete the construction of a key | |
44 | */ | |
45 | void complete_request_key(struct key_construction *cons, int error) | |
46 | { | |
47 | kenter("{%d,%d},%d", cons->key->serial, cons->authkey->serial, error); | |
1da177e4 | 48 | |
76181c13 DH |
49 | if (error < 0) |
50 | key_negate_and_link(cons->key, key_negative_timeout, NULL, | |
51 | cons->authkey); | |
52 | else | |
53 | key_revoke(cons->authkey); | |
54 | ||
55 | key_put(cons->key); | |
56 | key_put(cons->authkey); | |
57 | kfree(cons); | |
58 | } | |
59 | EXPORT_SYMBOL(complete_request_key); | |
1da177e4 | 60 | |
1da177e4 LT |
61 | /* |
62 | * request userspace finish the construction of a key | |
b5f545c8 | 63 | * - execute "/sbin/request-key <op> <key> <uid> <gid> <keyring> <keyring> <keyring>" |
1da177e4 | 64 | */ |
76181c13 | 65 | static int call_sbin_request_key(struct key_construction *cons, |
4e54f085 DH |
66 | const char *op, |
67 | void *aux) | |
1da177e4 LT |
68 | { |
69 | struct task_struct *tsk = current; | |
86a264ab | 70 | const struct cred *cred = current_cred(); |
1da177e4 | 71 | key_serial_t prkey, sskey; |
76181c13 | 72 | struct key *key = cons->key, *authkey = cons->authkey, *keyring; |
b5f545c8 | 73 | char *argv[9], *envp[3], uid_str[12], gid_str[12]; |
1da177e4 | 74 | char key_str[12], keyring_str[3][12]; |
b5f545c8 | 75 | char desc[20]; |
3e30148c DH |
76 | int ret, i; |
77 | ||
b5f545c8 | 78 | kenter("{%d},{%d},%s", key->serial, authkey->serial, op); |
3e30148c | 79 | |
8bbf4976 DH |
80 | ret = install_user_keyrings(); |
81 | if (ret < 0) | |
82 | goto error_alloc; | |
83 | ||
b5f545c8 DH |
84 | /* allocate a new session keyring */ |
85 | sprintf(desc, "_req.%u", key->serial); | |
86 | ||
47d804bf | 87 | keyring = keyring_alloc(desc, current_fsuid(), current_fsgid(), current, |
7e047ef5 | 88 | KEY_ALLOC_QUOTA_OVERRUN, NULL); |
b5f545c8 DH |
89 | if (IS_ERR(keyring)) { |
90 | ret = PTR_ERR(keyring); | |
91 | goto error_alloc; | |
3e30148c | 92 | } |
1da177e4 | 93 | |
b5f545c8 DH |
94 | /* attach the auth key to the session keyring */ |
95 | ret = __key_link(keyring, authkey); | |
96 | if (ret < 0) | |
97 | goto error_link; | |
98 | ||
1da177e4 | 99 | /* record the UID and GID */ |
86a264ab DH |
100 | sprintf(uid_str, "%d", cred->fsuid); |
101 | sprintf(gid_str, "%d", cred->fsgid); | |
1da177e4 LT |
102 | |
103 | /* we say which key is under construction */ | |
104 | sprintf(key_str, "%d", key->serial); | |
105 | ||
106 | /* we specify the process's default keyrings */ | |
107 | sprintf(keyring_str[0], "%d", | |
86a264ab DH |
108 | cred->thread_keyring ? |
109 | cred->thread_keyring->serial : 0); | |
1da177e4 LT |
110 | |
111 | prkey = 0; | |
112 | if (tsk->signal->process_keyring) | |
113 | prkey = tsk->signal->process_keyring->serial; | |
114 | ||
3e30148c | 115 | sprintf(keyring_str[1], "%d", prkey); |
1da177e4 | 116 | |
3e30148c DH |
117 | if (tsk->signal->session_keyring) { |
118 | rcu_read_lock(); | |
119 | sskey = rcu_dereference(tsk->signal->session_keyring)->serial; | |
120 | rcu_read_unlock(); | |
76181c13 | 121 | } else { |
86a264ab | 122 | sskey = cred->user->session_keyring->serial; |
3e30148c | 123 | } |
1da177e4 | 124 | |
1da177e4 LT |
125 | sprintf(keyring_str[2], "%d", sskey); |
126 | ||
127 | /* set up a minimal environment */ | |
128 | i = 0; | |
129 | envp[i++] = "HOME=/"; | |
130 | envp[i++] = "PATH=/sbin:/bin:/usr/sbin:/usr/bin"; | |
131 | envp[i] = NULL; | |
132 | ||
133 | /* set up the argument list */ | |
134 | i = 0; | |
135 | argv[i++] = "/sbin/request-key"; | |
136 | argv[i++] = (char *) op; | |
137 | argv[i++] = key_str; | |
138 | argv[i++] = uid_str; | |
139 | argv[i++] = gid_str; | |
140 | argv[i++] = keyring_str[0]; | |
141 | argv[i++] = keyring_str[1]; | |
142 | argv[i++] = keyring_str[2]; | |
1da177e4 LT |
143 | argv[i] = NULL; |
144 | ||
145 | /* do it */ | |
86313c48 JF |
146 | ret = call_usermodehelper_keys(argv[0], argv, envp, keyring, |
147 | UMH_WAIT_PROC); | |
76181c13 DH |
148 | kdebug("usermode -> 0x%x", ret); |
149 | if (ret >= 0) { | |
150 | /* ret is the exit/wait code */ | |
151 | if (test_bit(KEY_FLAG_USER_CONSTRUCT, &key->flags) || | |
152 | key_validate(key) < 0) | |
153 | ret = -ENOKEY; | |
154 | else | |
155 | /* ignore any errors from userspace if the key was | |
156 | * instantiated */ | |
157 | ret = 0; | |
158 | } | |
3e30148c | 159 | |
b5f545c8 DH |
160 | error_link: |
161 | key_put(keyring); | |
3e30148c | 162 | |
b5f545c8 | 163 | error_alloc: |
3e30148c | 164 | kleave(" = %d", ret); |
76181c13 | 165 | complete_request_key(cons, ret); |
3e30148c | 166 | return ret; |
76181c13 | 167 | } |
1da177e4 | 168 | |
1da177e4 | 169 | /* |
76181c13 | 170 | * call out to userspace for key construction |
1da177e4 LT |
171 | * - we ignore program failure and go on key status instead |
172 | */ | |
4a38e122 | 173 | static int construct_key(struct key *key, const void *callout_info, |
8bbf4976 DH |
174 | size_t callout_len, void *aux, |
175 | struct key *dest_keyring) | |
1da177e4 | 176 | { |
76181c13 | 177 | struct key_construction *cons; |
b5f545c8 | 178 | request_key_actor_t actor; |
76181c13 DH |
179 | struct key *authkey; |
180 | int ret; | |
1da177e4 | 181 | |
4a38e122 | 182 | kenter("%d,%p,%zu,%p", key->serial, callout_info, callout_len, aux); |
3e30148c | 183 | |
76181c13 DH |
184 | cons = kmalloc(sizeof(*cons), GFP_KERNEL); |
185 | if (!cons) | |
186 | return -ENOMEM; | |
1da177e4 | 187 | |
b5f545c8 | 188 | /* allocate an authorisation key */ |
8bbf4976 DH |
189 | authkey = request_key_auth_new(key, callout_info, callout_len, |
190 | dest_keyring); | |
b5f545c8 | 191 | if (IS_ERR(authkey)) { |
76181c13 | 192 | kfree(cons); |
b5f545c8 DH |
193 | ret = PTR_ERR(authkey); |
194 | authkey = NULL; | |
76181c13 DH |
195 | } else { |
196 | cons->authkey = key_get(authkey); | |
197 | cons->key = key_get(key); | |
198 | ||
199 | /* make the call */ | |
200 | actor = call_sbin_request_key; | |
201 | if (key->type->request_key) | |
202 | actor = key->type->request_key; | |
203 | ||
204 | ret = actor(cons, "create", aux); | |
205 | ||
206 | /* check that the actor called complete_request_key() prior to | |
207 | * returning an error */ | |
208 | WARN_ON(ret < 0 && | |
209 | !test_bit(KEY_FLAG_REVOKED, &authkey->flags)); | |
210 | key_put(authkey); | |
1da177e4 LT |
211 | } |
212 | ||
76181c13 DH |
213 | kleave(" = %d", ret); |
214 | return ret; | |
215 | } | |
1da177e4 | 216 | |
3e30148c | 217 | /* |
8bbf4976 DH |
218 | * get the appropriate destination keyring for the request |
219 | * - we return whatever keyring we select with an extra reference upon it which | |
220 | * the caller must release | |
3e30148c | 221 | */ |
8bbf4976 | 222 | static void construct_get_dest_keyring(struct key **_dest_keyring) |
3e30148c | 223 | { |
8bbf4976 | 224 | struct request_key_auth *rka; |
3e30148c | 225 | struct task_struct *tsk = current; |
8bbf4976 | 226 | struct key *dest_keyring = *_dest_keyring, *authkey; |
3e30148c | 227 | |
8bbf4976 | 228 | kenter("%p", dest_keyring); |
3e30148c DH |
229 | |
230 | /* find the appropriate keyring */ | |
8bbf4976 DH |
231 | if (dest_keyring) { |
232 | /* the caller supplied one */ | |
233 | key_get(dest_keyring); | |
234 | } else { | |
235 | /* use a default keyring; falling through the cases until we | |
236 | * find one that we actually have */ | |
b6dff3ec | 237 | switch (tsk->cred->jit_keyring) { |
3e30148c | 238 | case KEY_REQKEY_DEFL_DEFAULT: |
8bbf4976 | 239 | case KEY_REQKEY_DEFL_REQUESTOR_KEYRING: |
b6dff3ec DH |
240 | if (tsk->cred->request_key_auth) { |
241 | authkey = tsk->cred->request_key_auth; | |
8bbf4976 DH |
242 | down_read(&authkey->sem); |
243 | rka = authkey->payload.data; | |
244 | if (!test_bit(KEY_FLAG_REVOKED, | |
245 | &authkey->flags)) | |
246 | dest_keyring = | |
247 | key_get(rka->dest_keyring); | |
248 | up_read(&authkey->sem); | |
249 | if (dest_keyring) | |
250 | break; | |
251 | } | |
252 | ||
3e30148c | 253 | case KEY_REQKEY_DEFL_THREAD_KEYRING: |
b6dff3ec | 254 | dest_keyring = key_get(tsk->cred->thread_keyring); |
3e30148c DH |
255 | if (dest_keyring) |
256 | break; | |
257 | ||
258 | case KEY_REQKEY_DEFL_PROCESS_KEYRING: | |
8bbf4976 | 259 | dest_keyring = key_get(tsk->signal->process_keyring); |
3e30148c DH |
260 | if (dest_keyring) |
261 | break; | |
262 | ||
263 | case KEY_REQKEY_DEFL_SESSION_KEYRING: | |
264 | rcu_read_lock(); | |
265 | dest_keyring = key_get( | |
266 | rcu_dereference(tsk->signal->session_keyring)); | |
267 | rcu_read_unlock(); | |
3e30148c DH |
268 | |
269 | if (dest_keyring) | |
270 | break; | |
271 | ||
272 | case KEY_REQKEY_DEFL_USER_SESSION_KEYRING: | |
b6dff3ec DH |
273 | dest_keyring = |
274 | key_get(tsk->cred->user->session_keyring); | |
3e30148c DH |
275 | break; |
276 | ||
277 | case KEY_REQKEY_DEFL_USER_KEYRING: | |
b6dff3ec | 278 | dest_keyring = key_get(tsk->cred->user->uid_keyring); |
3e30148c DH |
279 | break; |
280 | ||
281 | case KEY_REQKEY_DEFL_GROUP_KEYRING: | |
282 | default: | |
283 | BUG(); | |
284 | } | |
285 | } | |
286 | ||
8bbf4976 DH |
287 | *_dest_keyring = dest_keyring; |
288 | kleave(" [dk %d]", key_serial(dest_keyring)); | |
289 | return; | |
76181c13 | 290 | } |
3e30148c | 291 | |
76181c13 DH |
292 | /* |
293 | * allocate a new key in under-construction state and attempt to link it in to | |
294 | * the requested place | |
295 | * - may return a key that's already under construction instead | |
296 | */ | |
297 | static int construct_alloc_key(struct key_type *type, | |
298 | const char *description, | |
299 | struct key *dest_keyring, | |
300 | unsigned long flags, | |
301 | struct key_user *user, | |
302 | struct key **_key) | |
303 | { | |
304 | struct key *key; | |
305 | key_ref_t key_ref; | |
306 | ||
307 | kenter("%s,%s,,,", type->name, description); | |
308 | ||
309 | mutex_lock(&user->cons_lock); | |
310 | ||
311 | key = key_alloc(type, description, | |
47d804bf | 312 | current_fsuid(), current_fsgid(), current, KEY_POS_ALL, |
76181c13 DH |
313 | flags); |
314 | if (IS_ERR(key)) | |
315 | goto alloc_failed; | |
316 | ||
317 | set_bit(KEY_FLAG_USER_CONSTRUCT, &key->flags); | |
318 | ||
8bbf4976 | 319 | down_write(&dest_keyring->sem); |
76181c13 DH |
320 | |
321 | /* attach the key to the destination keyring under lock, but we do need | |
322 | * to do another check just in case someone beat us to it whilst we | |
323 | * waited for locks */ | |
324 | mutex_lock(&key_construction_mutex); | |
325 | ||
326 | key_ref = search_process_keyrings(type, description, type->match, | |
327 | current); | |
328 | if (!IS_ERR(key_ref)) | |
329 | goto key_already_present; | |
330 | ||
8bbf4976 | 331 | __key_link(dest_keyring, key); |
76181c13 DH |
332 | |
333 | mutex_unlock(&key_construction_mutex); | |
8bbf4976 | 334 | up_write(&dest_keyring->sem); |
76181c13 DH |
335 | mutex_unlock(&user->cons_lock); |
336 | *_key = key; | |
337 | kleave(" = 0 [%d]", key_serial(key)); | |
338 | return 0; | |
339 | ||
340 | key_already_present: | |
341 | mutex_unlock(&key_construction_mutex); | |
342 | if (dest_keyring) | |
343 | up_write(&dest_keyring->sem); | |
344 | mutex_unlock(&user->cons_lock); | |
345 | key_put(key); | |
346 | *_key = key = key_ref_to_ptr(key_ref); | |
347 | kleave(" = -EINPROGRESS [%d]", key_serial(key)); | |
348 | return -EINPROGRESS; | |
349 | ||
350 | alloc_failed: | |
351 | mutex_unlock(&user->cons_lock); | |
352 | *_key = NULL; | |
353 | kleave(" = %ld", PTR_ERR(key)); | |
354 | return PTR_ERR(key); | |
355 | } | |
356 | ||
357 | /* | |
358 | * commence key construction | |
359 | */ | |
360 | static struct key *construct_key_and_link(struct key_type *type, | |
361 | const char *description, | |
362 | const char *callout_info, | |
4a38e122 | 363 | size_t callout_len, |
76181c13 DH |
364 | void *aux, |
365 | struct key *dest_keyring, | |
366 | unsigned long flags) | |
367 | { | |
368 | struct key_user *user; | |
369 | struct key *key; | |
370 | int ret; | |
371 | ||
47d804bf | 372 | user = key_user_lookup(current_fsuid()); |
76181c13 DH |
373 | if (!user) |
374 | return ERR_PTR(-ENOMEM); | |
375 | ||
8bbf4976 DH |
376 | construct_get_dest_keyring(&dest_keyring); |
377 | ||
76181c13 DH |
378 | ret = construct_alloc_key(type, description, dest_keyring, flags, user, |
379 | &key); | |
380 | key_user_put(user); | |
381 | ||
382 | if (ret == 0) { | |
8bbf4976 DH |
383 | ret = construct_key(key, callout_info, callout_len, aux, |
384 | dest_keyring); | |
76181c13 DH |
385 | if (ret < 0) |
386 | goto construction_failed; | |
387 | } | |
388 | ||
8bbf4976 | 389 | key_put(dest_keyring); |
76181c13 DH |
390 | return key; |
391 | ||
392 | construction_failed: | |
393 | key_negate_and_link(key, key_negative_timeout, NULL, NULL); | |
394 | key_put(key); | |
8bbf4976 | 395 | key_put(dest_keyring); |
76181c13 DH |
396 | return ERR_PTR(ret); |
397 | } | |
3e30148c | 398 | |
1da177e4 LT |
399 | /* |
400 | * request a key | |
401 | * - search the process's keyrings | |
402 | * - check the list of keys being created or updated | |
3e30148c DH |
403 | * - call out to userspace for a key if supplementary info was provided |
404 | * - cache the key in an appropriate keyring | |
1da177e4 | 405 | */ |
3e30148c DH |
406 | struct key *request_key_and_link(struct key_type *type, |
407 | const char *description, | |
4a38e122 DH |
408 | const void *callout_info, |
409 | size_t callout_len, | |
4e54f085 | 410 | void *aux, |
7e047ef5 DH |
411 | struct key *dest_keyring, |
412 | unsigned long flags) | |
1da177e4 | 413 | { |
1da177e4 | 414 | struct key *key; |
664cceb0 | 415 | key_ref_t key_ref; |
1da177e4 | 416 | |
4a38e122 DH |
417 | kenter("%s,%s,%p,%zu,%p,%p,%lx", |
418 | type->name, description, callout_info, callout_len, aux, | |
4e54f085 | 419 | dest_keyring, flags); |
3e30148c | 420 | |
1da177e4 | 421 | /* search all the process keyrings for a key */ |
664cceb0 DH |
422 | key_ref = search_process_keyrings(type, description, type->match, |
423 | current); | |
1da177e4 | 424 | |
664cceb0 DH |
425 | if (!IS_ERR(key_ref)) { |
426 | key = key_ref_to_ptr(key_ref); | |
76181c13 | 427 | } else if (PTR_ERR(key_ref) != -EAGAIN) { |
e231c2ee | 428 | key = ERR_CAST(key_ref); |
76181c13 | 429 | } else { |
1da177e4 LT |
430 | /* the search failed, but the keyrings were searchable, so we |
431 | * should consult userspace if we can */ | |
432 | key = ERR_PTR(-ENOKEY); | |
433 | if (!callout_info) | |
434 | goto error; | |
435 | ||
76181c13 | 436 | key = construct_key_and_link(type, description, callout_info, |
4a38e122 DH |
437 | callout_len, aux, dest_keyring, |
438 | flags); | |
1da177e4 LT |
439 | } |
440 | ||
3e30148c DH |
441 | error: |
442 | kleave(" = %p", key); | |
1da177e4 | 443 | return key; |
76181c13 | 444 | } |
1da177e4 | 445 | |
76181c13 DH |
446 | /* |
447 | * wait for construction of a key to complete | |
448 | */ | |
449 | int wait_for_key_construction(struct key *key, bool intr) | |
450 | { | |
451 | int ret; | |
3e30148c | 452 | |
76181c13 DH |
453 | ret = wait_on_bit(&key->flags, KEY_FLAG_USER_CONSTRUCT, |
454 | intr ? key_wait_bit_intr : key_wait_bit, | |
455 | intr ? TASK_INTERRUPTIBLE : TASK_UNINTERRUPTIBLE); | |
456 | if (ret < 0) | |
457 | return ret; | |
458 | return key_validate(key); | |
459 | } | |
460 | EXPORT_SYMBOL(wait_for_key_construction); | |
3e30148c | 461 | |
3e30148c DH |
462 | /* |
463 | * request a key | |
464 | * - search the process's keyrings | |
465 | * - check the list of keys being created or updated | |
466 | * - call out to userspace for a key if supplementary info was provided | |
76181c13 | 467 | * - waits uninterruptible for creation to complete |
3e30148c DH |
468 | */ |
469 | struct key *request_key(struct key_type *type, | |
470 | const char *description, | |
471 | const char *callout_info) | |
472 | { | |
76181c13 | 473 | struct key *key; |
4a38e122 | 474 | size_t callout_len = 0; |
76181c13 DH |
475 | int ret; |
476 | ||
4a38e122 DH |
477 | if (callout_info) |
478 | callout_len = strlen(callout_info); | |
479 | key = request_key_and_link(type, description, callout_info, callout_len, | |
480 | NULL, NULL, KEY_ALLOC_IN_QUOTA); | |
76181c13 DH |
481 | if (!IS_ERR(key)) { |
482 | ret = wait_for_key_construction(key, false); | |
483 | if (ret < 0) { | |
484 | key_put(key); | |
485 | return ERR_PTR(ret); | |
486 | } | |
487 | } | |
488 | return key; | |
489 | } | |
1da177e4 | 490 | EXPORT_SYMBOL(request_key); |
4e54f085 | 491 | |
4e54f085 DH |
492 | /* |
493 | * request a key with auxiliary data for the upcaller | |
494 | * - search the process's keyrings | |
495 | * - check the list of keys being created or updated | |
496 | * - call out to userspace for a key if supplementary info was provided | |
76181c13 | 497 | * - waits uninterruptible for creation to complete |
4e54f085 DH |
498 | */ |
499 | struct key *request_key_with_auxdata(struct key_type *type, | |
500 | const char *description, | |
4a38e122 DH |
501 | const void *callout_info, |
502 | size_t callout_len, | |
4e54f085 DH |
503 | void *aux) |
504 | { | |
76181c13 DH |
505 | struct key *key; |
506 | int ret; | |
507 | ||
4a38e122 DH |
508 | key = request_key_and_link(type, description, callout_info, callout_len, |
509 | aux, NULL, KEY_ALLOC_IN_QUOTA); | |
76181c13 DH |
510 | if (!IS_ERR(key)) { |
511 | ret = wait_for_key_construction(key, false); | |
512 | if (ret < 0) { | |
513 | key_put(key); | |
514 | return ERR_PTR(ret); | |
515 | } | |
516 | } | |
517 | return key; | |
518 | } | |
519 | EXPORT_SYMBOL(request_key_with_auxdata); | |
4e54f085 | 520 | |
76181c13 DH |
521 | /* |
522 | * request a key (allow async construction) | |
523 | * - search the process's keyrings | |
524 | * - check the list of keys being created or updated | |
525 | * - call out to userspace for a key if supplementary info was provided | |
526 | */ | |
527 | struct key *request_key_async(struct key_type *type, | |
528 | const char *description, | |
4a38e122 DH |
529 | const void *callout_info, |
530 | size_t callout_len) | |
76181c13 | 531 | { |
4a38e122 DH |
532 | return request_key_and_link(type, description, callout_info, |
533 | callout_len, NULL, NULL, | |
534 | KEY_ALLOC_IN_QUOTA); | |
76181c13 DH |
535 | } |
536 | EXPORT_SYMBOL(request_key_async); | |
4e54f085 | 537 | |
76181c13 DH |
538 | /* |
539 | * request a key with auxiliary data for the upcaller (allow async construction) | |
540 | * - search the process's keyrings | |
541 | * - check the list of keys being created or updated | |
542 | * - call out to userspace for a key if supplementary info was provided | |
543 | */ | |
544 | struct key *request_key_async_with_auxdata(struct key_type *type, | |
545 | const char *description, | |
4a38e122 DH |
546 | const void *callout_info, |
547 | size_t callout_len, | |
76181c13 DH |
548 | void *aux) |
549 | { | |
4a38e122 DH |
550 | return request_key_and_link(type, description, callout_info, |
551 | callout_len, aux, NULL, KEY_ALLOC_IN_QUOTA); | |
76181c13 DH |
552 | } |
553 | EXPORT_SYMBOL(request_key_async_with_auxdata); |