Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:security\keys\keyctl.c Create Date:2022-07-28 18:20:22
Last Modify:2020-03-18 07:59:52 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:Change the permission mask on a key.* The key must grant the caller Setattr permission for this to work, though* the key need not be fully instantiated yet. If the caller does not have

Proto:long keyctl_setperm_key(key_serial_t id, key_perm_t perm)

Type:long

Parameter:

TypeParameterName
key_serial_tid
key_perm_tperm
1003  ret = -EINVAL
1004  If perm & ~( KEY_POS_ALL | KEY_USR_ALL | KEY_GRP_ALL | KEY_OTH_ALL) Then Go to error
1007  key_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
1009  If IS_ERR(key_ref) Then
1010  ret = PTR_ERR(key_ref)
1011  Go to error
1014  key = key_ref_to_ptr(key_ref)
1017  ret = -EACCES
1018  lock for writing
1021  If Check operation authority || uid_eq(uid, current_fsuid()) Then
1022  access permissions = perm
1023  ret = 0
1026  lease a write lock
1027  key_put - Discard a reference to a key.*@key: The key to discard a reference from.* Discard a reference to a key, and when all the references are gone, we* schedule the cleanup task to come and pull it out of the tree in process
1028  error :
1029  Return ret
Caller
NameDescribe
SYSCALL_DEFINE5The key control system call
COMPAT_SYSCALL_DEFINE5The key control system call, 32-bit compatibility version for 64-bit archs