Lines Matching +full:0 +full:v
27 struct map_value *v; in size_not_bpf_dw() local
28 int key = 0; in size_not_bpf_dw()
30 v = bpf_map_lookup_elem(&array_map, &key); in size_not_bpf_dw()
31 if (!v) in size_not_bpf_dw()
32 return 0; in size_not_bpf_dw()
34 *(u32 *)&v->unref_ptr = 0; in size_not_bpf_dw()
35 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()
61 struct map_value *v; in non_const_var_off_kptr_xchg() local
62 int key = 0, id; in non_const_var_off_kptr_xchg()
64 v = bpf_map_lookup_elem(&array_map, &key); in non_const_var_off_kptr_xchg()
65 if (!v) in non_const_var_off_kptr_xchg()
66 return 0; in non_const_var_off_kptr_xchg()
70 return 0; in non_const_var_off_kptr_xchg()
71 bpf_kptr_xchg((void *)v + id, NULL); in non_const_var_off_kptr_xchg()
73 return 0; in non_const_var_off_kptr_xchg()
80 struct map_value *v; in misaligned_access_write() local
81 int key = 0; in misaligned_access_write()
83 v = bpf_map_lookup_elem(&array_map, &key); in misaligned_access_write()
84 if (!v) in misaligned_access_write()
85 return 0; in misaligned_access_write()
87 *(void **)((void *)v + 7) = NULL; in misaligned_access_write()
89 return 0; in misaligned_access_write()
96 struct map_value *v; in misaligned_access_read() local
97 int key = 0; in misaligned_access_read()
99 v = bpf_map_lookup_elem(&array_map, &key); in misaligned_access_read()
100 if (!v) in misaligned_access_read()
101 return 0; in misaligned_access_read()
103 return *(u64 *)((void *)v + 1); in misaligned_access_read()
107 __failure __msg("variable untrusted_ptr_ access var_off=(0x0; 0x1e0)")
111 struct map_value *v; in reject_var_off_store() local
112 int key = 0, id; in reject_var_off_store()
114 v = bpf_map_lookup_elem(&array_map, &key); in reject_var_off_store()
115 if (!v) in reject_var_off_store()
116 return 0; in reject_var_off_store()
118 unref_ptr = v->unref_ptr; in reject_var_off_store()
120 return 0; in reject_var_off_store()
123 return 0; in reject_var_off_store()
125 v->unref_ptr = unref_ptr; in reject_var_off_store()
127 return 0; in reject_var_off_store()
135 struct map_value *v; in reject_bad_type_match() local
136 int key = 0; in reject_bad_type_match()
138 v = bpf_map_lookup_elem(&array_map, &key); in reject_bad_type_match()
139 if (!v) in reject_bad_type_match()
140 return 0; in reject_bad_type_match()
142 unref_ptr = v->unref_ptr; in reject_bad_type_match()
144 return 0; in reject_bad_type_match()
146 v->unref_ptr = unref_ptr; in reject_bad_type_match()
148 return 0; in reject_bad_type_match()
155 struct map_value *v; in marked_as_untrusted_or_null() local
156 int key = 0; in marked_as_untrusted_or_null()
158 v = bpf_map_lookup_elem(&array_map, &key); in marked_as_untrusted_or_null()
159 if (!v) in marked_as_untrusted_or_null()
160 return 0; in marked_as_untrusted_or_null()
162 bpf_this_cpu_ptr(v->unref_ptr); in marked_as_untrusted_or_null()
163 return 0; in marked_as_untrusted_or_null()
171 struct map_value *v; in correct_btf_id_check_size() local
172 int key = 0; in correct_btf_id_check_size()
174 v = bpf_map_lookup_elem(&array_map, &key); in correct_btf_id_check_size()
175 if (!v) in correct_btf_id_check_size()
176 return 0; in correct_btf_id_check_size()
178 p = v->unref_ptr; in correct_btf_id_check_size()
180 return 0; in correct_btf_id_check_size()
189 struct map_value *v; in inherit_untrusted_on_walk() local
190 int key = 0; in inherit_untrusted_on_walk()
192 v = bpf_map_lookup_elem(&array_map, &key); in inherit_untrusted_on_walk()
193 if (!v) in inherit_untrusted_on_walk()
194 return 0; in inherit_untrusted_on_walk()
196 unref_ptr = v->unref_ptr; in inherit_untrusted_on_walk()
198 return 0; in inherit_untrusted_on_walk()
201 return 0; in inherit_untrusted_on_walk()
208 struct map_value *v; in reject_kptr_xchg_on_unref() local
209 int key = 0; in reject_kptr_xchg_on_unref()
211 v = bpf_map_lookup_elem(&array_map, &key); in reject_kptr_xchg_on_unref()
212 if (!v) in reject_kptr_xchg_on_unref()
213 return 0; in reject_kptr_xchg_on_unref()
215 bpf_kptr_xchg(&v->unref_ptr, NULL); in reject_kptr_xchg_on_unref()
216 return 0; in reject_kptr_xchg_on_unref()
223 struct map_value *v; in mark_ref_as_untrusted_or_null() local
224 int key = 0; in mark_ref_as_untrusted_or_null()
226 v = bpf_map_lookup_elem(&array_map, &key); in mark_ref_as_untrusted_or_null()
227 if (!v) in mark_ref_as_untrusted_or_null()
228 return 0; in mark_ref_as_untrusted_or_null()
230 bpf_this_cpu_ptr(v->ref_ptr); in mark_ref_as_untrusted_or_null()
231 return 0; in mark_ref_as_untrusted_or_null()
239 struct map_value *v; in reject_untrusted_store_to_ref() local
240 int key = 0; in reject_untrusted_store_to_ref()
242 v = bpf_map_lookup_elem(&array_map, &key); in reject_untrusted_store_to_ref()
243 if (!v) in reject_untrusted_store_to_ref()
244 return 0; in reject_untrusted_store_to_ref()
246 p = v->ref_ptr; in reject_untrusted_store_to_ref()
248 return 0; in reject_untrusted_store_to_ref()
250 *(struct prog_test_ref_kfunc * volatile *)&v->ref_ptr = p; in reject_untrusted_store_to_ref()
251 return 0; in reject_untrusted_store_to_ref()
259 struct map_value *v; in reject_untrusted_xchg() local
260 int key = 0; in reject_untrusted_xchg()
262 v = bpf_map_lookup_elem(&array_map, &key); in reject_untrusted_xchg()
263 if (!v) in reject_untrusted_xchg()
264 return 0; in reject_untrusted_xchg()
266 p = v->ref_ptr; in reject_untrusted_xchg()
268 return 0; in reject_untrusted_xchg()
269 bpf_kptr_xchg(&v->ref_ptr, p); in reject_untrusted_xchg()
270 return 0; in reject_untrusted_xchg()
279 struct map_value *v; in reject_bad_type_xchg() local
280 int key = 0; in reject_bad_type_xchg()
282 v = bpf_map_lookup_elem(&array_map, &key); in reject_bad_type_xchg()
283 if (!v) in reject_bad_type_xchg()
284 return 0; in reject_bad_type_xchg()
286 ref_ptr = bpf_kfunc_call_test_acquire(&(unsigned long){0}); in reject_bad_type_xchg()
288 return 0; in reject_bad_type_xchg()
289 bpf_kptr_xchg(&v->ref_memb_ptr, ref_ptr); in reject_bad_type_xchg()
290 return 0; in reject_bad_type_xchg()
298 struct map_value *v; in reject_member_of_ref_xchg() local
299 int key = 0; in reject_member_of_ref_xchg()
301 v = bpf_map_lookup_elem(&array_map, &key); in reject_member_of_ref_xchg()
302 if (!v) in reject_member_of_ref_xchg()
303 return 0; in reject_member_of_ref_xchg()
305 ref_ptr = bpf_kfunc_call_test_acquire(&(unsigned long){0}); in reject_member_of_ref_xchg()
307 return 0; in reject_member_of_ref_xchg()
308 bpf_kptr_xchg(&v->ref_memb_ptr, &ref_ptr->memb); in reject_member_of_ref_xchg()
309 return 0; in reject_member_of_ref_xchg()
316 struct map_value *v; in reject_indirect_helper_access() local
317 int key = 0; in reject_indirect_helper_access()
319 v = bpf_map_lookup_elem(&array_map, &key); in reject_indirect_helper_access()
320 if (!v) in reject_indirect_helper_access()
321 return 0; in reject_indirect_helper_access()
323 bpf_get_current_comm(v, sizeof(v->buf) + 1); in reject_indirect_helper_access()
324 return 0; in reject_indirect_helper_access()
330 return p ? *p = 42 : 0; in write_func()
337 struct map_value *v; in reject_indirect_global_func_access() local
338 int key = 0; in reject_indirect_global_func_access()
340 v = bpf_map_lookup_elem(&array_map, &key); in reject_indirect_global_func_access()
341 if (!v) in reject_indirect_global_func_access()
342 return 0; in reject_indirect_global_func_access()
344 return write_func((void *)v + 5); in reject_indirect_global_func_access()
352 struct map_value *v; in kptr_xchg_ref_state() local
353 int key = 0; in kptr_xchg_ref_state()
355 v = bpf_map_lookup_elem(&array_map, &key); in kptr_xchg_ref_state()
356 if (!v) in kptr_xchg_ref_state()
357 return 0; in kptr_xchg_ref_state()
359 p = bpf_kfunc_call_test_acquire(&(unsigned long){0}); in kptr_xchg_ref_state()
361 return 0; in kptr_xchg_ref_state()
362 bpf_kptr_xchg(&v->ref_ptr, p); in kptr_xchg_ref_state()
363 return 0; in kptr_xchg_ref_state()
371 struct map_value *v; in kptr_xchg_possibly_null() local
372 int key = 0; in kptr_xchg_possibly_null()
374 v = bpf_map_lookup_elem(&array_map, &key); in kptr_xchg_possibly_null()
375 if (!v) in kptr_xchg_possibly_null()
376 return 0; in kptr_xchg_possibly_null()
378 p = bpf_kfunc_call_test_acquire(&(unsigned long){0}); in kptr_xchg_possibly_null()
381 p = bpf_kptr_xchg(&v->ref_ptr, p); in kptr_xchg_possibly_null()
385 return 0; in kptr_xchg_possibly_null()