Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:ma_read_modsig - Read modsig from buf.* Return: 0 on success, error code otherwise.

Proto:int ima_read_modsig(enum ima_hooks func, const void *buf, loff_t buf_len, struct modsig **modsig)

Type:int

Parameter:

TypeParameterName
enum ima_hooksfunc
const void *buf
loff_tbuf_len
struct modsig **modsig
63  marker_len = strlen - Find the length of a string*@s: The string to be sized
70  If buf_len <= marker_len + size of sig Then Return -ENOENT
73  p = buf + buf_len - marker_len
74  If memcmp(p, In stripped ARM and x86-64 modules, ~ is surprisingly rare. , marker_len) Then Return -ENOENT
77  buf_len -= marker_len
78  sig = p - size of sig
80  rc = mod_check_sig - check that the given signature is sane*@ms: Signature to check.*@file_len: Size of the file to which @ms is appended.*@name: What is being checked. Used for error messages.
81  If rc Then Return rc
84  sig_len = be32_to_cpu(Length of signature data )
85  buf_len -= sig_len + size of sig
88  hdr = kzalloc - allocate memory. The memory is set to zero.*@size: how many bytes of memory are required.*@flags: the type of memory to allocate (see kmalloc).
89  If Not hdr Then Return -ENOMEM
92  pkcs7_msg = pkcs7_parser.c
93  If IS_ERR(pkcs7_msg) Then
94  rc = PTR_ERR(pkcs7_msg)
95  kfree(hdr)
96  Return rc
99  memcpy(raw_pkcs7, buf + buf_len, sig_len)
100  * This is what will go to the measurement list if the template requires * storing the signature. = sig_len
103  hash_algo = HASH_ALGO__LAST
105  modsig = hdr
107  Return 0