Centos-kernel-stream-9/kernel/bpf
Artem Savkov 65a903edb8 bpf: Disallow BPF_LOG_KERNEL log level for bpf(BPF_BTF_LOAD)
Bugzilla: https://bugzilla.redhat.com/2069046

Upstream Status: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git

commit 866de407444398bc8140ea70de1dba5f91cc34ac
Author: Hou Tao <houtao1@huawei.com>
Date:   Fri Dec 3 13:30:01 2021 +0800

    bpf: Disallow BPF_LOG_KERNEL log level for bpf(BPF_BTF_LOAD)

    BPF_LOG_KERNEL is only used internally, so disallow bpf_btf_load()
    to set log level as BPF_LOG_KERNEL. The same checking has already
    been done in bpf_check(), so factor out a helper to check the
    validity of log attributes and use it in both places.

    Fixes: 8580ac9404 ("bpf: Process in-kernel BTF")
    Signed-off-by: Hou Tao <houtao1@huawei.com>
    Signed-off-by: Alexei Starovoitov <ast@kernel.org>
    Acked-by: Yonghong Song <yhs@fb.com>
    Acked-by: Martin KaFai Lau <kafai@fb.com>
    Link: https://lore.kernel.org/bpf/20211203053001.740945-1-houtao1@huawei.com

Signed-off-by: Artem Savkov <asavkov@redhat.com>
2022-08-24 12:53:44 +02:00
..
preload bpf/preload: Clean up .gitignore and "clean-files" target 2022-06-03 17:23:42 +03:00
Kconfig bpf: Disallow unprivileged bpf by default 2022-06-03 17:23:49 +03:00
Makefile bpf: Prepare relo_core.c for kernel duty. 2022-08-24 12:53:42 +02:00
arraymap.c bpf: Replace callers of BPF_CAST_CALL with proper function typedef 2022-06-03 17:23:36 +03:00
bloom_filter.c bpf: Add missing map_get_next_key method to bloom filter map. 2022-06-03 17:23:52 +03:00
bpf_inode_storage.c bpf: Fix spelling mistakes 2021-05-24 21:13:05 -07:00
bpf_iter.c bpf: Add bpf_loop helper 2022-08-24 12:53:41 +02:00
bpf_local_storage.c bpf: Prevent deadlock from recursive bpf_task_storage_[get|delete] 2021-02-26 11:51:48 -08:00
bpf_lru_list.c bpf_lru_list: Read double-checked variable once without lock 2021-02-10 15:54:26 -08:00
bpf_lru_list.h
bpf_lsm.c bpf: Fix renaming task_getsecid_subj->current_getsecid_subj. 2022-05-10 16:23:33 +02:00
bpf_struct_ops.c bpf: Rename btf_member accessors. 2022-08-24 12:53:42 +02:00
bpf_struct_ops_types.h bpf: Add dummy BPF STRUCT_OPS for test purpose 2022-06-03 17:23:49 +03:00
bpf_task_storage.c bpf: Introduce btf_tracing_ids 2022-08-24 12:53:37 +02:00
btf.c bpf: Disallow BPF_LOG_KERNEL log level for bpf(BPF_BTF_LOAD) 2022-08-24 12:53:44 +02:00
cgroup.c cgroup: bpf: Move wrapper for __cgroup_bpf_*() to kernel/bpf/cgroup.c 2022-06-03 17:23:49 +03:00
core.c bpf, docs: Prune all references to "internal BPF" 2022-08-24 12:53:41 +02:00
cpumap.c bpf: Let bpf_warn_invalid_xdp_action() report more info 2022-06-28 16:13:14 +02:00
devmap.c bpf: Let bpf_warn_invalid_xdp_action() report more info 2022-06-28 16:13:14 +02:00
disasm.c bpf: Relicense disassembler as GPL-2.0-only OR BSD-2-Clause 2022-04-29 18:17:12 +02:00
disasm.h bpf: Relicense disassembler as GPL-2.0-only OR BSD-2-Clause 2022-04-29 18:17:12 +02:00
dispatcher.c
hashtab.c bpf: Replace callers of BPF_CAST_CALL with proper function typedef 2022-06-03 17:23:36 +03:00
helpers.c bpf: Add bpf_loop helper 2022-08-24 12:53:41 +02:00
inode.c bpf: Fix regression on BPF_OBJ_GET with non-O_RDWR flags 2021-06-22 14:57:43 +02:00
local_storage.c bpf: Increase supported cgroup storage value size 2022-04-29 18:14:36 +02:00
lpm_trie.c bpf: Allow RCU-protected lookups to happen from bh context 2021-06-24 19:41:15 +02:00
map_in_map.c bpf: Remember BTF of inner maps. 2022-04-29 18:14:31 +02:00
map_in_map.h
map_iter.c
mmap_unlock_work.h bpf: Introduce helper bpf_find_vma 2022-08-24 12:53:34 +02:00
net_namespace.c
offload.c
percpu_freelist.c bpf: Use raw_spin_trylock() for pcpu_freelist_push/pop in NMI 2020-10-06 00:04:11 +02:00
percpu_freelist.h bpf: Use raw_spin_trylock() for pcpu_freelist_push/pop in NMI 2020-10-06 00:04:11 +02:00
prog_iter.c
queue_stack_maps.c bpf: Eliminate rlimit-based memory accounting for queue_stack_maps maps 2020-12-02 18:32:46 -08:00
reuseport_array.c bpf: Fix spelling mistakes 2021-05-24 21:13:05 -07:00
ringbuf.c bpf: Fix false positive kmemleak report in bpf_ringbuf_area_alloc() 2021-06-28 15:57:46 +02:00
stackmap.c bpf: Introduce btf_tracing_ids 2022-08-24 12:53:37 +02:00
syscall.c bpf: Pass a set of bpf_core_relo-s to prog_load command. 2022-08-24 12:53:42 +02:00
sysfs_btf.c bpf: Load and verify kernel module BTFs 2020-11-10 15:25:53 -08:00
task_iter.c bpf: Introduce btf_tracing_ids 2022-08-24 12:53:37 +02:00
tnum.c bpf, tnums: Provably sound, faster, and more precise algorithm for tnum_mul 2021-06-01 13:34:15 +02:00
trampoline.c bpf: Fix possible race in inc_misses_counter 2022-06-03 17:23:55 +03:00
verifier.c bpf: Disallow BPF_LOG_KERNEL log level for bpf(BPF_BTF_LOAD) 2022-08-24 12:53:44 +02:00