History

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

Daniel Borkmann says: ==================== pull-request: bpf-next 2023-03-06 We've added 85 non-merge commits during the last 13 day(s) which contain a total of 131 files changed, 7102 insertions(+), 1792 deletions(-). The main changes are: 1) Add skb and XDP typed dynptrs which allow BPF programs for more ergonomic and less brittle iteration through data and variable-sized accesses, from Joanne Koong. 2) Bigger batch of BPF verifier improvements to prepare for upcoming BPF open-coded iterators allowing for less restrictive looping capabilities, from Andrii Nakryiko. 3) Rework RCU enforcement in the verifier, add kptr_rcu and enforce BPF programs to NULL-check before passing such pointers into kfunc, from Alexei Starovoitov. 4) Add support for kptrs in percpu hashmaps, percpu LRU hashmaps and in local storage maps, from Kumar Kartikeya Dwivedi. 5) Add BPF verifier support for ST instructions in convert_ctx_access() which will help new -mcpu=v4 clang flag to start emitting them, from Eduard Zingerman. 6) Make uprobe attachment Android APK aware by supporting attachment to functions inside ELF objects contained in APKs via function names, from Daniel Müller. 7) Add a new flag BPF_F_TIMER_ABS flag for bpf_timer_start() helper to start the timer with absolute expiration value instead of relative one, from Tero Kristo. 8) Add a new kfunc bpf_cgroup_from_id() to look up cgroups via id, from Tejun Heo. 9) Extend libbpf to support users manually attaching kprobes/uprobes in the legacy/perf/link mode, from Menglong Dong. 10) Implement workarounds in the mips BPF JIT for DADDI/R4000, from Jiaxun Yang. 11) Enable mixing bpf2bpf and tailcalls for the loongarch BPF JIT, from Hengqi Chen. 12) Extend BPF instruction set doc with describing the encoding of BPF instructions in terms of how bytes are stored under big/little endian, from Jose E. Marchesi. 13) Follow-up to enable kfunc support for riscv BPF JIT, from Pu Lehui. 14) Fix bpf_xdp_query() backwards compatibility on old kernels, from Yonghong Song. 15) Fix BPF selftest cross compilation with CLANG_CROSS_FLAGS, from Florent Revest. 16) Improve bpf_cpumask_ma to only allocate one bpf_mem_cache, from Hou Tao. 17) Fix BPF verifier's check_subprogs to not unnecessarily mark a subprogram with has_tail_call, from Ilya Leoshkevich. 18) Fix arm syscall regs spec in libbpf's bpf_tracing.h, from Puranjay Mohan. * tag 'for-netdev' of https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next: (85 commits) selftests/bpf: Add test for legacy/perf kprobe/uprobe attach mode selftests/bpf: Split test_attach_probe into multi subtests libbpf: Add support to set kprobe/uprobe attach mode tools/resolve_btfids: Add /libsubcmd to .gitignore bpf: add support for fixed-size memory pointer returns for kfuncs bpf: generalize dynptr_get_spi to be usable for iters bpf: mark PTR_TO_MEM as non-null register type bpf: move kfunc_call_arg_meta higher in the file bpf: ensure that r0 is marked scratched after any function call bpf: fix visit_insn()'s detection of BPF_FUNC_timer_set_callback helper bpf: clean up visit_insn()'s instruction processing selftests/bpf: adjust log_fixup's buffer size for proper truncation bpf: honor env->test_state_freq flag in is_state_visited() selftests/bpf: enhance align selftest's expected log matching bpf: improve regsafe() checks for PTR_TO_{MEM,BUF,TP_BUFFER} bpf: improve stack slot state printing selftests/bpf: Disassembler tests for verifier.c:convert_ctx_access() selftests/bpf: test if pointer type is tracked for BPF_ST_MEM bpf: allow ctx writes using BPF_ST_MEM instruction bpf: Use separate RCU callbacks for freeing selem ... ====================

Jakub Kicinski committed 3 years ago

Commit 36e5e392 parents 5ca26d6 8f4c92f131 files · +7102 −1792Browse files

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

Unified · Split

include/uapi/linux/bpf.h+31−2
@@ -4969,6 +4969,12 @@ union bpf_attr { · 4968 unmodified lines
49694969 * different maps if key/value layout matches across maps.
49704970 * Every bpf_timer_set_callback() can have different callback_fn.
49714971 *
4972+ * *flags* can be one of:
4973+ *
4974+ * **BPF_F_TIMER_ABS**
4975+ * Start the timer in absolute expire value instead of the
4976+ * default relative one.
4977+ *
49724978 * Return
49734979 * 0 on success.
49744980 * **-EINVAL** if *timer* was not initialized with bpf_timer_init() earlier
@@ -5325,11 +5331,22 @@ union bpf_attr { · 350 unmodified lines
53255331 * Description
53265332 * Write *len* bytes from *src* into *dst*, starting from *offset*
53275333 * into *dst*.
5328− * *flags* is currently unused.
5334+ *
5335+ * *flags* must be 0 except for skb-type dynptrs.
5336+ *
5337+ * For skb-type dynptrs:
5338+ * * All data slices of the dynptr are automatically
5339+ * invalidated after **bpf_dynptr_write**\ (). This is
5340+ * because writing may pull the skb and change the
5341+ * underlying packet buffer.
5342+ *
5343+ * * For *flags*, please see the flags accepted by
5344+ * **bpf_skb_store_bytes**\ ().
53295345 * Return
53305346 * 0 on success, -E2BIG if *offset* + *len* exceeds the length
53315347 * of *dst*'s data, -EINVAL if *dst* is an invalid dynptr or if *dst*
5332− * is a read-only dynptr or if *flags* is not 0.
5348+ * is a read-only dynptr or if *flags* is not correct. For skb-type dynptrs,
5349+ * other errors correspond to errors returned by **bpf_skb_store_bytes**\ ().
53335350 *
53345351 * void *bpf_dynptr_data(const struct bpf_dynptr *ptr, u32 offset, u32 len)
53355352 * Description
@@ -5337,6 +5354,9 @@ union bpf_attr { · 1 unmodified line
53375354 *
53385355 * *len* must be a statically known value. The returned data slice
53395356 * is invalidated whenever the dynptr is invalidated.
5357+ *
5358+ * skb and xdp type dynptrs may not use bpf_dynptr_data. They should
5359+ * instead use bpf_dynptr_slice and bpf_dynptr_slice_rdwr.
53405360 * Return
53415361 * Pointer to the underlying dynptr data, NULL if the dynptr is
53425362 * read-only, if the dynptr is invalid, or if the offset and length
@@ -7083,4 +7103,13 @@ struct bpf_core_relo { · 1740 unmodified lines
70837103 enum bpf_core_relo_kind kind;
70847104 };
70857105
7106+/*
7107+ * Flags to control bpf_timer_start() behaviour.
7108+ * - BPF_F_TIMER_ABS: Timeout passed is absolute time, by default it is
7109+ * relative to current time.
7110+ */
7111+enum {
7112+ BPF_F_TIMER_ABS = (1ULL << 0),
7113+};
7114+
70867115 #endif /* _UAPI__LINUX_BPF_H__ */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t