diff options
author | Philo Lu <[email protected]> | 2024-09-11 11:37:18 +0800 |
---|---|---|
committer | Martin KaFai Lau <[email protected]> | 2024-09-11 08:56:42 -0700 |
commit | ffc83860d8c09705d8e83474b8c6ec4d1d3dca41 (patch) | |
tree | a06bcdff926d039aa03a50403f216b62ceb23b46 /tools/perf/scripts/python/stackcollapse.py | |
parent | edd3f6f7588c713477e1299c38c84dcd91a7f148 (diff) |
bpf: Allow bpf_dynptr_from_skb() for tp_btf
Making tp_btf able to use bpf_dynptr_from_skb(), which is useful for skb
parsing, especially for non-linear paged skb data. This is achieved by
adding KF_TRUSTED_ARGS flag to bpf_dynptr_from_skb and registering it
for TRACING progs. With KF_TRUSTED_ARGS, args from fentry/fexit are
excluded, so that unsafe progs like fexit/__kfree_skb are not allowed.
We also need the skb dynptr to be read-only in tp_btf. Because
may_access_direct_pkt_data() returns false by default when checking
bpf_dynptr_from_skb, there is no need to add BPF_PROG_TYPE_TRACING to it
explicitly.
Suggested-by: Martin KaFai Lau <[email protected]>
Signed-off-by: Philo Lu <[email protected]>
Acked-by: Martin KaFai Lau <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Martin KaFai Lau <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/stackcollapse.py')
0 files changed, 0 insertions, 0 deletions