2016-11-01 15:45:33 +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:45:33 +00:00
|
|
|
.\" This program is free software; you can redistribute it and/or
|
2016-11-08 08:24:22 +00:00
|
|
|
.\" modify it under the terms of the GNU General Public License
|
2016-11-01 15:45:33 +00:00
|
|
|
.\" as published by the Free Software Foundation; either version
|
2016-11-08 08:24:22 +00:00
|
|
|
.\" 2 of the License, or (at your option) any later version.
|
2016-11-02 11:24:22 +00:00
|
|
|
.\" %%%LICENSE_END
|
2016-11-01 15:45:33 +00:00
|
|
|
.\"
|
2019-09-27 12:04:48 +00:00
|
|
|
.TH USER-SESSION-KEYRING 7 2017-03-13 Linux "Linux Programmer's Manual"
|
2016-11-01 15:45:33 +00:00
|
|
|
.SH NAME
|
2016-11-01 17:26:22 +00:00
|
|
|
user-session-keyring \- per-user default session keyring
|
2016-11-01 15:45:33 +00:00
|
|
|
.SH DESCRIPTION
|
2016-11-01 18:08:09 +00:00
|
|
|
The user session keyring is a keyring used to anchor keys on behalf of a user.
|
2016-11-02 22:15:22 +00:00
|
|
|
Each UID the kernel deals with has its own user session keyring that
|
|
|
|
is shared by all processes with that UID.
|
2016-11-07 21:55:11 +00:00
|
|
|
The user session keyring has a name (description) of the form
|
|
|
|
.I _uid_ses.<UID>
|
|
|
|
where
|
|
|
|
.I <UID>
|
|
|
|
is the user ID of the corresponding user.
|
aio.7, arp.7, attributes.7, boot.7, cgroups.7, cpuset.7, credentials.7, fanotify.7, fifo.7, glob.7, hier.7, hostname.7, icmp.7, inode.7, inotify.7, keyrings.7, libc.7, mailaddr.7, mount_namespaces.7, mq_overview.7, nptl.7, numa.7, path_resolution.7, persistent-keyring.7, pid_namespaces.7, pipe.7, pkeys.7, process-keyring.7, pthreads.7, pty.7, random.7, sched.7, sem_overview.7, session-keyring.7, shm_overview.7, signal-safety.7, signal.7, spufs.7, standards.7, symlink.7, termio.7, thread-keyring.7, time.7, unicode.7, user-keyring.7, user-session-keyring.7, user_namespaces.7, utf-8.7, xattr.7: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-17 22:59:04 +00:00
|
|
|
.PP
|
2016-11-02 22:15:22 +00:00
|
|
|
The user session keyring is associated with the record that
|
|
|
|
the kernel maintains for the UID.
|
|
|
|
It comes into existence upon the first attempt to access either the
|
|
|
|
user session keyring, the
|
|
|
|
.BR user-keyring (7),
|
|
|
|
or the
|
|
|
|
.BR session-keyring (7).
|
|
|
|
.\" Davis Howells: the user and user-session keyrings are managed as a pair.
|
|
|
|
The keyring remains pinned in existence so long as there are processes
|
|
|
|
running with that real UID or files opened by those processes remain open.
|
|
|
|
(The keyring can also be pinned indefinitely by linking it
|
|
|
|
into another keyring.)
|
aio.7, arp.7, attributes.7, boot.7, cgroups.7, cpuset.7, credentials.7, fanotify.7, fifo.7, glob.7, hier.7, hostname.7, icmp.7, inode.7, inotify.7, keyrings.7, libc.7, mailaddr.7, mount_namespaces.7, mq_overview.7, nptl.7, numa.7, path_resolution.7, persistent-keyring.7, pid_namespaces.7, pipe.7, pkeys.7, process-keyring.7, pthreads.7, pty.7, random.7, sched.7, sem_overview.7, session-keyring.7, shm_overview.7, signal-safety.7, signal.7, spufs.7, standards.7, symlink.7, termio.7, thread-keyring.7, time.7, unicode.7, user-keyring.7, user-session-keyring.7, user_namespaces.7, utf-8.7, xattr.7: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-17 22:59:04 +00:00
|
|
|
.PP
|
2016-11-01 17:45:14 +00:00
|
|
|
The user session keyring is created on demand when a thread requests it
|
2016-11-01 18:08:09 +00:00
|
|
|
or when a thread asks for its
|
|
|
|
.BR session-keyring (7)
|
2016-11-02 14:25:57 +00:00
|
|
|
and that keyring doesn't exist.
|
|
|
|
In the latter case, a user session keyring will be created and,
|
|
|
|
if the session keyring wasn't to be created,
|
|
|
|
the user session keyring will be set as the process's actual session keyring.
|
aio.7, arp.7, attributes.7, boot.7, cgroups.7, cpuset.7, credentials.7, fanotify.7, fifo.7, glob.7, hier.7, hostname.7, icmp.7, inode.7, inotify.7, keyrings.7, libc.7, mailaddr.7, mount_namespaces.7, mq_overview.7, nptl.7, numa.7, path_resolution.7, persistent-keyring.7, pid_namespaces.7, pipe.7, pkeys.7, process-keyring.7, pthreads.7, pty.7, random.7, sched.7, sem_overview.7, session-keyring.7, shm_overview.7, signal-safety.7, signal.7, spufs.7, standards.7, symlink.7, termio.7, thread-keyring.7, time.7, unicode.7, user-keyring.7, user-session-keyring.7, user_namespaces.7, utf-8.7, xattr.7: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-17 22:59:04 +00:00
|
|
|
.PP
|
2016-11-02 02:52:46 +00:00
|
|
|
The user session keyring is searched by
|
|
|
|
.BR request_key (2)
|
2016-11-02 14:25:57 +00:00
|
|
|
if the actual session keyring does not exist and is ignored otherwise.
|
aio.7, arp.7, attributes.7, boot.7, cgroups.7, cpuset.7, credentials.7, fanotify.7, fifo.7, glob.7, hier.7, hostname.7, icmp.7, inode.7, inotify.7, keyrings.7, libc.7, mailaddr.7, mount_namespaces.7, mq_overview.7, nptl.7, numa.7, path_resolution.7, persistent-keyring.7, pid_namespaces.7, pipe.7, pkeys.7, process-keyring.7, pthreads.7, pty.7, random.7, sched.7, sem_overview.7, session-keyring.7, shm_overview.7, signal-safety.7, signal.7, spufs.7, standards.7, symlink.7, termio.7, thread-keyring.7, time.7, unicode.7, user-keyring.7, user-session-keyring.7, user_namespaces.7, utf-8.7, xattr.7: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-17 22:59:04 +00:00
|
|
|
.PP
|
2016-11-01 18:08:09 +00:00
|
|
|
A special serial number value,
|
|
|
|
.BR KEY_SPEC_USER_SESSION_KEYRING ,
|
|
|
|
is defined
|
2016-11-02 14:25:57 +00:00
|
|
|
that can be used in lieu of the actual serial number of
|
|
|
|
the calling process's user session keyring.
|
aio.7, arp.7, attributes.7, boot.7, cgroups.7, cpuset.7, credentials.7, fanotify.7, fifo.7, glob.7, hier.7, hostname.7, icmp.7, inode.7, inotify.7, keyrings.7, libc.7, mailaddr.7, mount_namespaces.7, mq_overview.7, nptl.7, numa.7, path_resolution.7, persistent-keyring.7, pid_namespaces.7, pipe.7, pkeys.7, process-keyring.7, pthreads.7, pty.7, random.7, sched.7, sem_overview.7, session-keyring.7, shm_overview.7, signal-safety.7, signal.7, spufs.7, standards.7, symlink.7, termio.7, thread-keyring.7, time.7, unicode.7, user-keyring.7, user-session-keyring.7, user_namespaces.7, utf-8.7, xattr.7: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-17 22:59:04 +00:00
|
|
|
.PP
|
2016-11-02 14:25:57 +00:00
|
|
|
From the
|
|
|
|
.BR keyctl (1)
|
|
|
|
utility, '\fB@us\fP' can be used instead of a numeric key ID in
|
2016-11-01 15:45:33 +00:00
|
|
|
much the same way.
|
aio.7, arp.7, attributes.7, boot.7, cgroups.7, cpuset.7, credentials.7, fanotify.7, fifo.7, glob.7, hier.7, hostname.7, icmp.7, inode.7, inotify.7, keyrings.7, libc.7, mailaddr.7, mount_namespaces.7, mq_overview.7, nptl.7, numa.7, path_resolution.7, persistent-keyring.7, pid_namespaces.7, pipe.7, pkeys.7, process-keyring.7, pthreads.7, pty.7, random.7, sched.7, sem_overview.7, session-keyring.7, shm_overview.7, signal-safety.7, signal.7, spufs.7, standards.7, symlink.7, termio.7, thread-keyring.7, time.7, unicode.7, user-keyring.7, user-session-keyring.7, user_namespaces.7, utf-8.7, xattr.7: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-17 22:59:04 +00:00
|
|
|
.PP
|
2016-11-01 18:08:09 +00:00
|
|
|
User session keyrings are independent of
|
|
|
|
.BR clone (2),
|
|
|
|
.BR fork (2),
|
|
|
|
.BR vfork (2),
|
|
|
|
.BR execve (2),
|
|
|
|
and
|
2016-11-01 18:11:11 +00:00
|
|
|
.BR _exit (2)
|
2016-11-01 18:08:09 +00:00
|
|
|
excepting that the keyring is destroyed when the UID record is destroyed
|
2016-11-01 15:45:33 +00:00
|
|
|
when the last process pinning it exits.
|
aio.7, arp.7, attributes.7, boot.7, cgroups.7, cpuset.7, credentials.7, fanotify.7, fifo.7, glob.7, hier.7, hostname.7, icmp.7, inode.7, inotify.7, keyrings.7, libc.7, mailaddr.7, mount_namespaces.7, mq_overview.7, nptl.7, numa.7, path_resolution.7, persistent-keyring.7, pid_namespaces.7, pipe.7, pkeys.7, process-keyring.7, pthreads.7, pty.7, random.7, sched.7, sem_overview.7, session-keyring.7, shm_overview.7, signal-safety.7, signal.7, spufs.7, standards.7, symlink.7, termio.7, thread-keyring.7, time.7, unicode.7, user-keyring.7, user-session-keyring.7, user_namespaces.7, utf-8.7, xattr.7: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-17 22:59:04 +00:00
|
|
|
.PP
|
2016-11-02 14:25:57 +00:00
|
|
|
If a user session keyring does not exist when it is accessed,
|
|
|
|
it will be created.
|
aio.7, arp.7, attributes.7, boot.7, cgroups.7, cpuset.7, credentials.7, fanotify.7, fifo.7, glob.7, hier.7, hostname.7, icmp.7, inode.7, inotify.7, keyrings.7, libc.7, mailaddr.7, mount_namespaces.7, mq_overview.7, nptl.7, numa.7, path_resolution.7, persistent-keyring.7, pid_namespaces.7, pipe.7, pkeys.7, process-keyring.7, pthreads.7, pty.7, random.7, sched.7, sem_overview.7, session-keyring.7, shm_overview.7, signal-safety.7, signal.7, spufs.7, standards.7, symlink.7, termio.7, thread-keyring.7, time.7, unicode.7, user-keyring.7, user-session-keyring.7, user_namespaces.7, utf-8.7, xattr.7: ffix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-08-17 22:59:04 +00:00
|
|
|
.PP
|
2016-11-02 14:25:57 +00:00
|
|
|
Rather than relying on the user session keyring,
|
|
|
|
it is strongly recommended\(emespecially if the process
|
|
|
|
is running as root\(emthat a
|
2016-11-01 18:08:09 +00:00
|
|
|
.BR session-keyring (7)
|
2016-11-02 14:25:57 +00:00
|
|
|
be set explicitly, for example by
|
|
|
|
.BR pam_keyinit (8).
|
2016-11-02 22:15:58 +00:00
|
|
|
.SH NOTES
|
|
|
|
The user session keyring was added to support situations where
|
|
|
|
a process doesn't have a session keyring,
|
|
|
|
perhaps because it was created via a pathway that didn't involve PAM
|
|
|
|
(e.g., perhaps it was a daemon started by
|
|
|
|
.BR inetd (8)).
|
|
|
|
In such a scenario, the user session keyring acts as a substitute for the
|
|
|
|
.BR session-keyring (7).
|
2016-11-01 15:45:33 +00:00
|
|
|
.SH SEE ALSO
|
2016-11-01 17:12:21 +00:00
|
|
|
.ad l
|
|
|
|
.nh
|
2016-11-01 15:45:33 +00:00
|
|
|
.BR keyctl (1),
|
|
|
|
.BR keyctl (3),
|
|
|
|
.BR keyrings (7),
|
2016-11-01 17:12:21 +00:00
|
|
|
.BR persistent\-keyring (7),
|
|
|
|
.BR process\-keyring (7),
|
|
|
|
.BR session\-keyring (7),
|
|
|
|
.BR thread\-keyring (7),
|
|
|
|
.BR user\-keyring (7)
|