Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:lib\livepatch\test_klp_shadow_vars.c Create Date:2022-07-28 06:38:18
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:test_klp_shadow_vars_init

Proto:static int test_klp_shadow_vars_init(void)

Type:int

Parameter:Nothing

129  obj = THIS_MODULE
130  id = 0x1234
131  size = size of *
132  gfp_flags = GFP_KERNEL
139  ptr_id(NULL)
140  ptr_id( & var1)
141  ptr_id( & var2)
142  ptr_id( & var3)
143  ptr_id( & var4)
149  ret = Shadow variable wrapper functions that echo the function and arguments* to the kernel log for testing verification. Don't display raw pointers,* but use the ptr_id() value instead.
150  If Not ret Then pr_info(" got expected NULL result\n")
156  sv1 = shadow_alloc(obj, id, size, gfp_flags, Shadow variable constructor - remember simple pointer data , & var1)
157  If Not sv1 Then Return -ENOMEM
160  sv2 = shadow_alloc(obj + 1, id, size, gfp_flags, Shadow variable constructor - remember simple pointer data , & var2)
161  If Not sv2 Then Return -ENOMEM
164  sv3 = shadow_alloc(obj, id + 1, size, gfp_flags, Shadow variable constructor - remember simple pointer data , & var3)
165  If Not sv3 Then Return -ENOMEM
172  ret = Shadow variable wrapper functions that echo the function and arguments* to the kernel log for testing verification. Don't display raw pointers,* but use the ptr_id() value instead.
173  If Not ret Then Return -EINVAL
175  If ret == sv1 && sv1 == var1 Then pr_info(" got expected PTR%d -> PTR%d result\n", ptr_id(sv1), ptr_id( * sv1))
179  ret = Shadow variable wrapper functions that echo the function and arguments* to the kernel log for testing verification. Don't display raw pointers,* but use the ptr_id() value instead.
180  If Not ret Then Return -EINVAL
182  If ret == sv2 && sv2 == var2 Then pr_info(" got expected PTR%d -> PTR%d result\n", ptr_id(sv2), ptr_id( * sv2))
185  ret = Shadow variable wrapper functions that echo the function and arguments* to the kernel log for testing verification. Don't display raw pointers,* but use the ptr_id() value instead.
186  If Not ret Then Return -EINVAL
188  If ret == sv3 && sv3 == var3 Then pr_info(" got expected PTR%d -> PTR%d result\n", ptr_id(sv3), ptr_id( * sv3))
196  sv4 = shadow_get_or_alloc(obj + 2, id, size, gfp_flags, Shadow variable constructor - remember simple pointer data , & var4)
197  If Not sv4 Then Return -ENOMEM
200  ret = shadow_get_or_alloc(obj + 2, id, size, gfp_flags, Shadow variable constructor - remember simple pointer data , & var4)
201  If Not ret Then Return -EINVAL
203  If ret == sv4 && sv4 == var4 Then pr_info(" got expected PTR%d -> PTR%d result\n", ptr_id(sv4), ptr_id( * sv4))
211  shadow_free(obj, id, shadow_dtor)
212  ret = Shadow variable wrapper functions that echo the function and arguments* to the kernel log for testing verification. Don't display raw pointers,* but use the ptr_id() value instead.
213  If Not ret Then pr_info(" got expected NULL result\n")
216  shadow_free(obj + 1, id, shadow_dtor)
217  ret = Shadow variable wrapper functions that echo the function and arguments* to the kernel log for testing verification. Don't display raw pointers,* but use the ptr_id() value instead.
218  If Not ret Then pr_info(" got expected NULL result\n")
221  shadow_free(obj + 2, id, shadow_dtor)
222  ret = Shadow variable wrapper functions that echo the function and arguments* to the kernel log for testing verification. Don't display raw pointers,* but use the ptr_id() value instead.
223  If Not ret Then pr_info(" got expected NULL result\n")
229  ret = Shadow variable wrapper functions that echo the function and arguments* to the kernel log for testing verification. Don't display raw pointers,* but use the ptr_id() value instead.
230  If Not ret Then Return -EINVAL
232  If ret == sv3 && sv3 == var3 Then pr_info(" got expected PTR%d -> PTR%d result\n", ptr_id(sv3), ptr_id( * sv3))
239  shadow_free_all(id + 1, shadow_dtor)
240  ret = Shadow variable wrapper functions that echo the function and arguments* to the kernel log for testing verification. Don't display raw pointers,* but use the ptr_id() value instead.
241  If Not ret Then pr_info(" shadow_get() got expected NULL result\n")
245  free_ptr_list()
247  Return 0