linux-stable/kernel/bpf
Daniel Borkmann e69f08ba23 bpf: Add kconfig knob for disabling unpriv bpf by default
commit 08389d8882 upstream.

Add a kconfig knob which allows for unprivileged bpf to be disabled by default.
If set, the knob sets /proc/sys/kernel/unprivileged_bpf_disabled to value of 2.

This still allows a transition of 2 -> {0,1} through an admin. Similarly,
this also still keeps 1 -> {1} behavior intact, so that once set to permanently
disabled, it cannot be undone aside from a reboot.

We've also added extra2 with max of 2 for the procfs handler, so that an admin
still has a chance to toggle between 0 <-> 2.

Either way, as an additional alternative, applications can make use of CAP_BPF
that we added a while ago.

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/74ec548079189e4e4dffaeb42b8987bb3c852eee.1620765074.git.daniel@iogearbox.net
[fllinden@amazon.com: backported to 4.14]
Signed-off-by: Frank van der Linden <fllinden@amazon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-02-16 12:44:50 +01:00
..
Makefile bpf: silence warning messages in core 2019-07-31 07:28:25 +02:00
arraymap.c bpf: sockmap, map_release does not hold refcnt for pinned maps 2018-11-04 14:52:44 +01:00
bpf_lru_list.c bpf_lru_list: Read double-checked variable once without lock 2021-03-03 18:22:39 +01:00
bpf_lru_list.h bpf: Only set node->ref = 1 if it has not been set 2017-09-01 09:57:39 -07:00
cgroup.c bpf: BPF support for sock_ops 2017-07-01 16:15:13 -07:00
core.c bpf: fix truncated jump targets on heavy expansions 2022-02-08 18:16:27 +01:00
devmap.c bpf: devmap: fix wrong interface selection in notifier_call 2019-12-01 09:13:47 +01:00
hashtab.c bpf: Remove recursion prevention from rcu free callback 2020-10-01 13:12:35 +02:00
helpers.c bpf: rename ARG_PTR_TO_STACK 2017-01-09 16:56:27 -05:00
inode.c bpf: fix use after free in bpf_evict_inode 2019-04-20 09:15:07 +02:00
lpm_trie.c bpf: fix rcu lockdep warning for lpm_trie map_free callback 2018-03-11 16:23:21 +01:00
map_in_map.c bpf: fix inner map masking to prevent oob under speculation 2019-04-20 09:15:09 +02:00
map_in_map.h bpf: Add syscall lookup support for fd array and htab 2017-06-29 13:13:25 -04:00
percpu_freelist.c bpf: fix lockdep false positive in percpu_freelist 2019-03-13 14:03:20 -07:00
percpu_freelist.h bpf: fix lockdep false positive in percpu_freelist 2019-03-13 14:03:20 -07:00
sockmap.c bpf: sockmap, map_release does not hold refcnt for pinned maps 2018-11-04 14:52:44 +01:00
stackmap.c bpf: Fix integer overflow in prealloc_elems_and_freelist() 2021-10-17 10:08:32 +02:00
syscall.c bpf: Add kconfig knob for disabling unpriv bpf by default 2022-02-16 12:44:50 +01:00
tnum.c bpf/verifier: track signed and unsigned min/max values 2017-08-08 17:51:34 -07:00
verifier.c bpf: Fix the off-by-two error in range markings 2021-12-14 10:16:53 +01:00