1SESSION-KEYRING(7)         Linux Programmer's Manual        SESSION-KEYRING(7)
2
3
4

NAME

6       session-keyring - session shared process keyring
7

DESCRIPTION

9       The  session  keyring  is  a keyring used to anchor keys on behalf of a
10       process.  It is typically created by pam_keyinit(8) when a user logs in
11       and  a  link will be added that refers to the user-keyring(7).  Option‐
12       ally, PAM may revoke the session keyring on logout.  (In  typical  con‐
13       figurations, PAM does do this revocation.)  The session keyring has the
14       name (description) _ses.
15
16       A special serial number  value,  KEY_SPEC_SESSION_KEYRING,  is  defined
17       that  can  be  used  in lieu of the actual serial number of the calling
18       process's session keyring.
19
20       From the keyctl(1) utility, '@s' can be used instead of a  numeric  key
21       ID in much the same way.
22
23       A  process's session keyring is inherited across clone(2), fork(2), and
24       vfork(2).  The session keyring is preserved across execve(2), even when
25       the executable is set-user-ID or set-group-ID or has capabilities.  The
26       session keyring is destroyed when the last process that  refers  to  it
27       exits.
28
29       If  a process doesn't have a session keyring when it is accessed, then,
30       under  certain  circumstances,  the  user-session-keyring(7)  will   be
31       attached  as the session keyring and under others a new session keyring
32       will be created.  (See user-session-keyring(7) for further details.)
33
34   Special operations
35       The keyutils library provides  the  following  special  operations  for
36       manipulating session keyrings:
37
38       keyctl_join_session_keyring(3)
39              This  operation  allows the caller to change the session keyring
40              that it subscribes to.  The caller can join an existing  keyring
41              with a specified name (description), create a new keyring with a
42              given name, or ask the kernel to create a new  "anonymous"  ses‐
43              sion  keyring with the name "_ses".  (This function is an inter‐
44              face to the keyctl(2) KEYCTL_JOIN_SESSION_KEYRING operation.)
45
46       keyctl_session_to_parent(3)
47              This operation allows the caller to make  the  parent  process's
48              session  keyring  to  the same as its own.  For this to succeed,
49              the parent process must have identical security  attributes  and
50              must  be single threaded.  (This function is an interface to the
51              keyctl(2) KEYCTL_SESSION_TO_PARENT operation.)
52
53       These operations are also exposed through the keyctl(1) utility as:
54
55           keyctl session
56           keyctl session - [<prog> <arg1> <arg2> ...]
57           keyctl session <name> [<prog> <arg1> <arg2> ...]
58
59       and:
60
61           keyctl new_session
62

SEE ALSO

64       keyctl(1), keyctl(3), keyctl_join_session_keyring(3),
65       keyctl_session_to_parent(3), keyrings(7), persistent-keyring(7),
66       process-keyring(7), thread-keyring(7), user-keyring(7),
67       user-session-keyring(7), pam_keyinit(8)
68

COLOPHON

70       This page is part of release 4.15 of the Linux man-pages project.  A
71       description of the project, information about reporting bugs, and the
72       latest version of this page, can be found at
73       https://www.kernel.org/doc/man-pages/.
74
75
76
77Linux                             2017-09-15                SESSION-KEYRING(7)
Impressum