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
1047 BPF_TCX_INGRESS,1047 BPF_TCX_INGRESS,
1048 BPF_TCX_EGRESS,1048 BPF_TCX_EGRESS,
1049 BPF_TRACE_UPROBE_MULTI,1049 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,
1050 __MAX_BPF_ATTACH_TYPE1055 __MAX_BPF_ATTACH_TYPE
1051};1056};
1052 1057
@@ -2704,8 +2709,8 @@ union bpf_attr { · 1651 unmodified lines
2704 * *bpf_socket* should be one of the following:2709 * *bpf_socket* should be one of the following:
2705 *2710 *
2706 * * **struct bpf_sock_ops** for **BPF_PROG_TYPE_SOCK_OPS**.2711 * * **struct bpf_sock_ops** for **BPF_PROG_TYPE_SOCK_OPS**.
2707 * * **struct bpf_sock_addr** for **BPF_CGROUP_INET4_CONNECT**2712 * * **struct bpf_sock_addr** for **BPF_CGROUP_INET4_CONNECT**,
2708 * and **BPF_CGROUP_INET6_CONNECT**.2713 * **BPF_CGROUP_INET6_CONNECT** and **BPF_CGROUP_UNIX_CONNECT**.
2709 *2714 *
2710 * This helper actually implements a subset of **setsockopt()**.2715 * This helper actually implements a subset of **setsockopt()**.
2711 * It supports the following *level*\ s:2716 * It supports the following *level*\ s:
@@ -2943,8 +2948,8 @@ union bpf_attr { · 231 unmodified lines
2943 * *bpf_socket* should be one of the following:2948 * *bpf_socket* should be one of the following:
2944 *2949 *
2945 * * **struct bpf_sock_ops** for **BPF_PROG_TYPE_SOCK_OPS**.2950 * * **struct bpf_sock_ops** for **BPF_PROG_TYPE_SOCK_OPS**.
2946 * * **struct bpf_sock_addr** for **BPF_CGROUP_INET4_CONNECT**2951 * * **struct bpf_sock_addr** for **BPF_CGROUP_INET4_CONNECT**,
2947 * and **BPF_CGROUP_INET6_CONNECT**.2952 * **BPF_CGROUP_INET6_CONNECT** and **BPF_CGROUP_UNIX_CONNECT**.
2948 *2953 *
2949 * This helper actually implements a subset of **getsockopt()**.2954 * This helper actually implements a subset of **getsockopt()**.
2950 * It supports the same set of *optname*\ s that is supported by2955 * It supports the same set of *optname*\ s that is supported by
@@ -3264,6 +3269,11 @@ union bpf_attr { · 313 unmodified lines
3264 * and *params*->smac will not be set as output. A common3269 * and *params*->smac will not be set as output. A common
3265 * use case is to call **bpf_redirect_neigh**\ () after3270 * use case is to call **bpf_redirect_neigh**\ () after
3266 * doing **bpf_fib_lookup**\ ().3271 * 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.
3267 *3277 *
3268 * *ctx* is either **struct xdp_md** for XDP programs or3278 * *ctx* is either **struct xdp_md** for XDP programs or
3269 * **struct sk_buff** tc cls_act programs.3279 * **struct sk_buff** tc cls_act programs.
@@ -5096,6 +5106,8 @@ union bpf_attr { · 1826 unmodified lines
5096 * **BPF_F_TIMER_ABS**5106 * **BPF_F_TIMER_ABS**
5097 * Start the timer in absolute expire value instead of the5107 * Start the timer in absolute expire value instead of the
5098 * default relative one.5108 * default relative one.
5109 * **BPF_F_TIMER_CPU_PIN**
5110 * Timer will be pinned to the CPU of the caller.
5099 *5111 *
5100 * Return5112 * Return
5101 * 0 on success.5113 * 0 on success.
@@ -6532,6 +6544,7 @@ struct bpf_link_info { · 1430 unmodified lines
6532 __aligned_u64 addrs;6544 __aligned_u64 addrs;
6533 __u32 count; /* in/out: kprobe_multi function count */6545 __u32 count; /* in/out: kprobe_multi function count */
6534 __u32 flags;6546 __u32 flags;
6547 __u64 missed;
6535 } kprobe_multi;6548 } kprobe_multi;
6536 struct {6549 struct {
6537 __u32 type; /* enum bpf_perf_event_type */6550 __u32 type; /* enum bpf_perf_event_type */
@@ -6547,6 +6560,7 @@ struct bpf_link_info { · 9 unmodified lines
6547 __u32 name_len;6560 __u32 name_len;
6548 __u32 offset; /* offset from func_name */6561 __u32 offset; /* offset from func_name */
6549 __u64 addr;6562 __u64 addr;
6563 __u64 missed;
6550 } kprobe; /* BPF_PERF_EVENT_KPROBE, BPF_PERF_EVENT_KRETPROBE */6564 } kprobe; /* BPF_PERF_EVENT_KPROBE, BPF_PERF_EVENT_KRETPROBE */
6551 struct {6565 struct {
6552 __aligned_u64 tp_name; /* in/out */6566 __aligned_u64 tp_name; /* in/out */
@@ -6960,6 +6974,7 @@ enum { · 407 unmodified lines
6960 BPF_FIB_LOOKUP_OUTPUT = (1U << 1),6974 BPF_FIB_LOOKUP_OUTPUT = (1U << 1),
6961 BPF_FIB_LOOKUP_SKIP_NEIGH = (1U << 2),6975 BPF_FIB_LOOKUP_SKIP_NEIGH = (1U << 2),
6962 BPF_FIB_LOOKUP_TBID = (1U << 3),6976 BPF_FIB_LOOKUP_TBID = (1U << 3),
6977 BPF_FIB_LOOKUP_SRC = (1U << 4),
6963};6978};
6964 6979
6965enum {6980enum {
@@ -6972,6 +6987,7 @@ enum { · 6 unmodified lines
6972 BPF_FIB_LKUP_RET_UNSUPP_LWT, /* fwd requires encapsulation */6987 BPF_FIB_LKUP_RET_UNSUPP_LWT, /* fwd requires encapsulation */
6973 BPF_FIB_LKUP_RET_NO_NEIGH, /* no neighbor entry for nh */6988 BPF_FIB_LKUP_RET_NO_NEIGH, /* no neighbor entry for nh */
6974 BPF_FIB_LKUP_RET_FRAG_NEEDED, /* fragmentation required to fwd */6989 BPF_FIB_LKUP_RET_FRAG_NEEDED, /* fragmentation required to fwd */
6990 BPF_FIB_LKUP_RET_NO_SRC_ADDR, /* failed to derive IP src addr */
6975};6991};
6976 6992
6977struct bpf_fib_lookup {6993struct bpf_fib_lookup {
@@ -7006,6 +7022,9 @@ struct bpf_fib_lookup { · 28 unmodified lines
7006 __u32 rt_metric;7022 __u32 rt_metric;
7007 };7023 };
7008 7024
7025 /* input: source address to consider for lookup
7026 * output: source address result from lookup
7027 */
7009 union {7028 union {
7010 __be32 ipv4_src;7029 __be32 ipv4_src;
7011 __u32 ipv6_src[4]; /* in6_addr; network order */7030 __u32 ipv6_src[4]; /* in6_addr; network order */
@@ -7307,9 +7326,11 @@ struct bpf_core_relo { · 295 unmodified lines
7307 * Flags to control bpf_timer_start() behaviour.7326 * Flags to control bpf_timer_start() behaviour.
7308 * - BPF_F_TIMER_ABS: Timeout passed is absolute time, by default it is7327 * - BPF_F_TIMER_ABS: Timeout passed is absolute time, by default it is
7309 * relative to current time.7328 * relative to current time.
7329 * - BPF_F_TIMER_CPU_PIN: Timer will be pinned to the CPU of the caller.
7310 */7330 */
7311enum {7331enum {
7312 BPF_F_TIMER_ABS = (1ULL << 0),7332 BPF_F_TIMER_ABS = (1ULL << 0),
7333 BPF_F_TIMER_CPU_PIN = (1ULL << 1),
7313};7334};
7314 7335
7315/* BPF numbers iterator state */7336/* 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