acrn-kernel/kernel/bpf
Florian Westphal 132328e8e8 bpf: netfilter: Add BPF_NETFILTER bpf_attach_type
Andrii Nakryiko writes:

 And we currently don't have an attach type for NETLINK BPF link.
 Thankfully it's not too late to add it. I see that link_create() in
 kernel/bpf/syscall.c just bypasses attach_type check. We shouldn't
 have done that. Instead we need to add BPF_NETLINK attach type to enum
 bpf_attach_type. And wire all that properly throughout the kernel and
 libbpf itself.

This adds BPF_NETFILTER and uses it.  This breaks uabi but this
wasn't in any non-rc release yet, so it should be fine.

v2: check link_attack prog type in link_create too

Fixes: 84601d6ee6 ("bpf: add bpf_link support for BPF_NETFILTER programs")
Suggested-by: Andrii Nakryiko <andrii.nakryiko@gmail.com>
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/CAEf4BzZ69YgrQW7DHCJUT_X+GqMq_ZQQPBwopaJJVGFD5=d5Vg@mail.gmail.com/
Link: https://lore.kernel.org/bpf/20230605131445.32016-1-fw@strlen.de
2023-06-05 15:01:43 -07:00
..
preload
Kconfig
Makefile
arraymap.c
bloom_filter.c
bpf_cgrp_storage.c
bpf_inode_storage.c Networking changes for 6.4. 2023-04-26 16:07:23 -07:00
bpf_iter.c
bpf_local_storage.c
bpf_lru_list.c
bpf_lru_list.h
bpf_lsm.c
bpf_struct_ops.c
bpf_struct_ops_types.h
bpf_task_storage.c
btf.c bpf: minimal support for programs hooked into netfilter framework 2023-04-21 11:34:14 -07:00
cgroup.c cgroup changes for v6.4-rc1 2023-04-29 10:05:22 -07:00
cgroup_iter.c
core.c
cpumap.c
cpumask.c
devmap.c
disasm.c
disasm.h
dispatcher.c
hashtab.c bpf: fix a memory leak in the LRU and LRU_PERCPU hash maps 2023-05-22 10:26:39 -07:00
helpers.c bpf: Fix bpf_refcount_acquire's refcount_t address calculation 2023-04-21 16:31:37 +02:00
inode.c
link_iter.c
local_storage.c cgroup changes for v6.4-rc1 2023-04-29 10:05:22 -07:00
log.c
lpm_trie.c
map_in_map.c bpf: Fix elem_size not being set for inner maps 2023-06-02 16:22:12 -07:00
map_in_map.h
map_iter.c
memalloc.c
mmap_unlock_work.h
net_namespace.c
offload.c bpf: netdev: init the offload table earlier 2023-05-15 07:07:41 -07:00
percpu_freelist.c
percpu_freelist.h
prog_iter.c
queue_stack_maps.c
reuseport_array.c
ringbuf.c
stackmap.c
syscall.c bpf: netfilter: Add BPF_NETFILTER bpf_attach_type 2023-06-05 15:01:43 -07:00
sysfs_btf.c
task_iter.c
tnum.c
trampoline.c Networking changes for 6.4. 2023-04-26 16:07:23 -07:00
verifier.c bpf: Fix mask generation for 32-bit narrow loads of 64-bit fields 2023-05-19 09:58:37 -07:00