Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name: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

Proto:long keyctl_update_key(key_serial_t id, const void __user *_payload, size_t plen)

Type:long

Parameter:

TypeParameterName
key_serial_tid
const void __user *_payload
size_tplen
334  ret = -EINVAL
335  If plen > PAGE_SIZE Then Go to error
339  payload = NULL
340  If plen Then
341  ret = -ENOMEM
342  payload = Allocation memory
343  If Not payload Then Go to error
346  ret = -EFAULT
347  If copy_from_user(payload, _payload, plen) != 0 Then Go to 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  If IS_ERR(key_ref) Then
354  ret = PTR_ERR(key_ref)
355  Go to 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  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