Lines Matching +full:0 +full:v

28 	struct map_value *v;  in size_not_bpf_dw()  local
29 int key = 0; in size_not_bpf_dw()
31 v = bpf_map_lookup_elem(&array_map, &key); in size_not_bpf_dw()
32 if (!v) in size_not_bpf_dw()
33 return 0; in size_not_bpf_dw()
35 *(u32 *)&v->unref_ptr = 0; in size_not_bpf_dw()
36 return 0; in size_not_bpf_dw()
42 struct map_value *v; in non_const_var_off() local
43 int key = 0, id; in non_const_var_off()
45 v = bpf_map_lookup_elem(&array_map, &key); in non_const_var_off()
46 if (!v) in non_const_var_off()
47 return 0; in non_const_var_off()
51 return 0; in non_const_var_off()
52 *(u64 *)((void *)v + id) = 0; in non_const_var_off()
54 return 0; in non_const_var_off()
60 struct map_value *v; in non_const_var_off_kptr_xchg() local
61 int key = 0, id; in non_const_var_off_kptr_xchg()
63 v = bpf_map_lookup_elem(&array_map, &key); in non_const_var_off_kptr_xchg()
64 if (!v) in non_const_var_off_kptr_xchg()
65 return 0; in non_const_var_off_kptr_xchg()
69 return 0; in non_const_var_off_kptr_xchg()
70 bpf_kptr_xchg((void *)v + id, NULL); in non_const_var_off_kptr_xchg()
72 return 0; in non_const_var_off_kptr_xchg()
78 struct map_value *v; in misaligned_access_write() local
79 int key = 0; in misaligned_access_write()
81 v = bpf_map_lookup_elem(&array_map, &key); in misaligned_access_write()
82 if (!v) in misaligned_access_write()
83 return 0; in misaligned_access_write()
85 *(void **)((void *)v + 7) = NULL; in misaligned_access_write()
87 return 0; in misaligned_access_write()
93 struct map_value *v; in misaligned_access_read() local
94 int key = 0; in misaligned_access_read()
96 v = bpf_map_lookup_elem(&array_map, &key); in misaligned_access_read()
97 if (!v) in misaligned_access_read()
98 return 0; in misaligned_access_read()
100 return *(u64 *)((void *)v + 1); in misaligned_access_read()
107 struct map_value *v; in reject_var_off_store() local
108 int key = 0, id; in reject_var_off_store()
110 v = bpf_map_lookup_elem(&array_map, &key); in reject_var_off_store()
111 if (!v) in reject_var_off_store()
112 return 0; in reject_var_off_store()
114 unref_ptr = v->unref_ptr; in reject_var_off_store()
116 return 0; in reject_var_off_store()
119 return 0; in reject_var_off_store()
121 v->unref_ptr = unref_ptr; in reject_var_off_store()
123 return 0; in reject_var_off_store()
130 struct map_value *v; in reject_bad_type_match() local
131 int key = 0; in reject_bad_type_match()
133 v = bpf_map_lookup_elem(&array_map, &key); in reject_bad_type_match()
134 if (!v) in reject_bad_type_match()
135 return 0; in reject_bad_type_match()
137 unref_ptr = v->unref_ptr; in reject_bad_type_match()
139 return 0; in reject_bad_type_match()
141 v->unref_ptr = unref_ptr; in reject_bad_type_match()
143 return 0; in reject_bad_type_match()
149 struct map_value *v; in marked_as_untrusted_or_null() local
150 int key = 0; in marked_as_untrusted_or_null()
152 v = bpf_map_lookup_elem(&array_map, &key); in marked_as_untrusted_or_null()
153 if (!v) in marked_as_untrusted_or_null()
154 return 0; in marked_as_untrusted_or_null()
156 bpf_this_cpu_ptr(v->unref_ptr); in marked_as_untrusted_or_null()
157 return 0; in marked_as_untrusted_or_null()
164 struct map_value *v; in correct_btf_id_check_size() local
165 int key = 0; in correct_btf_id_check_size()
167 v = bpf_map_lookup_elem(&array_map, &key); in correct_btf_id_check_size()
168 if (!v) in correct_btf_id_check_size()
169 return 0; in correct_btf_id_check_size()
171 p = v->unref_ptr; in correct_btf_id_check_size()
173 return 0; in correct_btf_id_check_size()
181 struct map_value *v; in inherit_untrusted_on_walk() local
182 int key = 0; in inherit_untrusted_on_walk()
184 v = bpf_map_lookup_elem(&array_map, &key); in inherit_untrusted_on_walk()
185 if (!v) in inherit_untrusted_on_walk()
186 return 0; in inherit_untrusted_on_walk()
188 unref_ptr = v->unref_ptr; in inherit_untrusted_on_walk()
190 return 0; in inherit_untrusted_on_walk()
193 return 0; in inherit_untrusted_on_walk()
199 struct map_value *v; in reject_kptr_xchg_on_unref() local
200 int key = 0; in reject_kptr_xchg_on_unref()
202 v = bpf_map_lookup_elem(&array_map, &key); in reject_kptr_xchg_on_unref()
203 if (!v) in reject_kptr_xchg_on_unref()
204 return 0; in reject_kptr_xchg_on_unref()
206 bpf_kptr_xchg(&v->unref_ptr, NULL); in reject_kptr_xchg_on_unref()
207 return 0; in reject_kptr_xchg_on_unref()
213 bpf_kfunc_call_test_kptr_get((void *)&ctx, 0, 0); in reject_kptr_get_no_map_val()
214 return 0; in reject_kptr_get_no_map_val()
220 bpf_kfunc_call_test_kptr_get(bpf_map_lookup_elem(&array_map, &(int){0}), 0, 0); in reject_kptr_get_no_null_map_val()
221 return 0; in reject_kptr_get_no_null_map_val()
227 struct map_value *v; in reject_kptr_get_no_kptr() local
228 int key = 0; in reject_kptr_get_no_kptr()
230 v = bpf_map_lookup_elem(&array_map, &key); in reject_kptr_get_no_kptr()
231 if (!v) in reject_kptr_get_no_kptr()
232 return 0; in reject_kptr_get_no_kptr()
234 bpf_kfunc_call_test_kptr_get((void *)v, 0, 0); in reject_kptr_get_no_kptr()
235 return 0; in reject_kptr_get_no_kptr()
241 struct map_value *v; in reject_kptr_get_on_unref() local
242 int key = 0; in reject_kptr_get_on_unref()
244 v = bpf_map_lookup_elem(&array_map, &key); in reject_kptr_get_on_unref()
245 if (!v) in reject_kptr_get_on_unref()
246 return 0; in reject_kptr_get_on_unref()
248 bpf_kfunc_call_test_kptr_get(&v->unref_ptr, 0, 0); in reject_kptr_get_on_unref()
249 return 0; in reject_kptr_get_on_unref()
255 struct map_value *v; in reject_kptr_get_bad_type_match() local
256 int key = 0; in reject_kptr_get_bad_type_match()
258 v = bpf_map_lookup_elem(&array_map, &key); in reject_kptr_get_bad_type_match()
259 if (!v) in reject_kptr_get_bad_type_match()
260 return 0; in reject_kptr_get_bad_type_match()
262 bpf_kfunc_call_test_kptr_get((void *)&v->ref_memb_ptr, 0, 0); in reject_kptr_get_bad_type_match()
263 return 0; in reject_kptr_get_bad_type_match()
269 struct map_value *v; in mark_ref_as_untrusted_or_null() local
270 int key = 0; in mark_ref_as_untrusted_or_null()
272 v = bpf_map_lookup_elem(&array_map, &key); in mark_ref_as_untrusted_or_null()
273 if (!v) in mark_ref_as_untrusted_or_null()
274 return 0; in mark_ref_as_untrusted_or_null()
276 bpf_this_cpu_ptr(v->ref_ptr); in mark_ref_as_untrusted_or_null()
277 return 0; in mark_ref_as_untrusted_or_null()
284 struct map_value *v; in reject_untrusted_store_to_ref() local
285 int key = 0; in reject_untrusted_store_to_ref()
287 v = bpf_map_lookup_elem(&array_map, &key); in reject_untrusted_store_to_ref()
288 if (!v) in reject_untrusted_store_to_ref()
289 return 0; in reject_untrusted_store_to_ref()
291 p = v->ref_ptr; in reject_untrusted_store_to_ref()
293 return 0; in reject_untrusted_store_to_ref()
295 *(struct prog_test_ref_kfunc * volatile *)&v->ref_ptr = p; in reject_untrusted_store_to_ref()
296 return 0; in reject_untrusted_store_to_ref()
303 struct map_value *v; in reject_untrusted_xchg() local
304 int key = 0; in reject_untrusted_xchg()
306 v = bpf_map_lookup_elem(&array_map, &key); in reject_untrusted_xchg()
307 if (!v) in reject_untrusted_xchg()
308 return 0; in reject_untrusted_xchg()
310 p = v->ref_ptr; in reject_untrusted_xchg()
312 return 0; in reject_untrusted_xchg()
313 bpf_kptr_xchg(&v->ref_ptr, p); in reject_untrusted_xchg()
314 return 0; in reject_untrusted_xchg()
321 struct map_value *v; in reject_bad_type_xchg() local
322 int key = 0; in reject_bad_type_xchg()
324 v = bpf_map_lookup_elem(&array_map, &key); in reject_bad_type_xchg()
325 if (!v) in reject_bad_type_xchg()
326 return 0; in reject_bad_type_xchg()
328 ref_ptr = bpf_kfunc_call_test_acquire(&(unsigned long){0}); in reject_bad_type_xchg()
330 return 0; in reject_bad_type_xchg()
331 bpf_kptr_xchg(&v->ref_memb_ptr, ref_ptr); in reject_bad_type_xchg()
332 return 0; in reject_bad_type_xchg()
339 struct map_value *v; in reject_member_of_ref_xchg() local
340 int key = 0; in reject_member_of_ref_xchg()
342 v = bpf_map_lookup_elem(&array_map, &key); in reject_member_of_ref_xchg()
343 if (!v) in reject_member_of_ref_xchg()
344 return 0; in reject_member_of_ref_xchg()
346 ref_ptr = bpf_kfunc_call_test_acquire(&(unsigned long){0}); in reject_member_of_ref_xchg()
348 return 0; in reject_member_of_ref_xchg()
349 bpf_kptr_xchg(&v->ref_memb_ptr, &ref_ptr->memb); in reject_member_of_ref_xchg()
350 return 0; in reject_member_of_ref_xchg()
356 struct map_value *v; in reject_indirect_helper_access() local
357 int key = 0; in reject_indirect_helper_access()
359 v = bpf_map_lookup_elem(&array_map, &key); in reject_indirect_helper_access()
360 if (!v) in reject_indirect_helper_access()
361 return 0; in reject_indirect_helper_access()
363 bpf_get_current_comm(v, sizeof(v->buf) + 1); in reject_indirect_helper_access()
364 return 0; in reject_indirect_helper_access()
370 return p ? *p = 42 : 0; in write_func()
376 struct map_value *v; in reject_indirect_global_func_access() local
377 int key = 0; in reject_indirect_global_func_access()
379 v = bpf_map_lookup_elem(&array_map, &key); in reject_indirect_global_func_access()
380 if (!v) in reject_indirect_global_func_access()
381 return 0; in reject_indirect_global_func_access()
383 return write_func((void *)v + 5); in reject_indirect_global_func_access()
390 struct map_value *v; in kptr_xchg_ref_state() local
391 int key = 0; in kptr_xchg_ref_state()
393 v = bpf_map_lookup_elem(&array_map, &key); in kptr_xchg_ref_state()
394 if (!v) in kptr_xchg_ref_state()
395 return 0; in kptr_xchg_ref_state()
397 p = bpf_kfunc_call_test_acquire(&(unsigned long){0}); in kptr_xchg_ref_state()
399 return 0; in kptr_xchg_ref_state()
400 bpf_kptr_xchg(&v->ref_ptr, p); in kptr_xchg_ref_state()
401 return 0; in kptr_xchg_ref_state()
407 struct map_value *v; in kptr_get_ref_state() local
408 int key = 0; in kptr_get_ref_state()
410 v = bpf_map_lookup_elem(&array_map, &key); in kptr_get_ref_state()
411 if (!v) in kptr_get_ref_state()
412 return 0; in kptr_get_ref_state()
414 bpf_kfunc_call_test_kptr_get(&v->ref_ptr, 0, 0); in kptr_get_ref_state()
415 return 0; in kptr_get_ref_state()