man-pages/man7/session-keyring.7.html
2021-03-31 01:06:50 +01:00

193 lines
5.4 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML><HEAD><TITLE>Man page of SESSION-KEYRING</TITLE>
</HEAD><BODY>
<H1>SESSION-KEYRING</H1>
Section: Linux Programmer's Manual (7)<BR>Updated: 2017-09-15<BR><A HREF="#index">Index</A>
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
<A NAME="lbAB">&nbsp;</A>
<H2>NAME</H2>
session-keyring - session shared process keyring
<A NAME="lbAC">&nbsp;</A>
<H2>DESCRIPTION</H2>
The session keyring is a keyring used to anchor keys on behalf of a process.
It is typically created by
<B><A HREF="/cgi-bin/man/man2html?8+pam_keyinit">pam_keyinit</A></B>(8)
when a user logs in and a link will be added that refers to the
<B><A HREF="/cgi-bin/man/man2html?7+user-keyring">user-keyring</A></B>(7).
Optionally, PAM may revoke the session keyring on logout.
(In typical configurations, PAM does do this revocation.)
The session keyring has the name (description)
<I>_ses</I>.
<P>
A special serial number value,
<B>KEY_SPEC_SESSION_KEYRING</B>,
is defined that can be used in lieu of the actual serial number of
the calling process's session keyring.
<P>
From the
<B><A HREF="/cgi-bin/man/man2html?1+keyctl">keyctl</A></B>(1)
utility, '<B>@s</B>' can be used instead of a numeric key ID in
much the same way.
<P>
A process's session keyring is inherited across
<B><A HREF="/cgi-bin/man/man2html?2+clone">clone</A></B>(2),
<B><A HREF="/cgi-bin/man/man2html?2+fork">fork</A></B>(2),
and
<B><A HREF="/cgi-bin/man/man2html?2+vfork">vfork</A></B>(2).
The session keyring
is preserved across
<B><A HREF="/cgi-bin/man/man2html?2+execve">execve</A></B>(2),
even when the executable is set-user-ID or set-group-ID or has capabilities.
The session keyring is destroyed when the last process that
refers to it exits.
<P>
If a process doesn't have a session keyring when it is accessed, then,
under certain circumstances, the
<B><A HREF="/cgi-bin/man/man2html?7+user-session-keyring">user-session-keyring</A></B>(7)
will be attached as the session keyring
and under others a new session keyring will be created.
(See
<B><A HREF="/cgi-bin/man/man2html?7+user-session-keyring">user-session-keyring</A></B>(7)
for further details.)
<A NAME="lbAD">&nbsp;</A>
<H3>Special operations</H3>
The
<I>keyutils</I>
library provides the following special operations for manipulating
session keyrings:
<DL COMPACT>
<DT id="1"><B><A HREF="/cgi-bin/man/man2html?3+keyctl_join_session_keyring">keyctl_join_session_keyring</A></B>(3)
<DD>
This operation allows the caller to change the session keyring
that it subscribes to.
The caller can join an existing keyring with a specified name (description),
create a new keyring with a given name,
or ask the kernel to create a new &quot;anonymous&quot;
session keyring with the name &quot;_ses&quot;.
(This function is an interface to the
<B><A HREF="/cgi-bin/man/man2html?2+keyctl">keyctl</A></B>(2)
<B>KEYCTL_JOIN_SESSION_KEYRING</B>
operation.)
<DT id="2"><B><A HREF="/cgi-bin/man/man2html?3+keyctl_session_to_parent">keyctl_session_to_parent</A></B>(3)
<DD>
This operation allows the caller to make the parent process's
session keyring to the same as its own.
For this to succeed, the parent process must have
identical security attributes and must be single threaded.
(This function is an interface to the
<B><A HREF="/cgi-bin/man/man2html?2+keyctl">keyctl</A></B>(2)
<B>KEYCTL_SESSION_TO_PARENT</B>
operation.)
</DL>
<P>
These operations are also exposed through the
<B><A HREF="/cgi-bin/man/man2html?1+keyctl">keyctl</A></B>(1)
utility as:
<P>
keyctl session
keyctl session - [&lt;prog&gt; &lt;arg1&gt; &lt;arg2&gt; ...]
keyctl session &lt;name&gt; [&lt;prog&gt; &lt;arg1&gt; &lt;arg2&gt; ...]
<P>
and:
<P>
keyctl new_session
<A NAME="lbAE">&nbsp;</A>
<H2>SEE ALSO</H2>
<B><A HREF="/cgi-bin/man/man2html?1+keyctl">keyctl</A></B>(1),
<B><A HREF="/cgi-bin/man/man2html?3+keyctl">keyctl</A></B>(3),
<B><A HREF="/cgi-bin/man/man2html?3+keyctl_join_session_keyring">keyctl_join_session_keyring</A></B>(3),
<B><A HREF="/cgi-bin/man/man2html?3+keyctl_session_to_parent">keyctl_session_to_parent</A></B>(3),
<B><A HREF="/cgi-bin/man/man2html?7+keyrings">keyrings</A></B>(7),
<B><A HREF="/cgi-bin/man/man2html?7+persistent-keyring">persistent-keyring</A></B>(7),
<B><A HREF="/cgi-bin/man/man2html?7+process-keyring">process-keyring</A></B>(7),
<B><A HREF="/cgi-bin/man/man2html?7+thread-keyring">thread-keyring</A></B>(7),
<B><A HREF="/cgi-bin/man/man2html?7+user-keyring">user-keyring</A></B>(7),
<B><A HREF="/cgi-bin/man/man2html?7+user-session-keyring">user-session-keyring</A></B>(7),
<B><A HREF="/cgi-bin/man/man2html?8+pam_keyinit">pam_keyinit</A></B>(8)
<A NAME="lbAF">&nbsp;</A>
<H2>COLOPHON</H2>
This page is part of release 5.05 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
<A HREF="https://www.kernel.org/doc/man-pages/.">https://www.kernel.org/doc/man-pages/.</A>
<P>
<HR>
<A NAME="index">&nbsp;</A><H2>Index</H2>
<DL>
<DT id="3"><A HREF="#lbAB">NAME</A><DD>
<DT id="4"><A HREF="#lbAC">DESCRIPTION</A><DD>
<DL>
<DT id="5"><A HREF="#lbAD">Special operations</A><DD>
</DL>
<DT id="6"><A HREF="#lbAE">SEE ALSO</A><DD>
<DT id="7"><A HREF="#lbAF">COLOPHON</A><DD>
</DL>
<HR>
This document was created by
<A HREF="/cgi-bin/man/man2html">man2html</A>,
using the manual pages.<BR>
Time: 00:06:09 GMT, March 31, 2021
</BODY>
</HTML>