Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:ima_read_policy

Proto:static ssize_t ima_read_policy(char *path)

Type:ssize_t

Parameter:

TypeParameterName
char *path
280  pathlen = strlen - Find the length of a string*@s: The string to be sized
285  datap = path
286  strsep - Split a string into tokens*@s: The string to be searched*@ct: The characters to search for* strsep() updates @s to point after the token, ready for the next call.* It returns empty tokens, too, behaving exactly like the libc function
288  rc = kernel_read_file_from_path(path, & data, & size, 0, READING_POLICY)
289  If rc < 0 Then
290  pr_err("Unable to open file: %s (%d)", path, rc)
291  Return rc
294  datap = data
295  When size > 0 && (p = strsep - Split a string into tokens*@s: The string to be searched*@ct: The characters to search for* strsep() updates @s to point after the token, ready for the next call.* It returns empty tokens, too, behaving exactly like the libc function) cycle
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  If rc < 0 Then Break
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  If rc < 0 Then Return rc
306  Else if size Then Return -EINVAL
308  Else Return pathlen
Caller
NameDescribe
ima_write_policy