Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net: filter: rename sk_chk_filter() -> bpf_check_classic()

trivial rename to indicate that this functions performs classic BPF checking

Signed-off-by: Alexei Starovoitov <ast@plumgrid.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Alexei Starovoitov and committed by
David S. Miller
4df95ff4 009937e7

+10 -10
+1 -1
Documentation/networking/filter.txt
··· 591 591 SK_RUN_FILTER(filter, ctx) transparently invokes eBPF interpreter or JITed 592 592 code to run the filter. 'filter' is a pointer to struct sk_filter that we 593 593 got from sk_unattached_filter_create(), and 'ctx' the given context (e.g. 594 - skb pointer). All constraints and restrictions from sk_chk_filter() apply 594 + skb pointer). All constraints and restrictions from bpf_check_classic() apply 595 595 before a conversion to the new layout is being done behind the scenes! 596 596 597 597 Currently, the classic BPF format is being used for JITing on most of the
+1 -1
include/linux/filter.h
··· 361 361 int sk_attach_filter(struct sock_fprog *fprog, struct sock *sk); 362 362 int sk_detach_filter(struct sock *sk); 363 363 364 - int sk_chk_filter(const struct sock_filter *filter, unsigned int flen); 364 + int bpf_check_classic(const struct sock_filter *filter, unsigned int flen); 365 365 int sk_get_filter(struct sock *sk, struct sock_filter __user *filter, 366 366 unsigned int len); 367 367
+1 -1
kernel/bpf/core.c
··· 18 18 * 2 of the License, or (at your option) any later version. 19 19 * 20 20 * Andi Kleen - Fix a few bad bugs and races. 21 - * Kris Katterjohn - Added many additional checks in sk_chk_filter() 21 + * Kris Katterjohn - Added many additional checks in bpf_check_classic() 22 22 */ 23 23 #include <linux/filter.h> 24 24 #include <linux/skbuff.h>
+2 -2
kernel/seccomp.c
··· 87 87 * @filter: filter to verify 88 88 * @flen: length of filter 89 89 * 90 - * Takes a previously checked filter (by sk_chk_filter) and 90 + * Takes a previously checked filter (by bpf_check_classic) and 91 91 * redirects all filter code that loads struct sk_buff data 92 92 * and related data through seccomp_bpf_load. It also 93 93 * enforces length and alignment checking of those loads. ··· 239 239 goto free_prog; 240 240 241 241 /* Check and rewrite the fprog via the skb checker */ 242 - ret = sk_chk_filter(fp, fprog->len); 242 + ret = bpf_check_classic(fp, fprog->len); 243 243 if (ret) 244 244 goto free_prog; 245 245
+5 -5
net/core/filter.c
··· 18 18 * 2 of the License, or (at your option) any later version. 19 19 * 20 20 * Andi Kleen - Fix a few bad bugs and races. 21 - * Kris Katterjohn - Added many additional checks in sk_chk_filter() 21 + * Kris Katterjohn - Added many additional checks in bpf_check_classic() 22 22 */ 23 23 24 24 #include <linux/module.h> ··· 721 721 } 722 722 723 723 /** 724 - * sk_chk_filter - verify socket filter code 724 + * bpf_check_classic - verify socket filter code 725 725 * @filter: filter to verify 726 726 * @flen: length of filter 727 727 * ··· 734 734 * 735 735 * Returns 0 if the rule set is legal or -EINVAL if not. 736 736 */ 737 - int sk_chk_filter(const struct sock_filter *filter, unsigned int flen) 737 + int bpf_check_classic(const struct sock_filter *filter, unsigned int flen) 738 738 { 739 739 bool anc_found; 740 740 int pc; ··· 808 808 809 809 return -EINVAL; 810 810 } 811 - EXPORT_SYMBOL(sk_chk_filter); 811 + EXPORT_SYMBOL(bpf_check_classic); 812 812 813 813 static int sk_store_orig_filter(struct sk_filter *fp, 814 814 const struct sock_fprog *fprog) ··· 968 968 fp->bpf_func = NULL; 969 969 fp->jited = 0; 970 970 971 - err = sk_chk_filter(fp->insns, fp->len); 971 + err = bpf_check_classic(fp->insns, fp->len); 972 972 if (err) { 973 973 __sk_filter_release(fp); 974 974 return ERR_PTR(err);