函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:security\keys\keyring.c Create Date:2022-07-27 19:53:21
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:key_move - Move a key from one keyring to another*@key: The key to move*@from_keyring: The keyring to remove the link from

函数原型:int key_move(struct key *key, struct key *from_keyring, struct key *to_keyring, unsigned int flags)

返回类型:int

参数:

类型参数名称
struct key *key
struct key *from_keyring
struct key *to_keyring
unsigned intflags
1594  struct assoc_array_edit * from_edit = NULL, * to_edit = NULL
1597  kenter("%d,%d,%d", key serial number , key serial number , key serial number )
1599  如果from_keyring恒等于to_keyring则返回:0
1602  key_check(key)
1603  key_check(from_keyring)
1604  key_check(to_keyring)
1606  ret等于Lock keyrings for move (link/unlink combination).
1607  如果ret小于0则转到:out
1609  ret等于Begin the process of unlinking a key from a keyring.
1610  如果ret小于0则转到:error
1612  ret等于Preallocate memory so that a key can be linked into to a keyring.
1613  如果ret小于0则转到:error
1616  ret等于负EEXIST
1617  如果dead_leafflags按位与Do not displace from the to-keyring 则转到:error
1620  ret等于Check addition of keys to restricted keyrings.
1621  如果ret小于0则转到:error
1623  ret等于Check already instantiated keys aren't going to be a problem.* The caller must have called __key_link_begin(). Don't need to call this for* keys that were created since __key_link_begin() was called.
1624  如果ret小于0则转到:error
1627  Apply an unlink change.
1628  Link a key into to a keyring.* Must be called with __key_link_begin() having being called. Discards any* already extant link to matching key if there is one, so that each keyring* holds at most one link to any given key of a particular type+description
1629  error :
1630  Finish linking a key into to a keyring.* Must be called with __key_link_begin() having being called.
1631  Finish unlinking a key from to a keyring.
1632  out :
1633  kleave(" = %d", ret)
1634  返回:ret
调用者
名称描述
keyctl_keyring_moveMove a link to a key from one keyring to another, displacing any matching* key from the destination keyring.* The key must grant the caller Link permission and both keyrings must grant* the caller Write permission