Home
last modified time | relevance | path

Searched refs:dynptr (Results 1 – 8 of 8) sorted by relevance

/linux/tools/testing/selftests/bpf/progs/
H A Duser_ringbuf_fail.c30 bad_access1(struct bpf_dynptr *dynptr, void *context) in bad_access1() argument
34 sample = bpf_dynptr_data(dynptr - 1, 0, sizeof(*sample)); in bad_access1()
35 bpf_printk("Was able to pass bad pointer %lx\n", (__u64)dynptr - 1); in bad_access1()
53 bad_access2(struct bpf_dynptr *dynptr, void *context) in bad_access2() argument
57 sample = bpf_dynptr_data(dynptr + 1, 0, sizeof(*sample)); in bad_access2()
58 bpf_printk("Was able to pass bad pointer %lx\n", (__u64)dynptr + 1); in bad_access2()
76 write_forbidden(struct bpf_dynptr *dynptr, void *context) in write_forbidden() argument
78 *((long *)dynptr) = 0; in write_forbidden()
96 null_context_write(struct bpf_dynptr *dynptr, void *context) in null_context_write() argument
116 null_context_read(struct bpf_dynptr *dynptr, void *context) in null_context_read() argument
[all …]
H A Dtest_cls_redirect_dynptr.c125 static int pkt_parse_ipv4(struct bpf_dynptr *dynptr, __u64 *offset, struct iphdr *iphdr) in pkt_parse_ipv4() argument
127 if (bpf_dynptr_read(iphdr, sizeof(*iphdr), dynptr, *offset, 0)) in pkt_parse_ipv4()
142 static bool pkt_parse_icmp_l4_ports(struct bpf_dynptr *dynptr, __u64 *offset, flow_ports_t *ports) in pkt_parse_icmp_l4_ports() argument
144 if (bpf_dynptr_read(ports, sizeof(*ports), dynptr, *offset, 0)) in pkt_parse_icmp_l4_ports()
187 static bool pkt_skip_ipv6_extension_headers(struct bpf_dynptr *dynptr, __u64 *offset, in pkt_skip_ipv6_extension_headers() argument
215 if (bpf_dynptr_read(&exthdr, sizeof(exthdr), dynptr, *offset, 0)) in pkt_skip_ipv6_extension_headers()
244 static int pkt_parse_ipv6(struct bpf_dynptr *dynptr, __u64 *offset, struct ipv6hdr *ipv6, in pkt_parse_ipv6() argument
247 if (bpf_dynptr_read(ipv6, sizeof(*ipv6), dynptr, *offset, 0)) in pkt_parse_ipv6()
252 if (!pkt_skip_ipv6_extension_headers(dynptr, offset, ipv6, proto, is_fragment)) in pkt_parse_ipv6()
293 static ret_t forward_with_gre(struct __sk_buff *skb, struct bpf_dynptr *dynptr, in forward_with_gre() argument
420 forward_to_next_hop(struct __sk_buff * skb,struct bpf_dynptr * dynptr,encap_headers_t * encap,struct in_addr * next_hop,metrics_t * metrics) forward_to_next_hop() argument
477 get_next_hop(struct bpf_dynptr * dynptr,__u64 * offset,encap_headers_t * encap,struct in_addr * next_hop) get_next_hop() argument
605 process_icmpv4(struct __sk_buff * skb,struct bpf_dynptr * dynptr,__u64 * offset,metrics_t * metrics) process_icmpv4() argument
654 process_icmpv6(struct bpf_dynptr * dynptr,__u64 * offset,struct __sk_buff * skb,metrics_t * metrics) process_icmpv6() argument
706 process_tcp(struct bpf_dynptr * dynptr,__u64 * offset,struct __sk_buff * skb,struct iphdr_info * info,metrics_t * metrics) process_tcp() argument
729 process_udp(struct bpf_dynptr * dynptr,__u64 * offset,struct __sk_buff * skb,struct iphdr_info * info,metrics_t * metrics) process_udp() argument
748 process_ipv4(struct __sk_buff * skb,struct bpf_dynptr * dynptr,__u64 * offset,metrics_t * metrics) process_ipv4() argument
790 process_ipv6(struct __sk_buff * skb,struct bpf_dynptr * dynptr,__u64 * offset,metrics_t * metrics) process_ipv6() argument
838 struct bpf_dynptr dynptr; cls_redirect() local
[all...]
H A Duser_ringbuf_success.c38 record_sample(struct bpf_dynptr *dynptr, void *context) in record_sample() argument
46 status = bpf_dynptr_read(&stack_sample, sizeof(stack_sample), dynptr, 0, 0); in record_sample()
53 sample = bpf_dynptr_data(dynptr, 0, sizeof(*sample)); in record_sample()
89 read_protocol_msg(struct bpf_dynptr *dynptr, void *context) in read_protocol_msg() argument
93 msg = bpf_dynptr_data(dynptr, 0, sizeof(*msg)); in read_protocol_msg()
193 do_nothing_cb(struct bpf_dynptr *dynptr, void *context) in do_nothing_cb() argument
H A Dverifier_iterating_callbacks.c134 static __u64 ringbuf_drain_cb(struct bpf_dynptr *dynptr, void *data) in ringbuf_drain_cb() argument
H A Ddynptr_fail.c128 /* Any dynptr initialized within a callback must have bpf_dynptr_put called */
137 /* Can't call bpf_ringbuf_submit/discard_dynptr on a non-initialized dynptr */
150 /* A dynptr can't be used after it has been invalidated */
152 __failure __msg("Expected an initialized dynptr as arg #2")
170 /* Can't call non-dynptr ringbuf APIs on a dynptr ringbuf sample */
185 /* invalid API use. need to use dynptr API to submit/discard */ in ringbuf_invalid_api()
193 /* Can't add a dynptr to a map */
211 /* Can't add a struct with an embedded dynptr to a map */
341 * This tests the case where the data slice tracks a dynptr (ptr in data_slice_use_after_release2()
1715 global_call_bpf_dynptr(const struct bpf_dynptr * dynptr) global_call_bpf_dynptr() argument
[all...]
/linux/kernel/bpf/
H A Dringbuf.c839 struct bpf_dynptr_kern dynptr; in BPF_CALL_4()
854 bpf_dynptr_init(&dynptr, sample, BPF_DYNPTR_TYPE_LOCAL, 0, size); in BPF_CALL_4()
855 ret = callback((uintptr_t)&dynptr, (uintptr_t)callback_ctx, 0, 0, 0); in BPF_CALL_4()
838 struct bpf_dynptr_kern dynptr; BPF_CALL_4() local
H A Dverifier.c524 * Please note that the spi grows downwards. For example, a dynptr
560 return stack_slot_obj_get_spi(env, reg, "dynptr", BPF_DYNPTR_NR_SLOTS); in is_async_cb_sleepable()
655 /* We cannot assume both spi and spi - 1 belong to the same dynptr, in stack_slot_obj_get_spi()
661 * case they do belong to same dynptr, second call won't see slot_type in stack_slot_obj_get_spi()
722 * be released by any dynptr helper. Hence, unmark_stack_slots_dynptr in get_dynptr_type_flag()
733 if (!dynptr_type_refcounted(state->stack[spi].spilled_ptr.dynptr.type)) { in get_dynptr_type_flag()
740 /* If the dynptr has a ref_obj_id, then we need to invalidate
744 * 2) Any slices derived from this dynptr.
747 /* Invalidate any slices associated with this dynptr */
750 /* Invalidate any dynptr clone in mark_dynptr_stack_regs()
[all...]
H A Dhelpers.c1760 /* Since the upper 8 bits of dynptr->size is reserved, the in bpf_dynptr_set_rdonly()
1915 * copy the data. E.g. bpf_dynptr_from_mem may create two dynptr in __bpf_dynptr_read()
1930 WARN_ONCE(true, "bpf_dynptr_read: unknown dynptr type %d\n", type);
1973 * copy the data. E.g. bpf_dynptr_from_mem may create two dynptr in __bpf_dynptr_write()
1989 WARN_ONCE(true, "bpf_dynptr_write: unknown dynptr type %d\n", type);
2038 WARN_ONCE(true, "bpf_dynptr_data: unknown dynptr type %d\n", type);
2925 * bpf_dynptr_slice() - Obtain a read-only pointer to the dynptr data. in bpf_dynptr_slice_rdwr()
2926 * @p: The dynptr whose data slice to retrieve in bpf_dynptr_slice_rdwr()
2927 * @offset: Offset into the dynptr in bpf_dynptr_slice_rdwr()
2947 * Return: NULL if the call failed (eg invalid dynptr), pointe in bpf_dynptr_adjust()
4443 bpf_dynptr_file_discard(struct bpf_dynptr * dynptr) bpf_dynptr_file_discard() argument
[all...]