Home
last modified time | relevance | path

Searched refs:fprog (Results 1 – 10 of 10) sorted by relevance

/linux/drivers/net/team/
A Dteam_mode_loadbalance.c263 struct sock_fprog_kern *fprog; in __fprog_create() local
268 fprog = kmalloc(sizeof(*fprog), GFP_KERNEL); in __fprog_create()
269 if (!fprog) in __fprog_create()
272 if (!fprog->filter) { in __fprog_create()
273 kfree(fprog); in __fprog_create()
277 *pfprog = fprog; in __fprog_create()
283 kfree(fprog->filter); in __fprog_destroy()
284 kfree(fprog); in __fprog_destroy()
300 err = bpf_prog_create(&fp, fprog); in lb_bpf_func_set()
302 __fprog_destroy(fprog); in lb_bpf_func_set()
[all …]
/linux/kernel/
A Dseccomp.c645 if (fprog->len == 0 || fprog->len > BPF_MAXINSNS) in seccomp_prepare_filter()
689 struct sock_fprog fprog; in seccomp_prepare_user_filter() local
697 fprog.len = fprog32.len; in seccomp_prepare_user_filter()
701 if (copy_from_user(&fprog, user_filter, sizeof(fprog))) in seccomp_prepare_user_filter()
722 if (WARN_ON_ONCE(!fprog)) in seccomp_is_const_allow()
725 for (pc = 0; pc < fprog->len; pc++) { in seccomp_is_const_allow()
2051 struct sock_fprog_kern *fprog; in seccomp_get_filter() local
2063 fprog = filter->prog->orig_prog; in seccomp_get_filter()
2064 if (!fprog) { in seccomp_get_filter()
2073 ret = fprog->len; in seccomp_get_filter()
[all …]
/linux/net/core/
A Dsock_diag.c74 struct sock_fprog_kern *fprog; in sock_diag_put_filterinfo() local
90 fprog = filter->prog->orig_prog; in sock_diag_put_filterinfo()
91 if (!fprog) in sock_diag_put_filterinfo()
94 flen = bpf_classic_proglen(fprog); in sock_diag_put_filterinfo()
102 memcpy(nla_data(attr), fprog->filter, flen); in sock_diag_put_filterinfo()
A Dfilter.c1157 if (fprog) { in bpf_release_orig_filter()
1159 kfree(fprog); in bpf_release_orig_filter()
1364 if (!bpf_check_basics_ok(fprog->filter, fprog->len)) in bpf_prog_create()
1373 fp->len = fprog->len; in bpf_prog_create()
1411 if (!bpf_check_basics_ok(fprog->filter, fprog->len)) in bpf_prog_create_from_user()
1423 fp->len = fprog->len; in bpf_prog_create_from_user()
1489 if (!bpf_check_basics_ok(fprog->filter, fprog->len)) in __get_filter()
10170 if (!fprog) in sk_get_filter()
10173 ret = fprog->len; in sk_get_filter()
10183 if (copy_to_user(ubuf, fprog->filter, bpf_classic_proglen(fprog))) in sk_get_filter()
[all …]
A Dsock.c1220 struct sock_fprog fprog; in sock_setsockopt() local
1222 ret = copy_bpf_fprog_from_user(&fprog, optval, optlen); in sock_setsockopt()
1224 ret = sk_attach_filter(&fprog, sk); in sock_setsockopt()
1241 struct sock_fprog fprog; in sock_setsockopt() local
1243 ret = copy_bpf_fprog_from_user(&fprog, optval, optlen); in sock_setsockopt()
1245 ret = sk_reuseport_attach_filter(&fprog, sk); in sock_setsockopt()
/linux/include/linux/
A Dfilter.h874 #define bpf_classic_proglen(fprog) (fprog->len * sizeof(fprog->filter[0])) argument
933 int bpf_prog_create(struct bpf_prog **pfp, struct sock_fprog_kern *fprog);
934 int bpf_prog_create_from_user(struct bpf_prog **pfp, struct sock_fprog *fprog,
938 int sk_attach_filter(struct sock_fprog *fprog, struct sock *sk);
940 int sk_reuseport_attach_filter(struct sock_fprog *fprog, struct sock *sk);
/linux/drivers/net/ppp/
A Dppp_generic.c558 struct sock_fprog_kern fprog; in get_filter() local
566 fprog.len = uprog->len; in get_filter()
567 fprog.filter = memdup_user(uprog->filter, in get_filter()
569 if (IS_ERR(fprog.filter)) in get_filter()
570 return ERR_CAST(fprog.filter); in get_filter()
572 err = bpf_prog_create(&res, &fprog); in get_filter()
573 kfree(fprog.filter); in get_filter()
/linux/drivers/net/
A Dtun.c194 struct sock_fprog fprog; member
772 err = sk_attach_filter(&tun->fprog, tfile->socket.sk); in tun_attach()
2862 ret = sk_attach_filter(&tun->fprog, tfile->socket.sk); in tun_attach_filter()
3248 if (copy_from_user(&tun->fprog, argp, sizeof(tun->fprog))) in __tun_chr_ioctl()
3268 if (copy_to_user(argp, &tun->fprog, sizeof(tun->fprog))) in __tun_chr_ioctl()
/linux/net/packet/
A Daf_packet.c1589 struct sock_fprog fprog; in fanout_set_data_cbpf() local
1595 ret = copy_bpf_fprog_from_user(&fprog, data, len); in fanout_set_data_cbpf()
1599 ret = bpf_prog_create_from_user(&new, &fprog, NULL, false); in fanout_set_data_cbpf()
/linux/lib/
A Dtest_bpf.c14172 struct sock_fprog_kern fprog; in generate_filter() local
14177 fprog.filter = fptr; in generate_filter()
14178 fprog.len = flen; in generate_filter()
14180 *err = bpf_prog_create(&fp, &fprog); in generate_filter()
14198 *err, fprog.len); in generate_filter()

Completed in 94 milliseconds