函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:security\keys\keyctl.c Create Date:2022-07-27 19:54:15
Last Modify:2020-03-18 07:59:52 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:Update a key's data payload from the given data.* The key must grant the caller Write permission and the key type must support* updating for this to work. A negative key can be positively instantiated* with this call.* If successful, 0 will be returned

函数原型:long keyctl_update_key(key_serial_t id, const void __user *_payload, size_t plen)

返回类型:long

参数:

类型参数名称
key_serial_tid
const void __user *_payload
size_tplen
334  ret等于负EINVAL
335  如果plen大于PAGE_SIZE则转到:error
339  payload = NULL
340  如果plen
341  ret等于负ENOMEM
342  payload等于开辟内存
343  如果非payload则转到:error
346  ret等于负EFAULT
347  如果copy_from_user(payload, _payload, plen)不等于0则转到:error2
352  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
353  如果是错误
354  ret等于错误
355  转到:error2
359  ret等于key_update - Update a key's contents.*@key_ref: The pointer (plus possession flag) to the key.*@payload: The data to be used to update the key.*@plen: The length of @payload.* Attempt to update the contents of a key with the given payload data. The
361  key_ref_put(key_ref)
362  error2 :
363  kzfree - like kfree but zero memory*@p: object to free memory of* The memory of the object @p points to is zeroed before freed.* If @p is %NULL, kzfree() does nothing.* Note: this function zeroes the whole allocated buffer which can be a good
364  error :
365  返回:ret
调用者
名称描述
SYSCALL_DEFINE5The key control system call
COMPAT_SYSCALL_DEFINE5The key control system call, 32-bit compatibility version for 64-bit archs