diff options
Diffstat (limited to 'kernel/bpf')
-rw-r--r-- | kernel/bpf/Makefile | 6 | ||||
-rw-r--r-- | kernel/bpf/core.c | 9 | ||||
-rw-r--r-- | kernel/bpf/verifier.c | 3 |
3 files changed, 14 insertions, 4 deletions
diff --git a/kernel/bpf/Makefile b/kernel/bpf/Makefile index 45427239f375..0daf7f6ae7df 100644 --- a/kernel/bpf/Makefile +++ b/kernel/bpf/Makefile | |||
@@ -1,5 +1,5 @@ | |||
1 | obj-y := core.o syscall.o verifier.o | 1 | obj-y := core.o |
2 | 2 | obj-$(CONFIG_BPF_SYSCALL) += syscall.o verifier.o | |
3 | ifdef CONFIG_TEST_BPF | 3 | ifdef CONFIG_TEST_BPF |
4 | obj-y += test_stub.o | 4 | obj-$(CONFIG_BPF_SYSCALL) += test_stub.o |
5 | endif | 5 | endif |
diff --git a/kernel/bpf/core.c b/kernel/bpf/core.c index f0c30c59b317..d6594e457a25 100644 --- a/kernel/bpf/core.c +++ b/kernel/bpf/core.c | |||
@@ -655,3 +655,12 @@ void bpf_prog_free(struct bpf_prog *fp) | |||
655 | schedule_work(&aux->work); | 655 | schedule_work(&aux->work); |
656 | } | 656 | } |
657 | EXPORT_SYMBOL_GPL(bpf_prog_free); | 657 | EXPORT_SYMBOL_GPL(bpf_prog_free); |
658 | |||
659 | /* To execute LD_ABS/LD_IND instructions __bpf_prog_run() may call | ||
660 | * skb_copy_bits(), so provide a weak definition of it for NET-less config. | ||
661 | */ | ||
662 | int __weak skb_copy_bits(const struct sk_buff *skb, int offset, void *to, | ||
663 | int len) | ||
664 | { | ||
665 | return -EFAULT; | ||
666 | } | ||
diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c index 801f5f3b9307..9f81818f2941 100644 --- a/kernel/bpf/verifier.c +++ b/kernel/bpf/verifier.c | |||
@@ -1409,7 +1409,8 @@ static bool states_equal(struct verifier_state *old, struct verifier_state *cur) | |||
1409 | if (memcmp(&old->regs[i], &cur->regs[i], | 1409 | if (memcmp(&old->regs[i], &cur->regs[i], |
1410 | sizeof(old->regs[0])) != 0) { | 1410 | sizeof(old->regs[0])) != 0) { |
1411 | if (old->regs[i].type == NOT_INIT || | 1411 | if (old->regs[i].type == NOT_INIT || |
1412 | old->regs[i].type == UNKNOWN_VALUE) | 1412 | (old->regs[i].type == UNKNOWN_VALUE && |
1413 | cur->regs[i].type != NOT_INIT)) | ||
1413 | continue; | 1414 | continue; |
1414 | return false; | 1415 | return false; |
1415 | } | 1416 | } |