Lines Matching refs:ctx
322 key_ref_t search_my_process_keyrings(struct keyring_search_context *ctx) in search_my_process_keyrings() argument
338 if (ctx->cred->thread_keyring) { in search_my_process_keyrings()
340 make_key_ref(ctx->cred->thread_keyring, 1), ctx); in search_my_process_keyrings()
356 if (ctx->cred->process_keyring) { in search_my_process_keyrings()
358 make_key_ref(ctx->cred->process_keyring, 1), ctx); in search_my_process_keyrings()
376 if (ctx->cred->session_keyring) { in search_my_process_keyrings()
379 make_key_ref(rcu_dereference(ctx->cred->session_keyring), 1), in search_my_process_keyrings()
380 ctx); in search_my_process_keyrings()
399 else if (ctx->cred->user->session_keyring) { in search_my_process_keyrings()
401 make_key_ref(ctx->cred->user->session_keyring, 1), in search_my_process_keyrings()
402 ctx); in search_my_process_keyrings()
434 key_ref_t search_process_keyrings(struct keyring_search_context *ctx) in search_process_keyrings() argument
441 key_ref = search_my_process_keyrings(ctx); in search_process_keyrings()
450 if (ctx->cred->request_key_auth && in search_process_keyrings()
451 ctx->cred == current_cred() && in search_process_keyrings()
452 ctx->index_key.type != &key_type_request_key_auth in search_process_keyrings()
454 const struct cred *cred = ctx->cred; in search_process_keyrings()
459 if (key_validate(ctx->cred->request_key_auth) == 0) { in search_process_keyrings()
460 rka = ctx->cred->request_key_auth->payload.data[0]; in search_process_keyrings()
462 ctx->cred = rka->cred; in search_process_keyrings()
463 key_ref = search_process_keyrings(ctx); in search_process_keyrings()
464 ctx->cred = cred; in search_process_keyrings()
519 struct keyring_search_context ctx = { in lookup_user_key() local
530 ctx.cred = get_current_cred(); in lookup_user_key()
535 if (!ctx.cred->thread_keyring) { in lookup_user_key()
547 key = ctx.cred->thread_keyring; in lookup_user_key()
553 if (!ctx.cred->process_keyring) { in lookup_user_key()
565 key = ctx.cred->process_keyring; in lookup_user_key()
571 if (!ctx.cred->session_keyring) { in lookup_user_key()
581 ctx.cred->user->session_keyring); in lookup_user_key()
586 } else if (ctx.cred->session_keyring == in lookup_user_key()
587 ctx.cred->user->session_keyring && in lookup_user_key()
596 key = rcu_dereference(ctx.cred->session_keyring); in lookup_user_key()
603 if (!ctx.cred->user->uid_keyring) { in lookup_user_key()
609 key = ctx.cred->user->uid_keyring; in lookup_user_key()
615 if (!ctx.cred->user->session_keyring) { in lookup_user_key()
621 key = ctx.cred->user->session_keyring; in lookup_user_key()
632 key = ctx.cred->request_key_auth; in lookup_user_key()
641 if (!ctx.cred->request_key_auth) in lookup_user_key()
644 down_read(&ctx.cred->request_key_auth->sem); in lookup_user_key()
646 &ctx.cred->request_key_auth->flags)) { in lookup_user_key()
650 rka = ctx.cred->request_key_auth->payload.data[0]; in lookup_user_key()
654 up_read(&ctx.cred->request_key_auth->sem); in lookup_user_key()
674 ctx.index_key.type = key->type; in lookup_user_key()
675 ctx.index_key.description = key->description; in lookup_user_key()
676 ctx.index_key.desc_len = strlen(key->description); in lookup_user_key()
677 ctx.match_data.raw_data = key; in lookup_user_key()
679 skey_ref = search_process_keyrings(&ctx); in lookup_user_key()
720 ret = key_task_permission(key_ref, ctx.cred, perm); in lookup_user_key()
727 put_cred(ctx.cred); in lookup_user_key()
738 put_cred(ctx.cred); in lookup_user_key()