History

Merge tag 'bpf-next-7.0' of git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next

Pull bpf updates from Alexei Starovoitov: - Support associating BPF program with struct_ops (Amery Hung) - Switch BPF local storage to rqspinlock and remove recursion detection counters which were causing false positives (Amery Hung) - Fix live registers marking for indirect jumps (Anton Protopopov) - Introduce execution context detection BPF helpers (Changwoo Min) - Improve verifier precision for 32bit sign extension pattern (Cupertino Miranda) - Optimize BTF type lookup by sorting vmlinux BTF and doing binary search (Donglin Peng) - Allow states pruning for misc/invalid slots in iterator loops (Eduard Zingerman) - In preparation for ASAN support in BPF arenas teach libbpf to move global BPF variables to the end of the region and enable arena kfuncs while holding locks (Emil Tsalapatis) - Introduce support for implicit arguments in kfuncs and migrate a number of them to new API. This is a prerequisite for cgroup sub-schedulers in sched-ext (Ihor Solodrai) - Fix incorrect copied_seq calculation in sockmap (Jiayuan Chen) - Fix ORC stack unwind from kprobe_multi (Jiri Olsa) - Speed up fentry attach by using single ftrace direct ops in BPF trampolines (Jiri Olsa) - Require frozen map for calculating map hash (KP Singh) - Fix lock entry creation in TAS fallback in rqspinlock (Kumar Kartikeya Dwivedi) - Allow user space to select cpu in lookup/update operations on per-cpu array and hash maps (Leon Hwang) - Make kfuncs return trusted pointers by default (Matt Bobrowski) - Introduce "fsession" support where single BPF program is executed upon entry and exit from traced kernel function (Menglong Dong) - Allow bpf_timer and bpf_wq use in all programs types (Mykyta Yatsenko, Andrii Nakryiko, Kumar Kartikeya Dwivedi, Alexei Starovoitov) - Make KF_TRUSTED_ARGS the default for all kfuncs and clean up their definition across the tree (Puranjay Mohan) - Allow BPF arena calls from non-sleepable context (Puranjay Mohan) - Improve register id comparison logic in the verifier and extend linked registers with negative offsets (Puranjay Mohan) - In preparation for BPF-OOM introduce kfuncs to access memcg events (Roman Gushchin) - Use CFI compatible destructor kfunc type (Sami Tolvanen) - Add bitwise tracking for BPF_END in the verifier (Tianci Cao) - Add range tracking for BPF_DIV and BPF_MOD in the verifier (Yazhou Tang) - Make BPF selftests work with 64k page size (Yonghong Song) * tag 'bpf-next-7.0' of git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next: (268 commits) selftests/bpf: Fix outdated test on storage->smap selftests/bpf: Choose another percpu variable in bpf for btf_dump test selftests/bpf: Remove test_task_storage_map_stress_lookup selftests/bpf: Update task_local_storage/task_storage_nodeadlock test selftests/bpf: Update task_local_storage/recursion test selftests/bpf: Update sk_storage_omem_uncharge test bpf: Switch to bpf_selem_unlink_nofail in bpf_local_storage_{map_free, destroy} bpf: Support lockless unlink when freeing map or local storage bpf: Prepare for bpf_selem_unlink_nofail() bpf: Remove unused percpu counter from bpf_local_storage_map_free bpf: Remove cgroup local storage percpu counter bpf: Remove task local storage percpu counter bpf: Change local_storage->lock and b->lock to rqspinlock bpf: Convert bpf_selem_unlink to failable bpf: Convert bpf_selem_link_map to failable bpf: Convert bpf_selem_unlink_map to failable bpf: Select bpf_local_storage_map_bucket based on bpf_local_storage selftests/xsk: fix number of Tx frags in invalid packet selftests/xsk: properly handle batch ending in the middle of a packet bpf: Prevent reentrance into call_rcu_tasks_trace() ...

