mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/
synced 2026-11-10 20:48:12 +00:00
bpf: Move unprivileged checks into map_create() and bpf_prog_load()
[ Upstream commit1d28635abc] Make each bpf() syscall command a bit more self-contained, making it easier to further enhance it. We move sysctl_unprivileged_bpf_disabled handling down to map_create() and bpf_prog_load(), two special commands in this regard. Also swap the order of checks, calling bpf_capable() only if sysctl_unprivileged_bpf_disabled is true, avoiding unnecessary audit messages. Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Acked-by: Stanislav Fomichev <sdf@google.com> Link: https://lore.kernel.org/bpf/20230613223533.3689589-2-andrii@kernel.org Stable-dep-of:640a604585("bpf, cpumap: Make sure kthread is running before map update returns") Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
0acc483f9b
commit
3cf214f275
1 changed files with 19 additions and 15 deletions
Loading…
Add table
Add a link
Reference in a new issue