History

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

Pull bpf updates from Alexei Starovoitov: "For this merge window we're splitting BPF pull request into three for higher visibility: main changes, res_spin_lock, try_alloc_pages. These are the main BPF changes: - Add DFA-based live registers analysis to improve verification of programs with loops (Eduard Zingerman) - Introduce load_acquire and store_release BPF instructions and add x86, arm64 JIT support (Peilin Ye) - Fix loop detection logic in the verifier (Eduard Zingerman) - Drop unnecesary lock in bpf_map_inc_not_zero() (Eric Dumazet) - Add kfunc for populating cpumask bits (Emil Tsalapatis) - Convert various shell based tests to selftests/bpf/test_progs format (Bastien Curutchet) - Allow passing referenced kptrs into struct_ops callbacks (Amery Hung) - Add a flag to LSM bpf hook to facilitate bpf program signing (Blaise Boscaccy) - Track arena arguments in kfuncs (Ihor Solodrai) - Add copy_remote_vm_str() helper for reading strings from remote VM and bpf_copy_from_user_task_str() kfunc (Jordan Rome) - Add support for timed may_goto instruction (Kumar Kartikeya Dwivedi) - Allow bpf_get_netns_cookie() int cgroup_skb programs (Mahe Tardy) - Reduce bpf_cgrp_storage_busy false positives when accessing cgroup local storage (Martin KaFai Lau) - Introduce bpf_dynptr_copy() kfunc (Mykyta Yatsenko) - Allow retrieving BTF data with BTF token (Mykyta Yatsenko) - Add BPF kfuncs to set and get xattrs with 'security.bpf.' prefix (Song Liu) - Reject attaching programs to noreturn functions (Yafang Shao) - Introduce pre-order traversal of cgroup bpf programs (Yonghong Song)" * tag 'bpf-next-6.15' of git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next: (186 commits) selftests/bpf: Add selftests for load-acquire/store-release when register number is invalid bpf: Fix out-of-bounds read in check_atomic_load/store() libbpf: Add namespace for errstr making it libbpf_errstr bpf: Add struct_ops context information to struct bpf_prog_aux selftests/bpf: Sanitize pointer prior fclose() selftests/bpf: Migrate test_xdp_vlan.sh into test_progs selftests/bpf: test_xdp_vlan: Rename BPF sections bpf: clarify a misleading verifier error message selftests/bpf: Add selftest for attaching fexit to __noreturn functions bpf: Reject attaching fexit/fmod_ret to __noreturn functions bpf: Only fails the busy counter check in bpf_cgrp_storage_get if it creates storage bpf: Make perf_event_read_output accessible in all program types. bpftool: Using the right format specifiers bpftool: Add -Wformat-signedness flag to detect format errors selftests/bpf: Test freplace from user namespace libbpf: Pass BPF token from find_prog_btf_id to BPF_BTF_GET_FD_BY_ID bpf: Return prog btf_id without capable check bpf: BPF token support for BPF_BTF_GET_FD_BY_ID bpf, x86: Fix objtool warning for timed may_goto bpf: Check map->record at the beginning of check_and_free_fields() ...

Linus Torvalds committed 1 year ago

Commit fa593d02 parents 7f2ff7b 9aa8fe2213 files · +10643 −3497Browse files

Showing the changes to include/uapi/linux (3 of 213 files). Show all

Unified · Split

3 files
  1. include/uapi/linux/bpf.h +9 −1
  2. include/uapi/linux/btf.h +2 −1
  3. include/uapi/linux/xattr.h +4 −0
include/uapi/linux/bpf.h+9−1
@@ -51,6 +51,9 @@ · 50 unmodified lines
5151 #define BPF_XCHG (0xe0 | BPF_FETCH) /* atomic exchange */
5252 #define BPF_CMPXCHG (0xf0 | BPF_FETCH) /* atomic compare-and-write */
5353
54+#define BPF_LOAD_ACQ 0x100 /* load-acquire */
55+#define BPF_STORE_REL 0x110 /* store-release */
56+
5457 enum bpf_cond_pseudo_jmp {
5558 BPF_MAY_GOTO = 0,
5659 };
@@ -1207,6 +1210,7 @@ enum bpf_perf_event_type { · 1150 unmodified lines
12071210 #define BPF_F_BEFORE (1U << 3)
12081211 #define BPF_F_AFTER (1U << 4)
12091212 #define BPF_F_ID (1U << 5)
1213+#define BPF_F_PREORDER (1U << 6)
12101214 #define BPF_F_LINK BPF_F_LINK /* 1 << 13 */
12111215
12121216 /* If BPF_F_STRICT_ALIGNMENT is used in BPF_PROG_LOAD command, the
@@ -1648,6 +1652,7 @@ union bpf_attr { · 435 unmodified lines
16481652 };
16491653 __u32 next_id;
16501654 __u32 open_flags;
1655+ __s32 fd_by_id_token_fd;
16511656 };
16521657
16531658 struct { /* anonymous struct used by BPF_OBJ_GET_INFO_BY_FD */
@@ -6019,7 +6024,10 @@ union bpf_attr { · 4365 unmodified lines
60196024 FN(user_ringbuf_drain, 209, ##ctx) \
60206025 FN(cgrp_storage_get, 210, ##ctx) \
60216026 FN(cgrp_storage_delete, 211, ##ctx) \
6022− /* */
6027+ /* This helper list is effectively frozen. If you are trying to \
6028+ * add a new helper, you should add a kfunc instead which has \
6029+ * less stability guarantees. See Documentation/bpf/kfuncs.rst \
6030+ */
60236031
60246032 /* backwards-compatibility macros for users of __BPF_FUNC_MAPPER that don't
60256033 * know or care about integer value that is now passed as second argument
include/uapi/linux/btf.h+2−1
@@ -36,7 +36,8 @@ struct btf_type { · 35 unmodified lines
3636 * bits 24-28: kind (e.g. int, ptr, array...etc)
3737 * bits 29-30: unused
3838 * bit 31: kind_flag, currently used by
39− * struct, union, enum, fwd and enum64
39+ * struct, union, enum, fwd, enum64,
40+ * decl_tag and type_tag
4041 */
4142 __u32 info;
4243 /* "size" is used by INT, ENUM, STRUCT, UNION, DATASEC and ENUM64.
include/uapi/linux/xattr.h+4−0
@@ -83,6 +83,10 @@ struct xattr_args { · 82 unmodified lines
8383 #define XATTR_CAPS_SUFFIX "capability"
8484 #define XATTR_NAME_CAPS XATTR_SECURITY_PREFIX XATTR_CAPS_SUFFIX
8585
86+#define XATTR_BPF_LSM_SUFFIX "bpf."
87+#define XATTR_NAME_BPF_LSM (XATTR_SECURITY_PREFIX XATTR_BPF_LSM_SUFFIX)
88+#define XATTR_NAME_BPF_LSM_LEN (sizeof(XATTR_NAME_BPF_LSM) - 1)
89+
8690 #define XATTR_POSIX_ACL_ACCESS "posix_acl_access"
8791 #define XATTR_NAME_POSIX_ACL_ACCESS XATTR_SYSTEM_PREFIX XATTR_POSIX_ACL_ACCESS
8892 #define XATTR_POSIX_ACL_DEFAULT "posix_acl_default"