mirror of
https://github.com/torvalds/linux.git
synced 2024-11-26 06:02:05 +00:00
bpf: Add __rcu_read_{lock,unlock} into btf id deny list
The tracing recursion prevention mechanism must be protected by rcu, that leaves __rcu_read_{lock,unlock} unprotected by this mechanism. If we trace them, the recursion will happen. Let's add them into the btf id deny list. When CONFIG_PREEMPT_RCU is enabled, it can be reproduced with a simple bpf program as such: SEC("fentry/__rcu_read_lock") int fentry_run() { return 0; } Signed-off-by: Yafang Shao <laoar.shao@gmail.com> Link: https://lore.kernel.org/r/20230424161104.3737-2-laoar.shao@gmail.com Signed-off-by: Alexei Starovoitov <ast@kernel.org>
This commit is contained in:
parent
7deca5eae8
commit
a0c109dcaf
@ -18671,6 +18671,10 @@ BTF_ID(func, rcu_read_unlock_strict)
|
||||
BTF_ID(func, preempt_count_add)
|
||||
BTF_ID(func, preempt_count_sub)
|
||||
#endif
|
||||
#ifdef CONFIG_PREEMPT_RCU
|
||||
BTF_ID(func, __rcu_read_lock)
|
||||
BTF_ID(func, __rcu_read_unlock)
|
||||
#endif
|
||||
BTF_SET_END(btf_id_deny)
|
||||
|
||||
static bool can_be_sleepable(struct bpf_prog *prog)
|
||||
|
Loading…
Reference in New Issue
Block a user