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-10-16 We've added 90 non-merge commits during the last 25 day(s) which contain a total of 120 files changed, 3519 insertions(+), 895 deletions(-). The main changes are: 1) Add missed stats for kprobes to retrieve the number of missed kprobe executions and subsequent executions of BPF programs, from Jiri Olsa. 2) Add cgroup BPF sockaddr hooks for unix sockets. The use case is for systemd to reimplement the LogNamespace feature which allows running multiple instances of systemd-journald to process the logs of different services, from Daan De Meyer. 3) Implement BPF CPUv4 support for s390x BPF JIT, from Ilya Leoshkevich. 4) Improve BPF verifier log output for scalar registers to better disambiguate their internal state wrt defaults vs min/max values matching, from Andrii Nakryiko. 5) Extend the BPF fib lookup helpers for IPv4/IPv6 to support retrieving the source IP address with a new BPF_FIB_LOOKUP_SRC flag, from Martynas Pumputis. 6) Add support for open-coded task_vma iterator to help with symbolization for BPF-collected user stacks, from Dave Marchevsky. 7) Add libbpf getters for accessing individual BPF ring buffers which is useful for polling them individually, for example, from Martin Kelly. 8) Extend AF_XDP selftests to validate the SHARED_UMEM feature, from Tushar Vyavahare. 9) Improve BPF selftests cross-building support for riscv arch, from Björn Töpel. 10) Add the ability to pin a BPF timer to the same calling CPU, from David Vernet. 11) Fix libbpf's bpf_tracing.h macros for riscv to use the generic implementation of PT_REGS_SYSCALL_REGS() to access syscall arguments, from Alexandre Ghiti. 12) Extend libbpf to support symbol versioning for uprobes, from Hengqi Chen. 13) Fix bpftool's skeleton code generation to guarantee that ELF data is 8 byte aligned, from Ian Rogers. 14) Inherit system-wide cpu_mitigations_off() setting for Spectre v1/v4 security mitigations in BPF verifier, from Yafang Shao. 15) Annotate struct bpf_stack_map with __counted_by attribute to prepare BPF side for upcoming __counted_by compiler support, from Kees Cook. * tag 'for-netdev' of https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next: (90 commits) bpf: Ensure proper register state printing for cond jumps bpf: Disambiguate SCALAR register state output in verifier logs selftests/bpf: Make align selftests more robust selftests/bpf: Improve missed_kprobe_recursion test robustness selftests/bpf: Improve percpu_alloc test robustness selftests/bpf: Add tests for open-coded task_vma iter bpf: Introduce task_vma open-coded iterator kfuncs selftests/bpf: Rename bpf_iter_task_vma.c to bpf_iter_task_vmas.c bpf: Don't explicitly emit BTF for struct btf_iter_num bpf: Change syscall_nr type to int in struct syscall_tp_t net/bpf: Avoid unused "sin_addr_len" warning when CONFIG_CGROUP_BPF is not set bpf: Avoid unnecessary audit log for CPU security mitigations selftests/bpf: Add tests for cgroup unix socket address hooks selftests/bpf: Make sure mount directory exists documentation/bpf: Document cgroup unix socket address hooks bpftool: Add support for cgroup unix socket address hooks libbpf: Add support for cgroup unix socket address hooks bpf: Implement cgroup sockaddr hooks for unix sockets bpf: Add bpf_sock_addr_set_sun_path() to allow writing unix sockaddr from bpf bpf: Propagate modified uaddrlen from cgroup sockaddr programs ... ====================

Jakub Kicinski committed 3 years ago

Commit a3c2dd92 parents 90de47f 99c9991120 files · +3519 −895Browse files

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

Unified · Split

