Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:security\keys\persistent.c Create Date:2022-07-28 18:26:20
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:Get the persistent keyring for a specific UID and link it to the nominated* keyring.

Proto:long keyctl_get_persistent(uid_t _uid, key_serial_t destid)

Type:long

Parameter:

TypeParameterName
uid_t_uid
key_serial_tdestid
131  ns = current_user_ns()
137  If (_uid == (uid_t) - 1) Then
138  uid = current_uid()
139  Else
140  uid = make_kuid - Map a user-namespace uid pair into a kuid
141  If Not uid_valid(uid) Then Return -EINVAL
147  If Not uid_eq(uid, current_uid()) && Not uid_eq(uid, current_euid()) && Not ns_capable(ns, Allows forged pids on socket credentials passing. ) Then Return -EPERM
154  dest_ref = Look up a key ID given us by userspace with a given permissions mask to get* the key it refers to.* Flags can be passed to request that special keyrings be created if referred* to directly, to permit partially constructed keys to be found and to skip
155  If IS_ERR(dest_ref) Then Return PTR_ERR(dest_ref)
157  If type of key != key_type_keyring Then
158  ret = -ENOTDIR
159  Go to out_put_dest
162  ret = Get the persistent keyring for a specific UID and link it to the nominated* keyring.
164  out_put_dest :
165  key_ref_put(dest_ref)
166  Return ret
Caller
NameDescribe
COMPAT_SYSCALL_DEFINE5The key control system call, 32-bit compatibility version for 64-bit archs