/kernel/linux/linux-5.10/samples/bpf/ |
D | parse_varlen.c | 22 static int tcp(void *data, uint64_t tp_off, void *data_end) in tcp() argument 26 if (tcp + 1 > data_end) in tcp() 33 static int udp(void *data, uint64_t tp_off, void *data_end) in udp() argument 37 if (udp + 1 > data_end) in udp() 51 static int parse_ipv4(void *data, uint64_t nh_off, void *data_end) in parse_ipv4() argument 57 if (iph + 1 > data_end) in parse_ipv4() 66 if (iph + 1 > data_end) in parse_ipv4() 72 return tcp(data, nh_off + ihl_len, data_end); in parse_ipv4() 74 return udp(data, nh_off + ihl_len, data_end); in parse_ipv4() 78 static int parse_ipv6(void *data, uint64_t nh_off, void *data_end) in parse_ipv6() argument [all …]
|
D | xdp_tx_iptunnel_kern.c | 45 static __always_inline int get_dport(void *trans_data, void *data_end, in get_dport() argument 54 if (th + 1 > data_end) in get_dport() 59 if (uh + 1 > data_end) in get_dport() 79 void *data_end = (void *)(long)xdp->data_end; in handle_ipv4() local 92 if (iph + 1 > data_end) in handle_ipv4() 95 dport = get_dport(iph + 1, data_end, iph->protocol); in handle_ipv4() 116 data_end = (void *)(long)xdp->data_end; in handle_ipv4() 122 if (new_eth + 1 > data_end || in handle_ipv4() 123 old_eth + 1 > data_end || in handle_ipv4() 124 iph + 1 > data_end) in handle_ipv4() [all …]
|
D | tc_l2_redirect_kern.c | 64 void *data_end = (void *)(long)skb->data_end; in _l2_to_iptun_ingress_forward() local 69 if (data + sizeof(*eth) > data_end) in _l2_to_iptun_ingress_forward() 80 if (data + sizeof(*eth) + sizeof(*iph) > data_end) in _l2_to_iptun_ingress_forward() 93 if (data + sizeof(*eth) + sizeof(*ip6h) > data_end) in _l2_to_iptun_ingress_forward() 115 void *data_end = (void *)(long)skb->data_end; in _l2_to_iptun_ingress_redirect() local 120 if (data + sizeof(*eth) > data_end) in _l2_to_iptun_ingress_redirect() 132 if (data + sizeof(*eth) + sizeof(*iph) > data_end) in _l2_to_iptun_ingress_redirect() 156 void *data_end = (void *)(long)skb->data_end; in _l2_to_ip6tun_ingress_redirect() local 159 if (data + sizeof(*eth) > data_end) in _l2_to_ip6tun_ingress_redirect() 170 if (data + sizeof(*eth) + sizeof(*iph) > data_end) in _l2_to_ip6tun_ingress_redirect() [all …]
|
D | xdp_redirect_cpu_kern.c | 115 bool parse_eth(struct ethhdr *eth, void *data_end, in parse_eth() argument 122 if ((void *)eth + offset > data_end) in parse_eth() 137 if ((void *)eth + offset > data_end) in parse_eth() 147 if ((void *)eth + offset > data_end) in parse_eth() 160 void *data_end = (void *)(long)ctx->data_end; in get_dest_port_ipv4_udp() local 166 if (iph + 1 > data_end) in get_dest_port_ipv4_udp() 172 if (udph + 1 > data_end) in get_dest_port_ipv4_udp() 182 void *data_end = (void *)(long)ctx->data_end; in get_proto_ipv4() local 186 if (iph + 1 > data_end) in get_proto_ipv4() 194 void *data_end = (void *)(long)ctx->data_end; in get_proto_ipv6() local [all …]
|
D | xdp1_kern.c | 24 static int parse_ipv4(void *data, u64 nh_off, void *data_end) in parse_ipv4() argument 28 if (iph + 1 > data_end) in parse_ipv4() 33 static int parse_ipv6(void *data, u64 nh_off, void *data_end) in parse_ipv6() argument 37 if (ip6h + 1 > data_end) in parse_ipv6() 45 void *data_end = (void *)(long)ctx->data_end; in xdp_prog1() local 55 if (data + nh_off > data_end) in xdp_prog1() 65 if (data + nh_off > data_end) in xdp_prog1() 74 if (data + nh_off > data_end) in xdp_prog1() 80 ipproto = parse_ipv4(data, nh_off, data_end); in xdp_prog1() 82 ipproto = parse_ipv6(data, nh_off, data_end); in xdp_prog1()
|
D | xdp2_kern.c | 40 static int parse_ipv4(void *data, u64 nh_off, void *data_end) in parse_ipv4() argument 44 if (iph + 1 > data_end) in parse_ipv4() 49 static int parse_ipv6(void *data, u64 nh_off, void *data_end) in parse_ipv6() argument 53 if (ip6h + 1 > data_end) in parse_ipv6() 61 void *data_end = (void *)(long)ctx->data_end; in xdp_prog1() local 71 if (data + nh_off > data_end) in xdp_prog1() 81 if (data + nh_off > data_end) in xdp_prog1() 90 if (data + nh_off > data_end) in xdp_prog1() 96 ipproto = parse_ipv4(data, nh_off, data_end); in xdp_prog1() 98 ipproto = parse_ipv6(data, nh_off, data_end); in xdp_prog1()
|
D | xdp_adjust_tail_kern.c | 77 void *data_end = (void *)(long)xdp->data_end; in send_icmp4_too_big() local 79 if (data + (ICMP_TOOBIG_SIZE + headroom) > data_end) in send_icmp4_too_big() 122 void *data_end = (void *)(long)xdp->data_end; in handle_ipv4() local 124 int pckt_size = data_end - data; in handle_ipv4() 139 void *data_end = (void *)(long)xdp->data_end; in _xdp_icmp() local 144 if (eth + 1 > data_end) in _xdp_icmp()
|
/kernel/linux/linux-5.10/tools/testing/selftests/bpf/progs/ |
D | test_xdp.c | 48 static __always_inline int get_dport(void *trans_data, void *data_end, in get_dport() argument 57 if (th + 1 > data_end) in get_dport() 62 if (uh + 1 > data_end) in get_dport() 82 void *data_end = (void *)(long)xdp->data_end; in handle_ipv4() local 95 if (iph + 1 > data_end) in handle_ipv4() 98 dport = get_dport(iph + 1, data_end, iph->protocol); in handle_ipv4() 117 data_end = (void *)(long)xdp->data_end; in handle_ipv4() 123 if (new_eth + 1 > data_end || in handle_ipv4() 124 old_eth + 1 > data_end || in handle_ipv4() 125 iph + 1 > data_end) in handle_ipv4() [all …]
|
D | test_xdp_loop.c | 44 static __always_inline int get_dport(void *trans_data, void *data_end, in get_dport() argument 53 if (th + 1 > data_end) in get_dport() 58 if (uh + 1 > data_end) in get_dport() 78 void *data_end = (void *)(long)xdp->data_end; in handle_ipv4() local 91 if (iph + 1 > data_end) in handle_ipv4() 94 dport = get_dport(iph + 1, data_end, iph->protocol); in handle_ipv4() 113 data_end = (void *)(long)xdp->data_end; in handle_ipv4() 119 if (new_eth + 1 > data_end || in handle_ipv4() 120 old_eth + 1 > data_end || in handle_ipv4() 121 iph + 1 > data_end) in handle_ipv4() [all …]
|
D | test_xdp_noinline.c | 232 bool parse_udp(void *data, void *data_end, in parse_udp() argument 241 if (udp + 1 > data_end) in parse_udp() 254 bool parse_tcp(void *data, void *data_end, in parse_tcp() argument 263 if (tcp + 1 > data_end) in parse_tcp() 286 void *data_end; in encap_v6() local 292 data_end = (void *)(long)xdp->data_end; in encap_v6() 296 if (new_eth + 1 > data_end || in encap_v6() 297 old_eth + 1 > data_end || ip6h + 1 > data_end) in encap_v6() 332 void *data_end; in encap_v4() local 340 data_end = (void *)(long)xdp->data_end; in encap_v4() [all …]
|
D | test_btf_skc_cls_ingress.c | 33 void *data_end; in test_syncookie_helper() local 35 data_end = (void *)(long)(skb->data_end); in test_syncookie_helper() 42 if ((void *)th + 40 > data_end) { in test_syncookie_helper() 75 void *data_end; in handle_ip6_tcp() local 77 data_end = (void *)(long)(skb->data_end); in handle_ip6_tcp() 80 if (th + 1 > data_end) in handle_ip6_tcp() 89 if ((void *)tuple + tuple_len > data_end) { in handle_ip6_tcp() 153 void *data_end; in cls_ingress() local 155 data_end = (void *)(long)(skb->data_end); in cls_ingress() 158 if (eth + 1 > data_end) in cls_ingress() [all …]
|
D | test_tc_neigh_fib.c | 27 void *data_end = ctx_ptr(skb->data_end); in fill_fib_params_v4() local 31 if (data + sizeof(struct ethhdr) > data_end) in fill_fib_params_v4() 35 if ((void *)(ip4h + 1) > data_end) in fill_fib_params_v4() 55 void *data_end = ctx_ptr(skb->data_end); in fill_fib_params_v6() local 59 if (data + sizeof(struct ethhdr) > data_end) in fill_fib_params_v6() 63 if ((void *)(ip6h + 1) > data_end) in fill_fib_params_v6() 80 void *data_end = ctx_ptr(skb->data_end); in tc_chk() local 84 if (data + sizeof(struct ethhdr) > data_end) in tc_chk() 127 void *data_end = ctx_ptr(skb->data_end); in tc_redir() local 130 if (eth + 1 > data_end) in tc_redir()
|
D | test_xdp_vlan.c | 57 bool parse_eth_frame(struct ethhdr *eth, void *data_end, struct parse_pkt *pkt) in parse_eth_frame() argument 64 if ((void *)eth + offset + (2*sizeof(struct _vlan_hdr)) > data_end) in parse_eth_frame() 108 void *data_end = (void *)(long)ctx->data_end; in xdp_prognum0() local 112 if (!parse_eth_frame(data, data_end, &pkt)) in xdp_prognum0() 150 void *data_end = (void *)(long)ctx->data_end; in xdp_prognum1() local 154 if (!parse_eth_frame(data, data_end, &pkt)) in xdp_prognum1() 184 void *data_end = (void *)(long)ctx->data_end; in xdp_prognum2() local 189 if (!parse_eth_frame(data, data_end, &pkt)) in xdp_prognum2() 243 void *data_end = (void *)(long)ctx->data_end; in xdp_prognum3() local 248 if (!parse_eth_frame(orig_eth, data_end, &pkt)) in xdp_prognum3()
|
D | test_tc_neigh.c | 51 void *data_end = ctx_ptr(skb->data_end); in is_remote_ep_v4() local 55 if (data + sizeof(struct ethhdr) > data_end) in is_remote_ep_v4() 59 if ((void *)(ip4h + 1) > data_end) in is_remote_ep_v4() 68 void *data_end = ctx_ptr(skb->data_end); in is_remote_ep_v6() local 72 if (data + sizeof(struct ethhdr) > data_end) in is_remote_ep_v6() 76 if ((void *)(ip6h + 1) > data_end) in is_remote_ep_v6() 91 void *data_end = ctx_ptr(skb->data_end); in tc_chk() local 95 if (data + sizeof(struct ethhdr) > data_end) in tc_chk()
|
D | test_tcp_check_syncookie_kern.c | 26 static __always_inline __s64 gen_syncookie(void *data_end, struct bpf_sock *sk, in gen_syncookie() argument 37 if ((void *)tcph + thlen > data_end) in gen_syncookie() 46 void *data_end) in check_syncookie() argument 61 if (ethh + 1 > data_end) in check_syncookie() 67 if (ipv4h + 1 > data_end) in check_syncookie() 74 if (tcph + 1 > data_end) in check_syncookie() 90 seq_mss = gen_syncookie(data_end, sk, ipv4h, sizeof(*ipv4h), in check_syncookie() 99 if (ipv6h + 1 > data_end) in check_syncookie() 106 if (tcph + 1 > data_end) in check_syncookie() 122 seq_mss = gen_syncookie(data_end, sk, ipv6h, sizeof(*ipv6h), in check_syncookie() [all …]
|
D | test_xdp_meta.c | 14 __u8 *data, *data_meta, *data_end; in ing_cls() local 18 data_end = ctx_ptr(ctx, data_end); in ing_cls() 21 if (data + ETH_ALEN > data_end || in ing_cls() 34 __u8 *data, *data_meta, *data_end; in ing_xdp() local 42 data_end = ctx_ptr(ctx, data_end); in ing_xdp() 45 if (data + ETH_ALEN > data_end || in ing_xdp()
|
D | test_pkt_access.c | 86 void *data_end = (void *)(long)skb->data_end; in test_pkt_write_access_subprog() local 93 if (tcp + 1 > data_end) in test_pkt_write_access_subprog() 103 void *data_end = (void *)(long)skb->data_end; in test_pkt_access() local 110 if (eth + 1 > data_end) in test_pkt_access() 116 if (iph + 1 > data_end) in test_pkt_access() 124 if (ip6h + 1 > data_end) in test_pkt_access() 140 if (((void *)(tcp) + 20) > data_end || proto != 6) in test_pkt_access() 143 if (((void *)(tcp) + 18) > data_end) in test_pkt_access()
|
D | sockmap_parse_prog.c | 10 void *data_end = (void *)(long) skb->data_end; in bpf_prog1() local 17 if (data + 10 > data_end) { in bpf_prog1() 22 data_end = (void *)(long)skb->data_end; in bpf_prog1() 24 if (data + 10 > data_end) in bpf_prog1()
|
D | test_tc_edt.c | 67 void *data_end = (void *)(long)skb->data_end; in handle_tcp() local 70 if ((void *)(tcp + 1) > data_end) in handle_tcp() 81 void *data_end = (void *)(long)skb->data_end; in handle_ipv4() local 87 if (data + sizeof(struct ethhdr) > data_end) in handle_ipv4() 90 if ((void *)(iph + 1) > data_end) in handle_ipv4() 93 if (((void *)iph) + ihl > data_end) in handle_ipv4()
|
D | test_l4lb.c | 236 static __always_inline int parse_icmpv6(void *data, void *data_end, __u64 off, in parse_icmpv6() argument 243 if (icmp_hdr + 1 > data_end) in parse_icmpv6() 249 if (ip6h + 1 > data_end) in parse_icmpv6() 258 static __always_inline int parse_icmp(void *data, void *data_end, __u64 off, in parse_icmp() argument 265 if (icmp_hdr + 1 > data_end) in parse_icmp() 272 if (iph + 1 > data_end) in parse_icmp() 283 static __always_inline bool parse_udp(void *data, __u64 off, void *data_end, in parse_udp() argument 289 if (udp + 1 > data_end) in parse_udp() 302 static __always_inline bool parse_tcp(void *data, __u64 off, void *data_end, in parse_tcp() argument 308 if (tcp + 1 > data_end) in parse_tcp() [all …]
|
D | test_l4lb_noinline.c | 233 static __noinline int parse_icmpv6(void *data, void *data_end, __u64 off, in parse_icmpv6() argument 240 if (icmp_hdr + 1 > data_end) in parse_icmpv6() 246 if (ip6h + 1 > data_end) in parse_icmpv6() 255 static __noinline int parse_icmp(void *data, void *data_end, __u64 off, in parse_icmp() argument 262 if (icmp_hdr + 1 > data_end) in parse_icmp() 269 if (iph + 1 > data_end) in parse_icmp() 280 static __noinline bool parse_udp(void *data, __u64 off, void *data_end, in parse_udp() argument 286 if (udp + 1 > data_end) in parse_udp() 299 static __noinline bool parse_tcp(void *data, __u64 off, void *data_end, in parse_tcp() argument 305 if (tcp + 1 > data_end) in parse_tcp() [all …]
|
D | test_sk_lookup_kern.c | 23 void *data_end, __u16 eth_proto, in get_tuple() argument 33 if (iph + 1 > data_end) in get_tuple() 42 if (ip6h + 1 > data_end) in get_tuple() 50 if (data + nh_off + ihl_len > data_end || proto != IPPROTO_TCP) in get_tuple() 59 void *data_end = (void *)(long)skb->data_end; in bpf_sk_lookup_test0() local 67 if (eth + 1 > data_end) in bpf_sk_lookup_test0() 70 tuple = get_tuple(data, sizeof(*eth), data_end, eth->h_proto, &ipv4); in bpf_sk_lookup_test0() 71 if (!tuple || tuple + sizeof *tuple > data_end) in bpf_sk_lookup_test0()
|
D | sockmap_tcp_msg_prog.c | 11 void *data_end = (void *)(long) msg->data_end; in bpf_prog1() local 16 if (data + 8 > data_end) in bpf_prog1() 19 bpf_printk("data length %i\n", (__u64)msg->data_end - (__u64)msg->data); in bpf_prog1()
|
/kernel/linux/linux-5.10/tools/testing/selftests/bpf/verifier/ |
D | direct_packet_access.c | 5 offsetof(struct __sk_buff, data_end)), 21 offsetof(struct __sk_buff, data_end)), 37 offsetof(struct __sk_buff, data_end)), 57 offsetof(struct __sk_buff, data_end)), 84 offsetof(struct __sk_buff, data_end)), 101 offsetof(struct __sk_buff, data_end)), 120 offsetof(struct __sk_buff, data_end)), 140 offsetof(struct __sk_buff, data_end)), 161 offsetof(struct __sk_buff, data_end)), 182 offsetof(struct __sk_buff, data_end)), [all …]
|
D | helper_packet_access.c | 6 offsetof(struct xdp_md, data_end)), 41 offsetof(struct xdp_md, data_end)), 66 offsetof(struct xdp_md, data_end)), 87 offsetof(struct xdp_md, data_end)), 108 offsetof(struct __sk_buff, data_end)), 144 offsetof(struct __sk_buff, data_end)), 170 offsetof(struct __sk_buff, data_end)), 192 offsetof(struct __sk_buff, data_end)), 213 offsetof(struct __sk_buff, data_end)), 235 offsetof(struct __sk_buff, data_end)), [all …]
|