Linus Torvalds committed 9 months ago

Commit f17b4742 parents a7423e6 db975de248 files · +13312 −2953Browse files

Showing the changes to include/uapi/linux (1 of 248 files). Show all

Unified · Split

include/uapi/linux/bpf.h+28−0
@@ -119,6 +119,14 @@ enum bpf_cgroup_iter_order { · 118 unmodified lines
119119 BPF_CGROUP_ITER_DESCENDANTS_PRE, /* walk descendants in pre-order. */
120120 BPF_CGROUP_ITER_DESCENDANTS_POST, /* walk descendants in post-order. */
121121 BPF_CGROUP_ITER_ANCESTORS_UP, /* walk ancestors upward. */
122+ /*
123+ * Walks the immediate children of the specified parent
124+ * cgroup_subsys_state. Unlike BPF_CGROUP_ITER_DESCENDANTS_PRE,
125+ * BPF_CGROUP_ITER_DESCENDANTS_POST, and BPF_CGROUP_ITER_ANCESTORS_UP
126+ * the iterator does not include the specified parent as one of the
127+ * returned iterator elements.
128+ */
129+ BPF_CGROUP_ITER_CHILDREN,
122130 };
123131
124132 union bpf_iter_link_info {
@@ -918,6 +926,16 @@ union bpf_iter_link_info { · 793 unmodified lines
918926 * Number of bytes read from the stream on success, or -1 if an
919927 * error occurred (in which case, *errno* is set appropriately).
920928 *
929+ * BPF_PROG_ASSOC_STRUCT_OPS
930+ * Description
931+ * Associate a BPF program with a struct_ops map. The struct_ops
932+ * map is identified by *map_fd* and the BPF program is
933+ * identified by *prog_fd*.
934+ *
935+ * Return
936+ * 0 on success or -1 if an error occurred (in which case,
937+ * *errno* is set appropriately).
938+ *
921939 * NOTES
922940 * eBPF objects (maps and programs) can be shared between processes.
923941 *
@@ -974,6 +992,7 @@ enum bpf_cmd { · 50 unmodified lines
974992 BPF_PROG_BIND_MAP,
975993 BPF_TOKEN_CREATE,
976994 BPF_PROG_STREAM_READ_BY_FD,
995+ BPF_PROG_ASSOC_STRUCT_OPS,
977996 __MAX_BPF_CMD,
978997 };
979998
@@ -1134,6 +1153,7 @@ enum bpf_attach_type { · 154 unmodified lines
11341153 BPF_NETKIT_PEER,
11351154 BPF_TRACE_KPROBE_SESSION,
11361155 BPF_TRACE_UPROBE_SESSION,
1156+ BPF_TRACE_FSESSION,
11371157 __MAX_BPF_ATTACH_TYPE
11381158 };
11391159
@@ -1373,6 +1393,8 @@ enum { · 233 unmodified lines
13731393 BPF_NOEXIST = 1, /* create new element if it didn't exist */
13741394 BPF_EXIST = 2, /* update existing element */
13751395 BPF_F_LOCK = 4, /* spin_lock-ed map_lookup/map_update */
1396+ BPF_F_CPU = 8, /* cpu flag for percpu maps, upper 32-bit of flags is a cpu number */
1397+ BPF_F_ALL_CPUS = 16, /* update value across all CPUs for percpu maps */
13761398 };
13771399
13781400 /* flags for BPF_MAP_CREATE command */
@@ -1894,6 +1916,12 @@ union bpf_attr { · 515 unmodified lines
18941916 __u32 prog_fd;
18951917 } prog_stream_read;
18961918
1919+ struct {
1920+ __u32 map_fd;
1921+ __u32 prog_fd;
1922+ __u32 flags;
1923+ } prog_assoc_struct_ops;
1924+
18971925 } __attribute__((aligned(8)));
18981926
18991927 /* The description below is an attempt at providing documentation to eBPF