Lines Matching refs:fprog

634 static struct seccomp_filter *seccomp_prepare_filter(struct sock_fprog *fprog)  in seccomp_prepare_filter()  argument
645 if (fprog->len == 0 || fprog->len > BPF_MAXINSNS) in seccomp_prepare_filter()
648 BUG_ON(INT_MAX / fprog->len < sizeof(struct sock_filter)); in seccomp_prepare_filter()
666 ret = bpf_prog_create_from_user(&sfilter->prog, fprog, 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()
698 fprog.filter = compat_ptr(fprog32.filter); in seccomp_prepare_user_filter()
701 if (copy_from_user(&fprog, user_filter, sizeof(fprog))) in seccomp_prepare_user_filter()
703 filter = seccomp_prepare_filter(&fprog); in seccomp_prepare_user_filter()
715 static bool seccomp_is_const_allow(struct sock_fprog_kern *fprog, in seccomp_is_const_allow() argument
722 if (WARN_ON_ONCE(!fprog)) in seccomp_is_const_allow()
725 for (pc = 0; pc < fprog->len; pc++) { in seccomp_is_const_allow()
726 struct sock_filter *insn = &fprog->filter[pc]; in seccomp_is_const_allow()
792 struct sock_fprog_kern *fprog = sfilter->prog->orig_prog; in seccomp_cache_prepare_bitmap() local
813 if (seccomp_is_const_allow(fprog, &sd)) in seccomp_cache_prepare_bitmap()
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()
2077 if (copy_to_user(data, fprog->filter, bpf_classic_proglen(fprog))) in seccomp_get_filter()