Commit 78e30b5
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]>1 parent ef80573 commit 78e30b5
1 file changed
+2
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12056 | 12056 | | |
12057 | 12057 | | |
12058 | 12058 | | |
12059 | | - | |
| 12059 | + | |
12060 | 12060 | | |
12061 | 12061 | | |
12062 | 12062 | | |
| |||
12105 | 12105 | | |
12106 | 12106 | | |
12107 | 12107 | | |
| 12108 | + | |
12108 | 12109 | | |
12109 | 12110 | | |
12110 | 12111 | | |
| |||
0 commit comments