函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:ima_read_policy

函数原型:static ssize_t ima_read_policy(char *path)

返回类型:ssize_t

参数:

类型参数名称
char *path
280  pathlen等于strlen - Find the length of a string*@s: The string to be sized
285  datap等于path
286  分割字符串
288  rc等于kernel_read_file_from_path(path, & data, & size, 0, READING_POLICY)
289  如果rc小于0则
290  打印错误信息("Unable to open file: %s (%d)", path, rc)
291  返回:rc
294  datap等于data
295 size大于0且p等于分割字符串循环
296  pr_debug("rule: %s\n", p)
297  rc等于ma_parse_add_rule - add a rule to ima_policy_rules*@rule - ima measurement policy rule* Avoid locking by allowing just one writer at a time in ima_write_policy()* Returns the length of the rule parsed, an error code on failure
298  如果rc小于0则退出
300  size减等于rc
303  vfree - release memory allocated by vmalloc()*@addr: memory base address* Free the virtually continuous memory area starting at @addr, as* obtained from vmalloc(), vmalloc_32() or __vmalloc()
304  如果rc小于0则返回:rc
306  否则如果size则返回:负EINVAL
308  否则返回:pathlen
调用者
名称描述
ima_write_policy