History

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

trivial rename to indicate that this functions performs classic BPF checking

Alexei Starovoitov committed 12 years ago

Commit 4df95ff1 parent 009937e5 files · +10 −10Browse files

Unified · Split

5 files
  1. Documentation/networking/filter.txt +1 −1
  2. include/linux/filter.h +1 −1
  3. kernel/bpf/core.c +1 −1
  4. kernel/seccomp.c +2 −2
  5. net/core/filter.c +5 −5
Documentation/networking/filter.txt+1−1
@@ -591,7 +591,7 @@ sk_unattached_filter_destroy() for destroying it. The macro · 590 unmodified lines
591591 SK_RUN_FILTER(filter, ctx) transparently invokes eBPF interpreter or JITed
592592 code to run the filter. 'filter' is a pointer to struct sk_filter that we
593593 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
595595 before a conversion to the new layout is being done behind the scenes!
596596
597597 Currently, the classic BPF format is being used for JITing on most of the
include/linux/filter.h+1−1
@@ -361,7 +361,7 @@ void sk_unattached_filter_destroy(struct sk_filter *fp); · 360 unmodified lines
361361 int sk_attach_filter(struct sock_fprog *fprog, struct sock *sk);
362362 int sk_detach_filter(struct sock *sk);
363363
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);
365365 int sk_get_filter(struct sock *sk, struct sock_filter __user *filter,
366366 unsigned int len);
367367
kernel/bpf/core.c+1−1
@@ -18,7 +18,7 @@ · 17 unmodified lines
1818 * 2 of the License, or (at your option) any later version.
1919 *
2020 * 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()
2222 */
2323 #include <linux/filter.h>
2424 #include <linux/skbuff.h>
kernel/seccomp.c+2−2
@@ -87,7 +87,7 @@ static void populate_seccomp_data(struct seccomp_data *sd) · 86 unmodified lines
8787 * @filter: filter to verify
8888 * @flen: length of filter
8989 *
90− * Takes a previously checked filter (by sk_chk_filter) and
90+ * Takes a previously checked filter (by bpf_check_classic) and
9191 * redirects all filter code that loads struct sk_buff data
9292 * and related data through seccomp_bpf_load. It also
9393 * enforces length and alignment checking of those loads.
@@ -239,7 +239,7 @@ static long seccomp_attach_filter(struct sock_fprog *fprog) · 145 unmodified lines
239239 goto free_prog;
240240
241241 /* 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);
243243 if (ret)
244244 goto free_prog;
245245
net/core/filter.c+5−5
@@ -18,7 +18,7 @@ · 17 unmodified lines
1818 * 2 of the License, or (at your option) any later version.
1919 *
2020 * 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()
2222 */
2323
2424 #include <linux/module.h>
@@ -721,7 +721,7 @@ static bool chk_code_allowed(u16 code_to_probe) · 696 unmodified lines
721721 }
722722
723723 /**
724− * sk_chk_filter - verify socket filter code
724+ * bpf_check_classic - verify socket filter code
725725 * @filter: filter to verify
726726 * @flen: length of filter
727727 *
@@ -734,7 +734,7 @@ static bool chk_code_allowed(u16 code_to_probe) · 6 unmodified lines
734734 *
735735 * Returns 0 if the rule set is legal or -EINVAL if not.
736736 */
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)
738738 {
739739 bool anc_found;
740740 int pc;
@@ -808,7 +808,7 @@ int sk_chk_filter(const struct sock_filter *filter, unsigned int flen) · 67 unmodified lines
808808
809809 return -EINVAL;
810810 }
811−EXPORT_SYMBOL(sk_chk_filter);
811+EXPORT_SYMBOL(bpf_check_classic);
812812
813813 static int sk_store_orig_filter(struct sk_filter *fp,
814814 const struct sock_fprog *fprog)
@@ -968,7 +968,7 @@ static struct sk_filter *__sk_prepare_filter(struct sk_filter *fp) · 153 unmodified lines
968968 fp->bpf_func = NULL;
969969 fp->jited = 0;
970970
971− err = sk_chk_filter(fp->insns, fp->len);
971+ err = bpf_check_classic(fp->insns, fp->len);
972972 if (err) {
973973 __sk_filter_release(fp);
974974 return ERR_PTR(err);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t