aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/bpf/syscall.c
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 /kernel/bpf/syscall.c
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 'kernel/bpf/syscall.c')
-rw-r--r--kernel/bpf/syscall.c5
1 files changed, 0 insertions, 5 deletions
diff --git a/kernel/bpf/syscall.c b/kernel/bpf/syscall.c
index 6ae062f1cf20..5db31067d85e 100644
--- a/kernel/bpf/syscall.c
+++ b/kernel/bpf/syscall.c
@@ -1473,11 +1473,6 @@ static int bpf_prog_load(union bpf_attr *attr, union bpf_attr __user *uattr)
1473 1473
1474 if (attr->insn_cnt == 0 || attr->insn_cnt > BPF_MAXINSNS) 1474 if (attr->insn_cnt == 0 || attr->insn_cnt > BPF_MAXINSNS)
1475 return -E2BIG; 1475 return -E2BIG;
1476
1477 if (type == BPF_PROG_TYPE_KPROBE &&
1478 attr->kern_version != LINUX_VERSION_CODE)
1479 return -EINVAL;
1480
1481 if (type != BPF_PROG_TYPE_SOCKET_FILTER && 1476 if (type != BPF_PROG_TYPE_SOCKET_FILTER &&
1482 type != BPF_PROG_TYPE_CGROUP_SKB && 1477 type != BPF_PROG_TYPE_CGROUP_SKB &&
1483 !capable(CAP_SYS_ADMIN)) 1478 !capable(CAP_SYS_ADMIN))