函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:lockdown_write

函数原型:static ssize_t lockdown_write(struct file *file, const char __user *buf, size_t n, loff_t *ppos)

返回类型:ssize_t

参数:

类型参数名称
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  如果是错误则返回:错误
153  len等于strlen - Find the length of a string*@s: The string to be sized
154  如果lenstate[len - 1]恒等于'\n'则
155  state[len - 1]等于'\0'
156  len自减
159 i小于ARRAY_SIZE - get the number of elements in array @arr*@arr: array to be sized(lockdown_levels)循环
160  level等于lockdown_levels[i]
161  label等于lockdown_reasons[level]
163  如果label且非字符串比较err等于Put the kernel into lock-down mode.
167  释放内存
168  返回:如果errerr否则n