sphinx.addnodesdocument)}( rawsourcechildren]( translations LanguagesNode)}(hhh](h pending_xref)}(hhh]docutils.nodesTextChinese (Simplified)}parenthsba attributes}(ids]classes]names]dupnames]backrefs] refdomainstdreftypedoc reftarget-/translations/zh_CN/security/keys/request-keymodnameN classnameN refexplicitutagnamehhh ubh)}(hhh]hChinese (Traditional)}hh2sbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget-/translations/zh_TW/security/keys/request-keymodnameN classnameN refexplicituh1hhh ubh)}(hhh]hItalian}hhFsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget-/translations/it_IT/security/keys/request-keymodnameN classnameN refexplicituh1hhh ubh)}(hhh]hJapanese}hhZsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget-/translations/ja_JP/security/keys/request-keymodnameN classnameN refexplicituh1hhh ubh)}(hhh]hKorean}hhnsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget-/translations/ko_KR/security/keys/request-keymodnameN classnameN refexplicituh1hhh ubh)}(hhh]hSpanish}hhsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget-/translations/sp_SP/security/keys/request-keymodnameN classnameN refexplicituh1hhh ubeh}(h]h ]h"]h$]h&]current_languageEnglishuh1h hh _documenthsourceNlineNubhsection)}(hhh](htitle)}(hKey Request Serviceh]hKey Request Service}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhG/var/lib/git/docbuild/linux/Documentation/security/keys/request-key.rsthKubh paragraph)}(hThe key request service is part of the key retention service (refer to Documentation/security/keys/core.rst). This document explains more fully how the requesting algorithm works.h]hThe key request service is part of the key retention service (refer to Documentation/security/keys/core.rst). This document explains more fully how the requesting algorithm works.}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(h\The process starts by either the kernel requesting a service by calling ``request_key*()``::h](hHThe process starts by either the kernel requesting a service by calling }(hhhhhNhNubhliteral)}(h``request_key*()``h]hrequest_key*()}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhubh:}(hhhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK hhhhubh literal_block)}(hstruct key *request_key(const struct key_type *type, const char *description, const char *callout_info);h]hstruct key *request_key(const struct key_type *type, const char *description, const char *callout_info);}hhsbah}(h]h ]h"]h$]h&] xml:spacepreserveuh1hhhhK hhhhubh)}(hor::h]hor:}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(hstruct key *request_key_tag(const struct key_type *type, const char *description, const struct key_tag *domain_tag, const char *callout_info);h]hstruct key *request_key_tag(const struct key_type *type, const char *description, const struct key_tag *domain_tag, const char *callout_info);}hj sbah}(h]h ]h"]h$]h&]hhuh1hhhhKhhhhubh)}(hor::h]hor:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(hXostruct key *request_key_with_auxdata(const struct key_type *type, const char *description, const struct key_tag *domain_tag, const char *callout_info, size_t callout_len, void *aux);h]hXostruct key *request_key_with_auxdata(const struct key_type *type, const char *description, const struct key_tag *domain_tag, const char *callout_info, size_t callout_len, void *aux);}hj%sbah}(h]h ]h"]h$]h&]hhuh1hhhhKhhhhubh)}(hor::h]hor:}(hj3hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK hhhhubh)}(hstruct key *request_key_rcu(const struct key_type *type, const char *description, const struct key_tag *domain_tag);h]hstruct key *request_key_rcu(const struct key_type *type, const char *description, const struct key_tag *domain_tag);}hjAsbah}(h]h ]h"]h$]h&]hhuh1hhhhK"hhhhubh)}(h6Or by userspace invoking the request_key system call::h]h5Or by userspace invoking the request_key system call:}(hjOhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK&hhhhubh)}(hkey_serial_t request_key(const char *type, const char *description, const char *callout_info, key_serial_t dest_keyring);h]hkey_serial_t request_key(const char *type, const char *description, const char *callout_info, key_serial_t dest_keyring);}hj]sbah}(h]h ]h"]h$]h&]hhuh1hhhhK(hhhhubh)}(hXThe main difference between the access points is that the in-kernel interface does not need to link the key to a keyring to prevent it from being immediately destroyed. The kernel interface returns a pointer directly to the key, and it's up to the caller to destroy the key.h]hXThe main difference between the access points is that the in-kernel interface does not need to link the key to a keyring to prevent it from being immediately destroyed. The kernel interface returns a pointer directly to the key, and it’s up to the caller to destroy the key.}(hjkhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK-hhhhubh)}(hThe request_key_tag() call is like the in-kernel request_key(), except that it also takes a domain tag that allows keys to be separated by namespace and killed off as a group.h]hThe request_key_tag() call is like the in-kernel request_key(), except that it also takes a domain tag that allows keys to be separated by namespace and killed off as a group.}(hjyhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK2hhhhubh)}(hXThe request_key_with_auxdata() calls is like the request_key_tag() call, except that they permit auxiliary data to be passed to the upcaller (the default is NULL). This is only useful for those key types that define their own upcall mechanism rather than using /sbin/request-key.h]hXThe request_key_with_auxdata() calls is like the request_key_tag() call, except that they permit auxiliary data to be passed to the upcaller (the default is NULL). This is only useful for those key types that define their own upcall mechanism rather than using /sbin/request-key.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK6hhhhubh)}(hThe request_key_rcu() call is like the request_key_tag() call, except that it doesn't check for keys that are under construction and doesn't attempt to construct missing keys.h]hThe request_key_rcu() call is like the request_key_tag() call, except that it doesn’t check for keys that are under construction and doesn’t attempt to construct missing keys.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK;hhhhubh)}(hThe userspace interface links the key to a keyring associated with the process to prevent the key from going away, and returns the serial number of the key to the caller.h]hThe userspace interface links the key to a keyring associated with the process to prevent the key from going away, and returns the serial number of the key to the caller.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK?hhhhubh)}(hThe following example assumes that the key types involved don't define their own upcall mechanisms. If they do, then those should be substituted for the forking and execution of /sbin/request-key.h]hThe following example assumes that the key types involved don’t define their own upcall mechanisms. If they do, then those should be substituted for the forking and execution of /sbin/request-key.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKDhhhhubh)}(hhh](h)}(h The Processh]h The Process}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKJubh)}(h+A request proceeds in the following manner:h]h+A request proceeds in the following manner:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKLhjhhubh block_quote)}(hX1) Process A calls request_key() [the userspace syscall calls the kernel interface]. 2) request_key() searches the process's subscribed keyrings to see if there's a suitable key there. If there is, it returns the key. If there isn't, and callout_info is not set, an error is returned. Otherwise the process proceeds to the next step. 3) request_key() sees that A doesn't have the desired key yet, so it creates two things: a) An uninstantiated key U of requested type and description. b) An authorisation key V that refers to key U and notes that process A is the context in which key U should be instantiated and secured, and from which associated key requests may be satisfied. 4) request_key() then forks and executes /sbin/request-key with a new session keyring that contains a link to auth key V. 5) /sbin/request-key assumes the authority associated with key U. 6) /sbin/request-key execs an appropriate program to perform the actual instantiation. 7) The program may want to access another key from A's context (say a Kerberos TGT key). It just requests the appropriate key, and the keyring search notes that the session keyring has auth key V in its bottom level. This will permit it to then search the keyrings of process A with the UID, GID, groups and security info of process A as if it was process A, and come up with key W. 8) The program then does what it must to get the data with which to instantiate key U, using key W as a reference (perhaps it contacts a Kerberos server using the TGT) and then instantiates key U. 9) Upon instantiating key U, auth key V is automatically revoked so that it may not be used again. 10) The program then exits 0 and request_key() deletes key V and returns key U to the caller. h]henumerated_list)}(hhh](h list_item)}(hRProcess A calls request_key() [the userspace syscall calls the kernel interface]. h]h)}(hQProcess A calls request_key() [the userspace syscall calls the kernel interface].h]hQProcess A calls request_key() [the userspace syscall calls the kernel interface].}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKNhjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(hrequest_key() searches the process's subscribed keyrings to see if there's a suitable key there. If there is, it returns the key. If there isn't, and callout_info is not set, an error is returned. Otherwise the process proceeds to the next step. h]h)}(hrequest_key() searches the process's subscribed keyrings to see if there's a suitable key there. If there is, it returns the key. If there isn't, and callout_info is not set, an error is returned. Otherwise the process proceeds to the next step.h]hrequest_key() searches the process’s subscribed keyrings to see if there’s a suitable key there. If there is, it returns the key. If there isn’t, and callout_info is not set, an error is returned. Otherwise the process proceeds to the next step.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKQhjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(hXcrequest_key() sees that A doesn't have the desired key yet, so it creates two things: a) An uninstantiated key U of requested type and description. b) An authorisation key V that refers to key U and notes that process A is the context in which key U should be instantiated and secured, and from which associated key requests may be satisfied. h](h)}(hUrequest_key() sees that A doesn't have the desired key yet, so it creates two things:h]hWrequest_key() sees that A doesn’t have the desired key yet, so it creates two things:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKVhjubj)}(hXa) An uninstantiated key U of requested type and description. b) An authorisation key V that refers to key U and notes that process A is the context in which key U should be instantiated and secured, and from which associated key requests may be satisfied. h]j)}(hhh](j)}(h;An uninstantiated key U of requested type and description. h]h)}(h:An uninstantiated key U of requested type and description.h]h:An uninstantiated key U of requested type and description.}(hj8hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKYhj4ubah}(h]h ]h"]h$]h&]uh1jhj1ubj)}(hAn authorisation key V that refers to key U and notes that process A is the context in which key U should be instantiated and secured, and from which associated key requests may be satisfied. h]h)}(hAn authorisation key V that refers to key U and notes that process A is the context in which key U should be instantiated and secured, and from which associated key requests may be satisfied.h]hAn authorisation key V that refers to key U and notes that process A is the context in which key U should be instantiated and secured, and from which associated key requests may be satisfied.}(hjPhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK[hjLubah}(h]h ]h"]h$]h&]uh1jhj1ubeh}(h]h ]h"]h$]h&]enumtype loweralphaprefixhsuffix)uh1jhj-ubah}(h]h ]h"]h$]h&]uh1jhhhKYhjubeh}(h]h ]h"]h$]h&]uh1jhjubj)}(hwrequest_key() then forks and executes /sbin/request-key with a new session keyring that contains a link to auth key V. h]h)}(hvrequest_key() then forks and executes /sbin/request-key with a new session keyring that contains a link to auth key V.h]hvrequest_key() then forks and executes /sbin/request-key with a new session keyring that contains a link to auth key V.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK_hj{ubah}(h]h ]h"]h$]h&]uh1jhjubj)}(h?/sbin/request-key assumes the authority associated with key U. h]h)}(h>/sbin/request-key assumes the authority associated with key U.h]h>/sbin/request-key assumes the authority associated with key U.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKbhjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(hT/sbin/request-key execs an appropriate program to perform the actual instantiation. h]h)}(hS/sbin/request-key execs an appropriate program to perform the actual instantiation.h]hS/sbin/request-key execs an appropriate program to perform the actual instantiation.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKdhjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(hX~The program may want to access another key from A's context (say a Kerberos TGT key). It just requests the appropriate key, and the keyring search notes that the session keyring has auth key V in its bottom level. This will permit it to then search the keyrings of process A with the UID, GID, groups and security info of process A as if it was process A, and come up with key W. h](h)}(hThe program may want to access another key from A's context (say a Kerberos TGT key). It just requests the appropriate key, and the keyring search notes that the session keyring has auth key V in its bottom level.h]hThe program may want to access another key from A’s context (say a Kerberos TGT key). It just requests the appropriate key, and the keyring search notes that the session keyring has auth key V in its bottom level.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKghjubh)}(hThis will permit it to then search the keyrings of process A with the UID, GID, groups and security info of process A as if it was process A, and come up with key W.h]hThis will permit it to then search the keyrings of process A with the UID, GID, groups and security info of process A as if it was process A, and come up with key W.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKkhjubeh}(h]h ]h"]h$]h&]uh1jhjubj)}(hThe program then does what it must to get the data with which to instantiate key U, using key W as a reference (perhaps it contacts a Kerberos server using the TGT) and then instantiates key U. h]h)}(hThe program then does what it must to get the data with which to instantiate key U, using key W as a reference (perhaps it contacts a Kerberos server using the TGT) and then instantiates key U.h]hThe program then does what it must to get the data with which to instantiate key U, using key W as a reference (perhaps it contacts a Kerberos server using the TGT) and then instantiates key U.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKohjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(h`Upon instantiating key U, auth key V is automatically revoked so that it may not be used again. h]h)}(h_Upon instantiating key U, auth key V is automatically revoked so that it may not be used again.h]h_Upon instantiating key U, auth key V is automatically revoked so that it may not be used again.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKshjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(hZThe program then exits 0 and request_key() deletes key V and returns key U to the caller. h]h)}(hYThe program then exits 0 and request_key() deletes key V and returns key U to the caller.h]hYThe program then exits 0 and request_key() deletes key V and returns key U to the caller.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKvhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]jjarabicjlhjmjnuh1jhjubah}(h]h ]h"]h$]h&]uh1jhhhKNhjhhubh)}(hX7This also extends further. If key W (step 7 above) didn't exist, key W would be created uninstantiated, another auth key (X) would be created (as per step 3) and another copy of /sbin/request-key spawned (as per step 4); but the context specified by auth key X will still be process A, as it was in auth key V.h]hX9This also extends further. If key W (step 7 above) didn’t exist, key W would be created uninstantiated, another auth key (X) would be created (as per step 3) and another copy of /sbin/request-key spawned (as per step 4); but the context specified by auth key X will still be process A, as it was in auth key V.}(hj>hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKyhjhhubh)}(hThis is because process A's keyrings can't simply be attached to /sbin/request-key at the appropriate places because (a) execve will discard two of them, and (b) it requires the same UID/GID/Groups all the way through.h]hThis is because process A’s keyrings can’t simply be attached to /sbin/request-key at the appropriate places because (a) execve will discard two of them, and (b) it requires the same UID/GID/Groups all the way through.}(hjLhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubeh}(h] the-processah ]h"] the processah$]h&]uh1hhhhhhhhKJubh)}(hhh](h)}(h$Negative Instantiation And Rejectionh]h$Negative Instantiation And Rejection}(hjehhhNhNubah}(h]h ]h"]h$]h&]uh1hhjbhhhhhKubh)}(hXCRather than instantiating a key, it is possible for the possessor of an authorisation key to negatively instantiate a key that's under construction. This is a short duration placeholder that causes any attempt at re-requesting the key while it exists to fail with error ENOKEY if negated or the specified error if rejected.h]hXERather than instantiating a key, it is possible for the possessor of an authorisation key to negatively instantiate a key that’s under construction. This is a short duration placeholder that causes any attempt at re-requesting the key while it exists to fail with error ENOKEY if negated or the specified error if rejected.}(hjshhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjbhhubh)}(hThis is provided to prevent excessive repeated spawning of /sbin/request-key processes for a key that will never be obtainable.h]hThis is provided to prevent excessive repeated spawning of /sbin/request-key processes for a key that will never be obtainable.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjbhhubh)}(hShould the /sbin/request-key process exit anything other than 0 or die on a signal, the key under construction will be automatically negatively instantiated for a short amount of time.h]hShould the /sbin/request-key process exit anything other than 0 or die on a signal, the key under construction will be automatically negatively instantiated for a short amount of time.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjbhhubeh}(h]$negative-instantiation-and-rejectionah ]h"]$negative instantiation and rejectionah$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(hThe Search Algorithmh]hThe Search Algorithm}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKubh)}(hEA search of any particular keyring proceeds in the following fashion:h]hEA search of any particular keyring proceeds in the following fashion:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubj)}(hX1) When the key management code searches for a key (keyring_search_rcu) it firstly calls key_permission(SEARCH) on the keyring it's starting with, if this denies permission, it doesn't search further. 2) It considers all the non-keyring keys within that keyring and, if any key matches the criteria specified, calls key_permission(SEARCH) on it to see if the key is allowed to be found. If it is, that key is returned; if not, the search continues, and the error code is retained if of higher priority than the one currently set. 3) It then considers all the keyring-type keys in the keyring it's currently searching. It calls key_permission(SEARCH) on each keyring, and if this grants permission, it recurses, executing steps (2) and (3) on that keyring. h]j)}(hhh](j)}(hWhen the key management code searches for a key (keyring_search_rcu) it firstly calls key_permission(SEARCH) on the keyring it's starting with, if this denies permission, it doesn't search further. h]h)}(hWhen the key management code searches for a key (keyring_search_rcu) it firstly calls key_permission(SEARCH) on the keyring it's starting with, if this denies permission, it doesn't search further.h]hWhen the key management code searches for a key (keyring_search_rcu) it firstly calls key_permission(SEARCH) on the keyring it’s starting with, if this denies permission, it doesn’t search further.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(hXGIt considers all the non-keyring keys within that keyring and, if any key matches the criteria specified, calls key_permission(SEARCH) on it to see if the key is allowed to be found. If it is, that key is returned; if not, the search continues, and the error code is retained if of higher priority than the one currently set. h]h)}(hXFIt considers all the non-keyring keys within that keyring and, if any key matches the criteria specified, calls key_permission(SEARCH) on it to see if the key is allowed to be found. If it is, that key is returned; if not, the search continues, and the error code is retained if of higher priority than the one currently set.h]hXFIt considers all the non-keyring keys within that keyring and, if any key matches the criteria specified, calls key_permission(SEARCH) on it to see if the key is allowed to be found. If it is, that key is returned; if not, the search continues, and the error code is retained if of higher priority than the one currently set.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(hIt then considers all the keyring-type keys in the keyring it's currently searching. It calls key_permission(SEARCH) on each keyring, and if this grants permission, it recurses, executing steps (2) and (3) on that keyring. h]h)}(hIt then considers all the keyring-type keys in the keyring it's currently searching. It calls key_permission(SEARCH) on each keyring, and if this grants permission, it recurses, executing steps (2) and (3) on that keyring.h]hIt then considers all the keyring-type keys in the keyring it’s currently searching. It calls key_permission(SEARCH) on each keyring, and if this grants permission, it recurses, executing steps (2) and (3) on that keyring.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]jjj7jlhjmjnuh1jhjubah}(h]h ]h"]h$]h&]uh1jhhhKhjhhubh)}(hThe process stops immediately a valid key is found with permission granted to use it. Any error from a previous match attempt is discarded and the key is returned.h]hThe process stops immediately a valid key is found with permission granted to use it. Any error from a previous match attempt is discarded and the key is returned.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(huWhen request_key() is invoked, if CONFIG_KEYS_REQUEST_CACHE=y, a per-task one-key cache is first checked for a match.h]huWhen request_key() is invoked, if CONFIG_KEYS_REQUEST_CACHE=y, a per-task one-key cache is first checked for a match.}(hj-hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(haWhen search_process_keyrings() is invoked, it performs the following searches until one succeeds:h]haWhen search_process_keyrings() is invoked, it performs the following searches until one succeeds:}(hj;hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubj)}(hX1) If extant, the process's thread keyring is searched. 2) If extant, the process's process keyring is searched. 3) The process's session keyring is searched. 4) If the process has assumed the authority associated with a request_key() authorisation key then: a) If extant, the calling process's thread keyring is searched. b) If extant, the calling process's process keyring is searched. c) The calling process's session keyring is searched. h]j)}(hhh](j)}(h5If extant, the process's thread keyring is searched. h]h)}(h4If extant, the process's thread keyring is searched.h]h6If extant, the process’s thread keyring is searched.}(hjThhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjPubah}(h]h ]h"]h$]h&]uh1jhjMubj)}(h6If extant, the process's process keyring is searched. h]h)}(h5If extant, the process's process keyring is searched.h]h7If extant, the process’s process keyring is searched.}(hjlhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhubah}(h]h ]h"]h$]h&]uh1jhjMubj)}(h+The process's session keyring is searched. h]h)}(h*The process's session keyring is searched.h]h,The process’s session keyring is searched.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jhjMubj)}(hXIf the process has assumed the authority associated with a request_key() authorisation key then: a) If extant, the calling process's thread keyring is searched. b) If extant, the calling process's process keyring is searched. c) The calling process's session keyring is searched. h](h)}(h`If the process has assumed the authority associated with a request_key() authorisation key then:h]h`If the process has assumed the authority associated with a request_key() authorisation key then:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubj)}(ha) If extant, the calling process's thread keyring is searched. b) If extant, the calling process's process keyring is searched. c) The calling process's session keyring is searched. h]j)}(hhh](j)}(h=If extant, the calling process's thread keyring is searched. h]h)}(hIf extant, the calling process’s thread keyring is searched.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(h>If extant, the calling process's process keyring is searched. h]h)}(h=If extant, the calling process's process keyring is searched.h]h?If extant, the calling process’s process keyring is searched.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(h3The calling process's session keyring is searched. h]h)}(h2The calling process's session keyring is searched.h]h4The calling process’s session keyring is searched.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]jjjkjlhjmjnuh1jhjubah}(h]h ]h"]h$]h&]uh1jhhhKhjubeh}(h]h ]h"]h$]h&]uh1jhjMubeh}(h]h ]h"]h$]h&]jjj7jlhjmjnuh1jhjIubah}(h]h ]h"]h$]h&]uh1jhhhKhjhhubh)}(hX The moment one succeeds, all pending errors are discarded and the found key is returned. If CONFIG_KEYS_REQUEST_CACHE=y, then that key is placed in the per-task cache, displacing the previous key. The cache is cleared on exit or just prior to resumption of userspace.h]hX The moment one succeeds, all pending errors are discarded and the found key is returned. If CONFIG_KEYS_REQUEST_CACHE=y, then that key is placed in the per-task cache, displacing the previous key. The cache is cleared on exit or just prior to resumption of userspace.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hOnly if all these fail does the whole thing fail with the highest priority error. Note that several errors may have come from LSM.h]hOnly if all these fail does the whole thing fail with the highest priority error. Note that several errors may have come from LSM.}(hj%hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hThe error priority is::h]hThe error priority is:}(hj3hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(h"EKEYREVOKED > EKEYEXPIRED > ENOKEYh]h"EKEYREVOKED > EKEYEXPIRED > ENOKEY}hjAsbah}(h]h ]h"]h$]h&]hhuh1hhhhKhjhhubh)}(hEACCES/EPERM are only returned on a direct search of a specific keyring where the basal keyring does not grant Search permission.h]hEACCES/EPERM are only returned on a direct search of a specific keyring where the basal keyring does not grant Search permission.}(hjOhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubeh}(h]the-search-algorithmah ]h"]the search algorithmah$]h&]uh1hhhhhhhhKubeh}(h]key-request-serviceah ]h"]key request serviceah$]h&]uh1hhhhhhhhKubeh}(h]h ]h"]h$]h&]sourcehuh1hcurrent_sourceN current_lineNsettingsdocutils.frontendValues)}(hN generatorN datestampN source_linkN source_urlN toc_backlinksentryfootnote_backlinksK sectnum_xformKstrip_commentsNstrip_elements_with_classesN strip_classesN report_levelK halt_levelKexit_status_levelKdebugNwarning_streamN tracebackinput_encoding utf-8-siginput_encoding_error_handlerstrictoutput_encodingutf-8output_encoding_error_handlerjerror_encodingutf-8error_encoding_error_handlerbackslashreplace language_codeenrecord_dependenciesNconfigN id_prefixhauto_id_prefixid dump_settingsNdump_internalsNdump_transformsNdump_pseudo_xmlNexpose_internalsNstrict_visitorN_disable_configN_sourceh _destinationN _config_files]7/var/lib/git/docbuild/linux/Documentation/docutils.confafile_insertion_enabled raw_enabledKline_length_limitM'pep_referencesN pep_base_urlhttps://peps.python.org/pep_file_url_templatepep-%04drfc_referencesN rfc_base_url&https://datatracker.ietf.org/doc/html/ tab_widthKtrim_footnote_reference_spacesyntax_highlightlong smart_quotessmartquotes_locales]character_level_inline_markupdoctitle_xform docinfo_xformKsectsubtitle_xform image_loadinglinkembed_stylesheetcloak_email_addressessection_self_linkenvNubreporterNindirect_targets]substitution_defs}substitution_names}refnames}refids}nameids}(jjjgj_j\jjjbj_u nametypes}(jjj_jjbuh}(jghj\jjjbj_ju footnote_refs} citation_refs} autofootnotes]autofootnote_refs]symbol_footnotes]symbol_footnote_refs] footnotes] citations]autofootnote_startKsymbol_footnote_startK id_counter collectionsCounter}Rparse_messages]transform_messages] transformerN include_log] decorationNhhub.