History

bpf: add writable context for raw tracepoints

This is an opt-in interface that allows a tracepoint to provide a safe buffer that can be written from a BPF_PROG_TYPE_RAW_TRACEPOINT program. The size of the buffer must be a compile-time constant, and is checked before allowing a BPF program to attach to a tracepoint that uses this feature. The pointer to this buffer will be the first argument of tracepoints that opt in; the pointer is valid and can be bpf_probe_read() by both BPF_PROG_TYPE_RAW_TRACEPOINT and BPF_PROG_TYPE_RAW_TRACEPOINT_WRITABLE programs that attach to such a tracepoint, but the buffer to which it points may only be written by the latter.

Matt Mullins committed 7 years ago

Commit 9df1c281 parent 34b8ab08 files · +91 −4Browse files

Showing the changes to include/uapi/linux (1 of 8 files). Show all

Unified · Split

include/uapi/linux/bpf.h+1−0
@@ -168,6 +168,7 @@ enum bpf_prog_type { · 167 unmodified lines
168 BPF_PROG_TYPE_SK_REUSEPORT,168 BPF_PROG_TYPE_SK_REUSEPORT,
169 BPF_PROG_TYPE_FLOW_DISSECTOR,169 BPF_PROG_TYPE_FLOW_DISSECTOR,
170 BPF_PROG_TYPE_CGROUP_SYSCTL,170 BPF_PROG_TYPE_CGROUP_SYSCTL,
171 BPF_PROG_TYPE_RAW_TRACEPOINT_WRITABLE,
171};172};
172 173
173enum bpf_attach_type {174enum bpf_attach_type {