aboutsummaryrefslogtreecommitdiffstats
path: root/tools/include
diff options
context:
space:
mode:
authorDaniel Borkmann <daniel@iogearbox.net>2018-12-15 18:49:47 -0500
committerAlexei Starovoitov <ast@kernel.org>2018-12-17 16:41:35 -0500
commit6c4fc209fcf9d27efbaa48368773e4d2bfbd59aa (patch)
tree0dcc71262486e4d9b020d663f4813c3b2078f90a /tools/include
parent034565da0fe6cc60c4df26805c8c78d8f365173b (diff)
bpf: remove useless version check for prog load
Existing libraries and tracing frameworks work around this kernel version check by automatically deriving the kernel version from uname(3) or similar such that the user does not need to do it manually; these workarounds also make the version check useless at the same time. Moreover, most other BPF tracing types enabling bpf_probe_read()-like functionality have /not/ adapted this check, and in general these days it is well understood anyway that all the tracing programs are not stable with regards to future kernels as kernel internal data structures are subject to change from release to release. Back at last netconf we discussed [0] and agreed to remove this check from bpf_prog_load() and instead document it here in the uapi header that there is no such guarantee for stable API for these programs. [0] http://vger.kernel.org/netconf2018_files/DanielBorkmann_netconf2018.pdf Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Acked-by: Alexei Starovoitov <ast@kernel.org> Acked-by: Quentin Monnet <quentin.monnet@netronome.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'tools/include')
-rw-r--r--tools/include/uapi/linux/bpf.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/tools/include/uapi/linux/bpf.h b/tools/include/uapi/linux/bpf.h
index e7d57e89f25f..1d324c2cbca2 100644
--- a/tools/include/uapi/linux/bpf.h
+++ b/tools/include/uapi/linux/bpf.h
@@ -133,6 +133,14 @@ enum bpf_map_type {
133 BPF_MAP_TYPE_STACK, 133 BPF_MAP_TYPE_STACK,
134}; 134};
135 135
136/* Note that tracing related programs such as
137 * BPF_PROG_TYPE_{KPROBE,TRACEPOINT,PERF_EVENT,RAW_TRACEPOINT}
138 * are not subject to a stable API since kernel internal data
139 * structures can change from release to release and may
140 * therefore break existing tracing BPF programs. Tracing BPF
141 * programs correspond to /a/ specific kernel which is to be
142 * analyzed, and not /a/ specific kernel /and/ all future ones.
143 */
136enum bpf_prog_type { 144enum bpf_prog_type {
137 BPF_PROG_TYPE_UNSPEC, 145 BPF_PROG_TYPE_UNSPEC,
138 BPF_PROG_TYPE_SOCKET_FILTER, 146 BPF_PROG_TYPE_SOCKET_FILTER,
@@ -343,7 +351,7 @@ union bpf_attr {
343 __u32 log_level; /* verbosity level of verifier */ 351 __u32 log_level; /* verbosity level of verifier */
344 __u32 log_size; /* size of user buffer */ 352 __u32 log_size; /* size of user buffer */
345 __aligned_u64 log_buf; /* user supplied buffer */ 353 __aligned_u64 log_buf; /* user supplied buffer */
346 __u32 kern_version; /* checked when prog_type=kprobe */ 354 __u32 kern_version; /* not used */
347 __u32 prog_flags; 355 __u32 prog_flags;
348 char prog_name[BPF_OBJ_NAME_LEN]; 356 char prog_name[BPF_OBJ_NAME_LEN];
349 __u32 prog_ifindex; /* ifindex of netdev to prep for */ 357 __u32 prog_ifindex; /* ifindex of netdev to prep for */