Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:security\lockdown\lockdown.c Create Date:2022-07-28 19:55:38
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:lockdown_write

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

Type:ssize_t

Parameter:

TypeParameterName
struct file *file
const char __user *buf
size_tn
loff_t *ppos
147  err = -EINVAL
149  state = memdup_user_nul - duplicate memory region from user space and NUL-terminate*@src: source address in user space*@len: number of bytes to copy* Return: an ERR_PTR() on failure.
150  If IS_ERR(state) Then Return PTR_ERR(state)
153  len = strlen - Find the length of a string*@s: The string to be sized
154  If len && state[len - 1] == '\n' Then
155  state[len - 1] = '\0'
156  len--
159  When i < ARRAY_SIZE - get the number of elements in array @arr*@arr: array to be sized(lockdown_levels) cycle
160  level = lockdown_levels[i]
161  label = lockdown_reasons[level]
163  If label && Not strcmp(state, label) Then err = Put the kernel into lock-down mode.
167  kfree(state)
168  Return If err Then err Else n