diff options
Diffstat (limited to 'kernel/bpf/syscall.c')
-rw-r--r-- | kernel/bpf/syscall.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/kernel/bpf/syscall.c b/kernel/bpf/syscall.c index d124e702e040..54fba06942f5 100644 --- a/kernel/bpf/syscall.c +++ b/kernel/bpf/syscall.c | |||
@@ -592,6 +592,12 @@ static int map_update_elem(union bpf_attr *attr) | |||
592 | if (copy_from_user(value, uvalue, value_size) != 0) | 592 | if (copy_from_user(value, uvalue, value_size) != 0) |
593 | goto free_value; | 593 | goto free_value; |
594 | 594 | ||
595 | /* Need to create a kthread, thus must support schedule */ | ||
596 | if (map->map_type == BPF_MAP_TYPE_CPUMAP) { | ||
597 | err = map->ops->map_update_elem(map, key, value, attr->flags); | ||
598 | goto out; | ||
599 | } | ||
600 | |||
595 | /* must increment bpf_prog_active to avoid kprobe+bpf triggering from | 601 | /* must increment bpf_prog_active to avoid kprobe+bpf triggering from |
596 | * inside bpf map update or delete otherwise deadlocks are possible | 602 | * inside bpf map update or delete otherwise deadlocks are possible |
597 | */ | 603 | */ |
@@ -622,7 +628,7 @@ static int map_update_elem(union bpf_attr *attr) | |||
622 | } | 628 | } |
623 | __this_cpu_dec(bpf_prog_active); | 629 | __this_cpu_dec(bpf_prog_active); |
624 | preempt_enable(); | 630 | preempt_enable(); |
625 | 631 | out: | |
626 | if (!err) | 632 | if (!err) |
627 | trace_bpf_map_update_elem(map, ufd, key, value); | 633 | trace_bpf_map_update_elem(map, ufd, key, value); |
628 | free_value: | 634 | free_value: |