diff options
author | Peter Zijlstra <peterz@infradead.org> | 2019-04-23 21:55:59 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-05-25 18:23:44 +0200 |
commit | c1528193f643c82abaa58b12e48d536a27783242 (patch) | |
tree | 4527530a66d8bb7c80e0be3dcff13f46e8cb136e /include/linux | |
parent | aea54f613534fd1facf6db75b68151c9b78866fb (diff) | |
download | linux-stable-c1528193f643c82abaa58b12e48d536a27783242.tar.gz linux-stable-c1528193f643c82abaa58b12e48d536a27783242.tar.bz2 linux-stable-c1528193f643c82abaa58b12e48d536a27783242.zip |
bpf: Fix preempt_enable_no_resched() abuse
[ Upstream commit 0edd6b64d1939e9e9168ff27947995bb7751db5d ]
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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'include/linux')
-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 523481a3471b..fd95f2efe5f3 100644 --- a/include/linux/bpf.h +++ b/include/linux/bpf.h @@ -400,7 +400,7 @@ int bpf_prog_array_copy(struct bpf_prog_array __rcu *old_array, } \ _out: \ rcu_read_unlock(); \ - preempt_enable_no_resched(); \ + preempt_enable(); \ _ret; \ }) |