diff options
| author | Kaitao Cheng <chengkaitao@kylinos.cn> | 2026-02-14 20:40:38 +0800 |
|---|---|---|
| committer | Alexei Starovoitov <ast@kernel.org> | 2026-02-23 17:37:06 -0800 |
| commit | 964c0747686abda124cf718a91ac1c0c325ca52a (patch) | |
| tree | 73e26ccaeab47ee588ffc8123cc1004b04cbdec4 /tools/perf/scripts/python/bin/stackcollapse-record | |
| parent | 3ecf0b4a0e0ed4783aa32c5f3e42d23c7021e1c8 (diff) | |
bpf: allow calling bpf_kptr_xchg while holding a lock
For the following scenario:
struct tree_node {
struct bpf_rb_node node;
struct request __kptr *req;
u64 key;
};
struct bpf_rb_root tree_root __contains(tree_node, node);
struct bpf_spin_lock tree_lock;
If we need to traverse all nodes in the rbtree, retrieve the __kptr
pointer from each node, and read kernel data from the referenced
object, using bpf_kptr_xchg appears unavoidable.
This patch skips the BPF verifier checks for bpf_kptr_xchg when
called while holding a lock.
Signed-off-by: Kaitao Cheng <chengkaitao@kylinos.cn>
Link: https://lore.kernel.org/r/20260214124042.62229-2-pilgrimtao@gmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python/bin/stackcollapse-record')
0 files changed, 0 insertions, 0 deletions