include/uapi/linux/bpf.h+25−4
@@ -1047,6 +1047,11 @@ enum bpf_attach_type { · 1046 unmodified lines
10471047 BPF_TCX_INGRESS,
10481048 BPF_TCX_EGRESS,
10491049 BPF_TRACE_UPROBE_MULTI,
1050+ BPF_CGROUP_UNIX_CONNECT,
1051+ BPF_CGROUP_UNIX_SENDMSG,
1052+ BPF_CGROUP_UNIX_RECVMSG,
1053+ BPF_CGROUP_UNIX_GETPEERNAME,
1054+ BPF_CGROUP_UNIX_GETSOCKNAME,
10501055 __MAX_BPF_ATTACH_TYPE
10511056 };
10521057
@@ -2704,8 +2709,8 @@ union bpf_attr { · 1651 unmodified lines
27042709 * *bpf_socket* should be one of the following:
27052710 *
27062711 * * **struct bpf_sock_ops** for **BPF_PROG_TYPE_SOCK_OPS**.
2707− * * **struct bpf_sock_addr** for **BPF_CGROUP_INET4_CONNECT**
2708− * and **BPF_CGROUP_INET6_CONNECT**.
2712+ * * **struct bpf_sock_addr** for **BPF_CGROUP_INET4_CONNECT**,
2713+ * **BPF_CGROUP_INET6_CONNECT** and **BPF_CGROUP_UNIX_CONNECT**.
27092714 *
27102715 * This helper actually implements a subset of **setsockopt()**.
27112716 * It supports the following *level*\ s:
@@ -2943,8 +2948,8 @@ union bpf_attr { · 231 unmodified lines
29432948 * *bpf_socket* should be one of the following:
29442949 *
29452950 * * **struct bpf_sock_ops** for **BPF_PROG_TYPE_SOCK_OPS**.
2946− * * **struct bpf_sock_addr** for **BPF_CGROUP_INET4_CONNECT**
2947− * and **BPF_CGROUP_INET6_CONNECT**.
2951+ * * **struct bpf_sock_addr** for **BPF_CGROUP_INET4_CONNECT**,
2952+ * **BPF_CGROUP_INET6_CONNECT** and **BPF_CGROUP_UNIX_CONNECT**.
29482953 *
29492954 * This helper actually implements a subset of **getsockopt()**.
29502955 * It supports the same set of *optname*\ s that is supported by
@@ -3264,6 +3269,11 @@ union bpf_attr { · 313 unmodified lines
32643269 * and *params*->smac will not be set as output. A common
32653270 * use case is to call **bpf_redirect_neigh**\ () after
32663271 * doing **bpf_fib_lookup**\ ().
3272+ * **BPF_FIB_LOOKUP_SRC**
3273+ * Derive and set source IP addr in *params*->ipv{4,6}_src
3274+ * for the nexthop. If the src addr cannot be derived,
3275+ * **BPF_FIB_LKUP_RET_NO_SRC_ADDR** is returned. In this
3276+ * case, *params*->dmac and *params*->smac are not set either.
32673277 *
32683278 * *ctx* is either **struct xdp_md** for XDP programs or
32693279 * **struct sk_buff** tc cls_act programs.
@@ -5096,6 +5106,8 @@ union bpf_attr { · 1826 unmodified lines
50965106 * **BPF_F_TIMER_ABS**
50975107 * Start the timer in absolute expire value instead of the
50985108 * default relative one.
5109+ * **BPF_F_TIMER_CPU_PIN**
5110+ * Timer will be pinned to the CPU of the caller.
50995111 *
51005112 * Return
51015113 * 0 on success.
@@ -6532,6 +6544,7 @@ struct bpf_link_info { · 1430 unmodified lines
65326544 __aligned_u64 addrs;
65336545 __u32 count; /* in/out: kprobe_multi function count */
65346546 __u32 flags;
6547+ __u64 missed;
65356548 } kprobe_multi;
65366549 struct {
65376550 __u32 type; /* enum bpf_perf_event_type */
@@ -6547,6 +6560,7 @@ struct bpf_link_info { · 9 unmodified lines
65476560 __u32 name_len;
65486561 __u32 offset; /* offset from func_name */
65496562 __u64 addr;
6563+ __u64 missed;
65506564 } kprobe; /* BPF_PERF_EVENT_KPROBE, BPF_PERF_EVENT_KRETPROBE */
65516565 struct {
65526566 __aligned_u64 tp_name; /* in/out */
@@ -6960,6 +6974,7 @@ enum { · 407 unmodified lines
69606974 BPF_FIB_LOOKUP_OUTPUT = (1U << 1),
69616975 BPF_FIB_LOOKUP_SKIP_NEIGH = (1U << 2),
69626976 BPF_FIB_LOOKUP_TBID = (1U << 3),
6977+ BPF_FIB_LOOKUP_SRC = (1U << 4),
69636978 };
69646979
69656980 enum {
@@ -6972,6 +6987,7 @@ enum { · 6 unmodified lines
69726987 BPF_FIB_LKUP_RET_UNSUPP_LWT, /* fwd requires encapsulation */
69736988 BPF_FIB_LKUP_RET_NO_NEIGH, /* no neighbor entry for nh */
69746989 BPF_FIB_LKUP_RET_FRAG_NEEDED, /* fragmentation required to fwd */
6990+ BPF_FIB_LKUP_RET_NO_SRC_ADDR, /* failed to derive IP src addr */
69756991 };
69766992
69776993 struct bpf_fib_lookup {
@@ -7006,6 +7022,9 @@ struct bpf_fib_lookup { · 28 unmodified lines
70067022 __u32 rt_metric;
70077023 };
70087024
7025+ /* input: source address to consider for lookup
7026+ * output: source address result from lookup
7027+ */
70097028 union {
70107029 __be32 ipv4_src;
70117030 __u32 ipv6_src[4]; /* in6_addr; network order */
@@ -7307,9 +7326,11 @@ struct bpf_core_relo { · 295 unmodified lines
73077326 * Flags to control bpf_timer_start() behaviour.
73087327 * - BPF_F_TIMER_ABS: Timeout passed is absolute time, by default it is
73097328 * relative to current time.
7329+ * - BPF_F_TIMER_CPU_PIN: Timer will be pinned to the CPU of the caller.
73107330 */
73117331 enum {
73127332 BPF_F_TIMER_ABS = (1ULL << 0),
7333+ BPF_F_TIMER_CPU_PIN = (1ULL << 1),
73137334 };
73147335
73157336 /* BPF numbers iterator state */

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