Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:vm_write_key - write() for <securityfs>/evm*@file: file pointer, not actually used*@buf: where to get the data from*@count: bytes sent*@ppos: where to start* Used to signal that key is on the kernel key ring

Proto:static ssize_t evm_write_key(struct file *file, const char __user *buf, size_t count, loff_t *ppos)

Type:ssize_t

Parameter:

TypeParameterName
struct file *file
const char __user *buf
size_tcount
loff_t *ppos
73  If Not Check operation authority || evm_initialized & userland has signaled key load Then Return -EPERM
76  ret = kstrtoint_from_user(buf, count, 0, & i)
78  If ret Then Return ret
82  If Not i || (i & ~EVM_INIT_MASK) != 0 Then Return -EINVAL
88  If i & EVM_ALLOW_METADATA_WRITES && (evm_initialized & EVM_KEY_MASK) != 0 && Not (evm_initialized & EVM_ALLOW_METADATA_WRITES) Then Return -EPERM
93  If i & EVM_INIT_HMAC Then
94  ret = Get the key from the TPM for the SHA1-HMAC
95  If ret != 0 Then Return ret
98  i |= userland has signaled key load
101  evm_initialized |= i
106  If evm_initialized & EVM_INIT_HMAC Then evm_initialized &= ~EVM_ALLOW_METADATA_WRITES
109  Return count