From: Peter Zijlstra Date: Tue, 23 Apr 2019 19:55:59 +0000 (+0200) Subject: bpf: Fix preempt_enable_no_resched() abuse X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=0edd6b64d1939e9e9168ff27947995bb7751db5d;p=linux.git 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 Cc: Alexei Starovoitov Cc: Daniel Borkmann Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Alexei Starovoitov --- diff --git a/include/linux/bpf.h b/include/linux/bpf.h index f02367faa58db..944ccc310201d 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; \ })