diff options
author | Peter Zijlstra <peterz@infradead.org> | 2019-04-23 21:55:59 +0200 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2019-04-25 17:20:06 -0700 |
commit | 0edd6b64d1939e9e9168ff27947995bb7751db5d (patch) | |
tree | bda2ebb26824837370940415fa1857bb29d28d06 /include/linux/bpf.h | |
parent | 6dd7f14080473b655c247863e61b7c34424f0c83 (diff) | |
download | linux-0edd6b64d1939e9e9168ff27947995bb7751db5d.tar.gz linux-0edd6b64d1939e9e9168ff27947995bb7751db5d.tar.bz2 linux-0edd6b64d1939e9e9168ff27947995bb7751db5d.zip |
bpf: Fix preempt_enable_no_resched() abuse
Unless the very next line is schedule(), or implies it, one must not use
preempt_enable_no_resched(). It can cause a preemption to go missing and
thereby cause arbitrary delays, breaking the PREEMPT=y invariant.
Cc: Roman Gushchin <guro@fb.com>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'include/linux/bpf.h')
-rw-r--r-- | include/linux/bpf.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/bpf.h b/include/linux/bpf.h index f02367faa58d..944ccc310201 100644 --- a/include/linux/bpf.h +++ b/include/linux/bpf.h @@ -510,7 +510,7 @@ int bpf_prog_array_copy(struct bpf_prog_array __rcu *old_array, } \ _out: \ rcu_read_unlock(); \ - preempt_enable_no_resched(); \ + preempt_enable(); \ _ret; \ }) |