{"id":4113,"date":"2022-12-20T17:39:25","date_gmt":"2022-12-20T20:39:25","guid":{"rendered":"http:\/\/lode.uno\/linux-man\/index.php\/2022\/12\/20\/thread-keyring-man7\/"},"modified":"2022-12-20T17:39:25","modified_gmt":"2022-12-20T20:39:25","slug":"thread-keyring-man7","status":"publish","type":"post","link":"https:\/\/lode.uno\/linux-man\/2022\/12\/20\/thread-keyring-man7\/","title":{"rendered":"THREAD-KEYRING (man7)"},"content":{"rendered":"<h1 align=\"center\">THREAD-KEYRING<\/h1>\n<p> <a href=\"#NAME\">NAME<\/a><br \/> <a href=\"#DESCRIPTION\">DESCRIPTION<\/a><br \/> <a href=\"#SEE ALSO\">SEE ALSO<\/a><br \/> <a href=\"#COLOPHON\">COLOPHON<\/a> <\/p>\n<hr>\n<h2>NAME <a name=\"NAME\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">thread-keyring \u2212 per-thread keyring<\/p>\n<h2>DESCRIPTION <a name=\"DESCRIPTION\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">The thread keyring is a keyring used to anchor keys on behalf of a process. It is created only when a thread requests it. The thread keyring has the name (description) <i>_tid<\/i>.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">A special serial number value, <b>KEY_SPEC_THREAD_KEYRING<\/b>, is defined that can be used in lieu of the actual serial number of the calling thread\u2019s thread keyring.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">From the <b>keyctl<\/b>(1) utility, \u2019<b>@t<\/b>\u2019 can be used instead of a numeric key ID in much the same way, but as <b>keyctl<\/b>(1) is a program run after forking, this is of no utility.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Thread keyrings are not inherited across <b>clone<\/b>(2) and <b>fork<\/b>(2) and are cleared by <b>execve<\/b>(2). A thread keyring is destroyed when the thread that refers to it terminates.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Initially, a thread does not have a thread keyring. If a thread doesn\u2019t have a thread keyring when it is accessed, then it will be created if it is to be modified; otherwise the operation fails with the error <b>ENOKEY<\/b>.<\/p>\n<h2>SEE ALSO <a name=\"SEE ALSO\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>keyctl<\/b>(1), <b>keyctl<\/b>(3), <b>keyrings<\/b>(7), <b>persistent\u2212keyring<\/b>(7), <b>process\u2212keyring<\/b>(7), <b>session\u2212keyring<\/b>(7), <b>user\u2212keyring<\/b>(7), <b>user\u2212session\u2212keyring<\/b>(7)<\/p>\n<h2>COLOPHON <a name=\"COLOPHON\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">This page is part of release 5.10 of the Linux <i>man-pages<\/i> project. A description of the project, information about reporting bugs, and the latest version of this page, can be found at https:\/\/www.kernel.org\/doc\/man\u2212pages\/.<\/p>\n<hr>\n","protected":false},"excerpt":{"rendered":"<p>  thread-keyring \u2212 per-thread keyring <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[971],"tags":[973,972,1192],"class_list":["post-4113","post","type-post","status-publish","format-standard","hentry","category-7-miscelanea","tag-973","tag-man7","tag-thread-keyring"],"gutentor_comment":0,"_links":{"self":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/4113","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/comments?post=4113"}],"version-history":[{"count":0,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/4113\/revisions"}],"wp:attachment":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/media?parent=4113"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/categories?post=4113"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/tags?post=4113"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}