Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:loadpin_read_file

Proto:static int loadpin_read_file(struct file *file, enum kernel_read_file_id id)

Type:int

Parameter:

TypeParameterName
struct file *file
enum kernel_read_file_idid
122  origin = kernel_read_file_id_str(id)
125  If id < ARRAY_SIZE - get the number of elements in array @arr*@arr: array to be sized(ignore_read_file_id) && ignore_read_file_id[id] Then
127  report_load(origin, file, "pinning-excluded")
128  Return 0
132  If Not file Then
133  If Not enforce Then
134  report_load(origin, NULL, "old-api-pinning-ignored")
135  Return 0
138  report_load(origin, NULL, "old-api-denied")
139  Return -EPERM
142  load_root = mnt_sb
145  spin_lock( & pinned_root_spinlock)
150  If Not pinned_root Then
151  pinned_root = load_root
158  spin_unlock( & pinned_root_spinlock)
159  This must be called after early kernel init, since then the rootdev* is available.
160  report_load(origin, file, "pinned")
161  Else
162  spin_unlock( & pinned_root_spinlock)
165  If IS_ERR_OR_NULL(pinned_root) || load_root != pinned_root Then
167  report_load(origin, file, "pinning-ignored")
168  Return 0
171  report_load(origin, file, "denied")
172  Return -EPERM
175  Return 0
Caller
NameDescribe
loadpin_load_data