2016-11-01 15:44:54 +00:00
|
|
|
.\"
|
|
|
|
.\" Copyright (C) 2014 Red Hat, Inc. All Rights Reserved.
|
|
|
|
.\" Written by David Howells (dhowells@redhat.com)
|
|
|
|
.\"
|
2016-11-02 11:24:22 +00:00
|
|
|
.\" %%%LICENSE_START(GPLv2+_SW_ONEPARA)
|
2016-11-01 15:44:54 +00:00
|
|
|
.\" This program is free software; you can redistribute it and/or
|
|
|
|
.\" modify it under the terms of the GNU General Public Licence
|
|
|
|
.\" as published by the Free Software Foundation; either version
|
|
|
|
.\" 2 of the Licence, or (at your option) any later version.
|
2016-11-02 11:24:22 +00:00
|
|
|
.\" %%%LICENSE_END
|
2016-11-01 15:44:54 +00:00
|
|
|
.\"
|
2016-11-01 17:16:43 +00:00
|
|
|
.TH "SESSION-KEYRING" 7 2016-11-01 Linux "Linux Programmer's Manual"
|
2016-11-01 15:44:54 +00:00
|
|
|
.SH NAME
|
2016-11-01 17:26:22 +00:00
|
|
|
session-keyring \- session shared process keyring
|
2016-11-01 15:44:54 +00:00
|
|
|
.SH DESCRIPTION
|
2016-11-01 18:08:09 +00:00
|
|
|
The session keyring is a keyring used to anchor keys on behalf of a process.
|
|
|
|
It is typically created by
|
|
|
|
.BR pam_keyinit (8)
|
2016-11-01 17:45:14 +00:00
|
|
|
when a user logs in and a link will be
|
2016-11-01 18:08:09 +00:00
|
|
|
added that refers to the
|
|
|
|
.BR user-keyring (7).
|
2016-11-01 15:44:54 +00:00
|
|
|
.P
|
|
|
|
A special serial number value, \fBKEY_SPEC_SESSION_KEYRING\fP, is defined that
|
|
|
|
can be used in lieu of the calling process's session keyring's actual serial
|
|
|
|
number.
|
|
|
|
.P
|
|
|
|
From the keyctl utility, '\fB@s\fP' can be used instead of a numeric key ID in
|
|
|
|
much the same way.
|
|
|
|
.P
|
2016-11-01 18:08:09 +00:00
|
|
|
A process's session keyring is inherited across
|
|
|
|
.BR clone (2),
|
|
|
|
.BR fork (2),
|
|
|
|
and
|
|
|
|
.BR vfork (2)
|
|
|
|
and
|
|
|
|
is retained across
|
|
|
|
.BR execve (2)
|
|
|
|
- even when the target executable is setuid or
|
2016-11-01 17:45:14 +00:00
|
|
|
setgid.
|
|
|
|
The session keyring will be destroyed when the last process that
|
2016-11-01 15:44:54 +00:00
|
|
|
refers to it exits.
|
|
|
|
.P
|
|
|
|
If a process doesn't have a session keyring when it is accessed, then, under
|
|
|
|
certain circumstances, the \fBuser session keyring\fR will be attached as the
|
|
|
|
session keyring and under others a new session keyring will be created.
|
2016-11-01 20:45:39 +00:00
|
|
|
.SS Special operations
|
2016-11-01 15:44:54 +00:00
|
|
|
The keyutils library provides a number of special operations for manipulating
|
|
|
|
session keyrings:
|
2016-11-02 02:52:46 +00:00
|
|
|
.TP
|
|
|
|
.BR keyctl_join_session_keyring (3)
|
2016-11-01 17:45:14 +00:00
|
|
|
This operation allows the caller to change their session keyring.
|
|
|
|
The caller can join an existing keyring by name,
|
|
|
|
create a new keyring of the name given or
|
2016-11-01 15:44:54 +00:00
|
|
|
ask the kernel to create a new session keyring with the name "_ses".
|
2016-11-02 02:52:46 +00:00
|
|
|
.TP
|
|
|
|
.BR keyctl_session_to_parent (3)
|
2016-11-01 15:44:54 +00:00
|
|
|
This operation allows the caller to set the parent process's session keyring to
|
2016-11-01 17:45:14 +00:00
|
|
|
the same as their own.
|
|
|
|
For this to succeed, the parent process must have
|
2016-11-01 15:44:54 +00:00
|
|
|
identical security attributes and must be single threaded.
|
|
|
|
.P
|
|
|
|
These operations are also exposed through the keyctl utility as:
|
|
|
|
.P
|
|
|
|
.RS
|
|
|
|
\fBkeyctl\fP session
|
|
|
|
.br
|
|
|
|
\fBkeyctl\fP session - [<prog> <arg1> <arg2> ...]
|
|
|
|
.br
|
|
|
|
\fBkeyctl\fP session <name> [<prog> <arg1> <arg2> ...]
|
|
|
|
.RE
|
|
|
|
.P
|
|
|
|
and:
|
|
|
|
.P
|
|
|
|
.RS
|
|
|
|
\fBkeyctl\fP new_session
|
|
|
|
.RE
|
|
|
|
.SH SEE ALSO
|
2016-11-01 17:12:21 +00:00
|
|
|
.ad l
|
|
|
|
.nh
|
2016-11-01 15:44:54 +00:00
|
|
|
.BR keyctl (1),
|
|
|
|
.BR keyctl (3),
|
|
|
|
.BR keyctl_join_session_keyring (3),
|
|
|
|
.BR keyctl_session_to_parent (3),
|
|
|
|
.BR keyrings (7),
|
2016-11-01 17:12:21 +00:00
|
|
|
.BR persistent\-keyring (7),
|
|
|
|
.BR process\-keyring (7),
|
|
|
|
.BR thread\-keyring (7),
|
|
|
|
.BR user\-keyring (7),
|
|
|
|
.BR user\-session\-keyring (7),
|
|
|
|
.BR pam_keyinit (8)
|