函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:smk_write_rules_list - write() for any /smack rule file*@file: file pointer, not actually used*@buf: where to get the data from*@count: bytes sent*@ppos: where to start - must be 0*@rule_list: the list of rules to write to*@rule_lock: lock for the rule

函数原型:static ssize_t smk_write_rules_list(struct file *file, const char __user *buf, size_t count, loff_t *ppos, struct list_head *rule_list, struct mutex *rule_lock, int format)

返回类型:ssize_t

参数:

类型参数名称
struct file *file
const char __user *buf
size_tcount
loff_t *ppos
struct list_head *rule_list
struct mutex *rule_lock
intformat
451  trunc等于0
453  cnt等于0
459  如果ppos不等于0则返回:负EINVAL
462  如果format恒等于Fixed 24byte label format
466  如果count小于SMK_OLOADLENcount大于SMK_LOADLEN则返回:负EINVAL
468  否则
469  如果count大于等于PAGE_SIZE
470  count等于PAGE_SIZE减1
471  trunc等于1
475  data等于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.
476  如果是错误则返回:错误
483  如果trunc
484 count大于0且data[count - 1]不等于'\n'循环
485  count先自减
486  如果count恒等于0则
487  rc等于负EINVAL
488  转到:out
492  data[count]等于'\0'
493  tokens等于如果format恒等于Rule modification format 则4否则3
494 cnt小于count循环
495  如果format恒等于Fixed 24byte label format
497  如果rc小于0则转到:out
499  cnt等于count
500  否则
502  如果rc小于0则转到:out
504  如果rc恒等于0则
505  rc等于负EINVAL
506  转到:out
508  cnt加等于rc
511  如果(rule_list == NULL)则rc等于smk_set_access - add a rule to the rule list or replace an old rule*@srp: the rule to add or replace*@rule_list: the list of rules*@rule_lock: the rule list lock* Looks through the current subject/object/access list for* the subject/object pair and
514  否则rc等于smk_set_access - add a rule to the rule list or replace an old rule*@srp: the rule to add or replace*@rule_list: the list of rules*@rule_lock: the rule list lock* Looks through the current subject/object/access list for* the subject/object pair and
517  如果rc则转到:out
521  rc等于cnt
522  out :
523  释放内存
524  返回:rc
调用者
名称描述
smk_write_loadsmk_write_load - write() for /smack/load*@file: file pointer, not actually used*@buf: where to get the data from*@count: bytes sent*@ppos: where to start - must be 0
smk_write_load_selfsmk_write_load_self - write() for /smack/load-self*@file: file pointer, not actually used*@buf: where to get the data from*@count: bytes sent*@ppos: where to start - must be 0
smk_write_load2smk_write_load2 - write() for /smack/load2*@file: file pointer, not actually used*@buf: where to get the data from*@count: bytes sent*@ppos: where to start - must be 0
smk_write_load_self2smk_write_load_self2 - write() for /smack/load-self2*@file: file pointer, not actually used*@buf: where to get the data from*@count: bytes sent*@ppos: where to start - must be 0
smk_write_change_rulesmk_write_change_rule - write() for /smack/change-rule*@file: file pointer*@buf: data from user space*@count: bytes sent*@ppos: where to start - must be 0