share/mk/: Fix includes
[man-pages.git] / man7 / session-keyring.7
blobd54007ee1800e9ea443a06f57ceca5e29ace5600
1 .\" Copyright (C) 2014 Red Hat, Inc. All Rights Reserved.
2 .\" Written by David Howells (dhowells@redhat.com)
3 .\"
4 .\" SPDX-License-Identifier: GPL-2.0-or-later
5 .\"
6 .TH session-keyring 7 (date) "Linux man-pages (unreleased)"
7 .SH NAME
8 session-keyring \- session shared process keyring
9 .SH DESCRIPTION
10 The session keyring is a keyring used to anchor keys on behalf of a process.
11 It is typically created by
12 .BR pam_keyinit (8)
13 when a user logs in and a link will be added that refers to the
14 .BR user\-keyring (7).
15 Optionally,
16 .BR PAM (7)
17 may revoke the session keyring on logout.
18 (In typical configurations, PAM does do this revocation.)
19 The session keyring has the name (description)
20 .IR _ses .
22 A special serial number value,
23 .BR KEY_SPEC_SESSION_KEYRING ,
24 is defined that can be used in lieu of the actual serial number of
25 the calling process's session keyring.
27 From the
28 .BR keyctl (1)
29 utility, '\fB@s\fP' can be used instead of a numeric key ID in
30 much the same way.
32 A process's session keyring is inherited across
33 .BR clone (2),
34 .BR fork (2),
35 and
36 .BR vfork (2).
37 The session keyring
38 is preserved across
39 .BR execve (2),
40 even when the executable is set-user-ID or set-group-ID or has capabilities.
41 The session keyring is destroyed when the last process that
42 refers to it exits.
44 If a process doesn't have a session keyring when it is accessed, then,
45 under certain circumstances, the
46 .BR user\-session\-keyring (7)
47 will be attached as the session keyring
48 and under others a new session keyring will be created.
49 (See
50 .BR user\-session\-keyring (7)
51 for further details.)
52 .SS Special operations
53 The
54 .I keyutils
55 library provides the following special operations for manipulating
56 session keyrings:
57 .TP
58 .BR keyctl_join_session_keyring (3)
59 This operation allows the caller to change the session keyring
60 that it subscribes to.
61 The caller can join an existing keyring with a specified name (description),
62 create a new keyring with a given name,
63 or ask the kernel to create a new "anonymous"
64 session keyring with the name "_ses".
65 (This function is an interface to the
66 .BR keyctl (2)
67 .B KEYCTL_JOIN_SESSION_KEYRING
68 operation.)
69 .TP
70 .BR keyctl_session_to_parent (3)
71 This operation allows the caller to make the parent process's
72 session keyring to the same as its own.
73 For this to succeed, the parent process must have
74 identical security attributes and must be single threaded.
75 (This function is an interface to the
76 .BR keyctl (2)
77 .B KEYCTL_SESSION_TO_PARENT
78 operation.)
80 These operations are also exposed through the
81 .BR keyctl (1)
82 utility as:
84 .in +4n
85 .EX
86 keyctl session
87 keyctl session \- [<prog> <arg1> <arg2> ...]
88 keyctl session <name> [<prog> <arg1> <arg2> ...]
89 .EE
90 .in
92 and:
94 .in +4n
95 .EX
96 keyctl new_session
97 .EE
98 .in
99 .SH SEE ALSO
100 .ad l
102 .BR keyctl (1),
103 .BR keyctl (3),
104 .BR keyctl_join_session_keyring (3),
105 .BR keyctl_session_to_parent (3),
106 .BR keyrings (7),
107 .BR PAM (7),
108 .BR persistent\-keyring (7),
109 .BR process\-keyring (7),
110 .BR thread\-keyring (7),
111 .BR user\-keyring (7),
112 .BR user\-session\-keyring (7),
113 .BR pam_keyinit (8)