android_kernel_motorola_sm6375/kernel/bpf
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Daniel Borkmann 508711cf30 UPSTREAM: bpf: Add kconfig knob for disabling unpriv bpf by default
commit 08389d888287c3823f80b0216766b71e17f0aba5 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.

Bug: 215557547
Signed-off-by: Daniel Borkmann <[email protected]>
Signed-off-by: Alexei Starovoitov <[email protected]>
Link: https://lore.kernel.org/bpf/74ec548079189e4e4dffaeb42b8987bb3c852eee.1620765074.git.daniel@iogearbox.net
[[email protected]: backported to 5.4]
Signed-off-by: Frank van der Linden <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
(cherry picked from commit c230f6ba10)
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Change-Id: I6d80853f0bd2c8618d956d967681c97b931a6137
2022-03-14 12:47:00 +01:00
..
arraymap.c
bpf_lru_list.c bpf_lru_list: Read double-checked variable once without lock 2021-03-04 10:26:16 +01:00
bpf_lru_list.h
btf.c
cgroup.c bpf, cgroup: Fix problematic bounds check 2021-02-10 09:25:27 +01:00
core.c This is the 5.4.160 stable release 2021-11-17 10:19:21 +01:00
cpumap.c
devmap.c UPSTREAM: bpf: Fix integer overflow in argument calculation for bpf_map_area_alloc 2022-01-25 13:40:43 +00:00
disasm.c bpf: Introduce BPF nospec instruction for mitigating Spectre v4 2021-09-15 09:47:38 +02:00
disasm.h
hashtab.c bpf: Zero-fill re-used per-cpu map element 2020-11-18 19:20:26 +01:00
helpers.c Merge branch 'android11-5.4' into 'android11-5.4-lts' 2021-02-13 14:04:08 +01:00
inode.c
local_storage.c
lpm_trie.c
Makefile bpf: Don't rely on GCC __attribute__((optimize)) to disable GCSE 2020-11-18 19:20:26 +01:00
map_in_map.c
map_in_map.h
offload.c
percpu_freelist.c
percpu_freelist.h
queue_stack_maps.c
reuseport_array.c
stackmap.c bpf: Fix integer overflow in prealloc_elems_and_freelist() 2021-10-13 10:08:18 +02:00
syscall.c UPSTREAM: bpf: Add kconfig knob for disabling unpriv bpf by default 2022-03-14 12:47:00 +01:00
sysfs_btf.c
tnum.c
verifier.c bpf: Add oversize check before call kvcalloc() 2021-09-30 10:09:25 +02:00
xskmap.c