projects/linux·commit fa593d0f

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

fa593d0f · Linus Torvalds <[email protected]> · 2025-03-30 12:43:03 -07:00

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()
  ...
Commit
fa593d0f969dcfa41d390822fdf1a0ab48cd882c
Parents
7f2ff7b6 · 9aa8fe29

Merge commit. Changes below are compared with the first parent: 7f2ff7b6.

Changes

211 files changed · +10536 −3390

FileStatusAddDelContent
Documentation/bpf/bpf_iterators.rstmodified+1−1View file
Documentation/bpf/btf.rstmodified+21−4View file
Documentation/bpf/standardization/instruction-set.rstmodified+14−6View file
arch/arm64/include/asm/insn.hmodified+10−2View file
arch/arm64/lib/insn.cmodified+29−0View file
arch/arm64/net/bpf_jit.hmodified+20−0View file
arch/arm64/net/bpf_jit_comp.cmodified+87−5View file
arch/s390/net/bpf_jit_comp.cmodified+10−4View file
arch/x86/net/Makefilemodified+1−1View file
arch/x86/net/bpf_jit_comp.cmodified+87−13View file
arch/x86/net/bpf_timed_may_goto.Sadded+55−0View file
fs/bpf_fs_kfuncs.cmodified+214−11View file
include/linux/bpf-cgroup.hmodified+1−0View file
include/linux/bpf.hmodified+29−2View file
include/linux/bpf_lsm.hmodified+18−0View file
include/linux/bpf_verifier.hmodified+23−9View file
include/linux/btf.hmodified+3−0View file
include/linux/filter.hmodified+20−0View file
include/linux/lsm_hook_defs.hmodified+3−3View file
include/linux/mm.hmodified+5−0View file
include/linux/security.hmodified+6−6View file
include/uapi/linux/bpf.hmodified+9−1View file
include/uapi/linux/btf.hmodified+2−1View file
include/uapi/linux/xattr.hmodified+4−0View file
kernel/bpf/arena.cmodified+2−2View file
kernel/bpf/bpf_cgrp_storage.cmodified+6−5View file
kernel/bpf/bpf_iter.cmodified+6−7View file
kernel/bpf/bpf_lsm.cmodified+2−0View file
kernel/bpf/bpf_struct_ops.cmodified+75−60View file
kernel/bpf/btf.cmodified+113−14View file
kernel/bpf/cgroup.cmodified+25−8View file
kernel/bpf/core.cmodified+107−10View file
kernel/bpf/cpumask.cmodified+53−0View file
kernel/bpf/disasm.cmodified+14−2View file
kernel/bpf/hashtab.cmodified+6−3View file
kernel/bpf/helpers.cmodified+119−4View file
kernel/bpf/preload/bpf_preload_kern.cmodified+1−0View file
kernel/bpf/syscall.cmodified+33−15View file
kernel/bpf/verifier.cmodified+1043−333View file
kernel/trace/bpf_trace.cmodified+10−4View file
mm/memory.cmodified+118−0View file
mm/nommu.cmodified+79−0View file
net/core/filter.cmodified+4−2View file
samples/bpf/Makefilemodified+1−1View file
scripts/Makefile.btfmodified+1−1View file
security/security.cmodified+9−6View file
security/selinux/hooks.cmodified+3−3View file
tools/bpf/bpftool/Makefilemodified+6−1View file
tools/bpf/bpftool/btf.cmodified+7−7View file
tools/bpf/bpftool/btf_dumper.cmodified+1−1View file
tools/bpf/bpftool/cgroup.cmodified+1−1View file
tools/bpf/bpftool/common.cmodified+4−3View file
tools/bpf/bpftool/gen.cmodified+6−6View file
tools/bpf/bpftool/jit_disasm.cmodified+2−1View file
tools/bpf/bpftool/link.cmodified+7−7View file
tools/bpf/bpftool/main.cmodified+4−4View file
tools/bpf/bpftool/map.cmodified+9−5View file
tools/bpf/bpftool/map_perf_ring.cmodified+3−3View file
tools/bpf/bpftool/net.cmodified+2−2View file
tools/bpf/bpftool/netlink_dumper.cmodified+3−3View file
tools/bpf/bpftool/prog.cmodified+7−6View file
tools/bpf/bpftool/tracelog.cmodified+1−1View file
tools/bpf/bpftool/xlated_dumper.cmodified+3−3View file
tools/bpf/runqslower/Makefilemodified+2−1View file
tools/include/uapi/linux/bpf.hmodified+9−1View file
tools/include/uapi/linux/btf.hmodified+2−1View file
tools/lib/bpf/bpf.cmodified+2−1View file
tools/lib/bpf/bpf.hmodified+2−1View file
tools/lib/bpf/btf.cmodified+78−27View file
tools/lib/bpf/btf.hmodified+3−0View file
tools/lib/bpf/btf_dump.cmodified+4−1View file
tools/lib/bpf/libbpf.cmodified+151−86View file
tools/lib/bpf/libbpf.hmodified+13−0View file
tools/lib/bpf/libbpf.mapmodified+3−0View file
tools/lib/bpf/libbpf_internal.hmodified+1−0View file
tools/lib/bpf/linker.cmodified+1−1View file
tools/lib/bpf/relo_core.cmodified+20−4View file
tools/lib/bpf/str_error.cmodified+1−1View file
tools/lib/bpf/str_error.hmodified+5−2View file
tools/lib/bpf/usdt.bpf.hmodified+32−0View file
tools/testing/selftests/bpf/DENYLIST.aarch64modified+0−9View file
tools/testing/selftests/bpf/Makefilemodified+14−14View file
tools/testing/selftests/bpf/bpf_arena_spin_lock.hadded+533−0View file
tools/testing/selftests/bpf/bpf_atomic.hadded+140−0View file
tools/testing/selftests/bpf/bpf_experimental.hmodified+9−6View file
tools/testing/selftests/bpf/bpf_kfuncs.hmodified+5−0View file
tools/testing/selftests/bpf/cap_helpers.cmodified+4−4View file
tools/testing/selftests/bpf/cap_helpers.hmodified+1−0View file
tools/testing/selftests/bpf/network_helpers.cmodified+76−35View file
tools/testing/selftests/bpf/network_helpers.hmodified+21−0View file
tools/testing/selftests/bpf/prog_tests/align.cmodified+10−1View file
tools/testing/selftests/bpf/prog_tests/arena_atomics.cmodified+65−1View file
tools/testing/selftests/bpf/prog_tests/arena_spin_lock.cadded+108−0View file
tools/testing/selftests/bpf/prog_tests/bloom_filter_map.cmodified+5−0View file
tools/testing/selftests/bpf/prog_tests/bpf_iter.cmodified+68−0View file
tools/testing/selftests/bpf/prog_tests/bpf_nf.cmodified+6−3View file
tools/testing/selftests/bpf/prog_tests/btf.cmodified+19−4View file
tools/testing/selftests/bpf/prog_tests/btf_dump.cmodified+110−37View file
tools/testing/selftests/bpf/prog_tests/cgroup_preorder.cadded+128−0View file
tools/testing/selftests/bpf/prog_tests/cgroup_v1v2.cmodified+9−4View file
tools/testing/selftests/bpf/prog_tests/compute_live_registers.cadded+9−0View file
tools/testing/selftests/bpf/prog_tests/core_reloc.cmodified+4−2View file
tools/testing/selftests/bpf/prog_tests/cpumask.cmodified+4−1View file
tools/testing/selftests/bpf/prog_tests/dynptr.cmodified+21−0View file
tools/testing/selftests/bpf/prog_tests/fd_array.cmodified+2−2View file
tools/testing/selftests/bpf/prog_tests/fexit_noreturns.cadded+9−0View file
tools/testing/selftests/bpf/prog_tests/fs_kfuncs.cmodified+152−10View file
tools/testing/selftests/bpf/prog_tests/kernel_flag.cadded+43−0View file
tools/testing/selftests/bpf/prog_tests/lwt_ip_encap.cadded+540−0View file
tools/testing/selftests/bpf/prog_tests/lwt_seg6local.cadded+176−0View file
tools/testing/selftests/bpf/prog_tests/netns_cookie.cmodified+14−7View file
tools/testing/selftests/bpf/prog_tests/ns_current_pid_tgid.cmodified+17−30View file
tools/testing/selftests/bpf/prog_tests/prepare.cadded+99−0View file
tools/testing/selftests/bpf/prog_tests/pro_epilogue.cmodified+2−0View file
tools/testing/selftests/bpf/prog_tests/rcu_read_lock.cmodified+3−0View file
tools/testing/selftests/bpf/prog_tests/read_vsyscall.cmodified+1−0View file
tools/testing/selftests/bpf/prog_tests/setget_sockopt.cmodified+1−1View file
tools/testing/selftests/bpf/prog_tests/spin_lock.cmodified+3−0View file
tools/testing/selftests/bpf/prog_tests/changes_pkt_data.c → tools/testing/selftests/bpf/prog_tests/summarization.crenamed+74−37View file
tools/testing/selftests/bpf/prog_tests/tailcalls.cmodified+1−0View file
tools/testing/selftests/bpf/prog_tests/tc_links.cmodified+14−14View file
tools/testing/selftests/bpf/prog_tests/tc_opts.cmodified+20−20View file
tools/testing/selftests/bpf/prog_tests/test_struct_ops_kptr_return.cadded+16−0View file
tools/testing/selftests/bpf/prog_tests/test_struct_ops_refcounted.cadded+14−0View file
tools/testing/selftests/bpf/prog_tests/test_tunnel.cmodified+530−103View file
tools/testing/selftests/bpf/prog_tests/test_veristat.cadded+139−0View file
tools/testing/selftests/bpf/prog_tests/test_xdp_veth.cmodified+512−126View file
tools/testing/selftests/bpf/prog_tests/token.cmodified+96−1View file
tools/testing/selftests/bpf/prog_tests/usdt.cmodified+10−1View file
tools/testing/selftests/bpf/prog_tests/verifier.cmodified+6−2View file
tools/testing/selftests/bpf/prog_tests/xdp_vlan.cadded+175−0View file
tools/testing/selftests/bpf/progs/arena_atomics.cmodified+119−2View file
tools/testing/selftests/bpf/progs/arena_spin_lock.cadded+51−0View file
tools/testing/selftests/bpf/progs/bpf_iter_tasks.cmodified+110−0View file
tools/testing/selftests/bpf/progs/bpf_misc.hmodified+22−0View file
tools/testing/selftests/bpf/progs/bpf_tracing_net.hmodified+4−0View file
tools/testing/selftests/bpf/progs/btf__core_reloc_arrays___err_bad_signed_arr_elem_sz.cadded+3−0View file
tools/testing/selftests/bpf/progs/cgroup_preorder.cadded+41−0View file
tools/testing/selftests/bpf/progs/compute_live_registers.cadded+424−0View file
tools/testing/selftests/bpf/progs/connect4_dropper.cmodified+3−1View file
tools/testing/selftests/bpf/progs/core_reloc_types.hmodified+10−0View file
tools/testing/selftests/bpf/progs/cpumask_common.hmodified+1−0View file
tools/testing/selftests/bpf/progs/cpumask_failure.cmodified+38−0View file
tools/testing/selftests/bpf/progs/cpumask_success.cmodified+119−1View file
tools/testing/selftests/bpf/progs/dynptr_success.cmodified+118−5View file
tools/testing/selftests/bpf/progs/fexit_noreturns.cadded+15−0View file
tools/testing/selftests/bpf/progs/irq.cmodified+70−1View file
tools/testing/selftests/bpf/progs/iters.cmodified+139−0View file
tools/testing/selftests/bpf/progs/netns_cookie_prog.cmodified+9−0View file
tools/testing/selftests/bpf/progs/preempt_lock.cmodified+67−1View file
tools/testing/selftests/bpf/progs/prepare.cadded+28−0View file
tools/testing/selftests/bpf/progs/priv_freplace_prog.cadded+13−0View file
tools/testing/selftests/bpf/progs/priv_prog.cmodified+3−3View file
tools/testing/selftests/bpf/progs/pro_epilogue_with_kfunc.cadded+88−0View file
tools/testing/selftests/bpf/progs/rcu_read_lock.cmodified+60−1View file
tools/testing/selftests/bpf/progs/read_vsyscall.cmodified+9−2View file
tools/testing/selftests/bpf/progs/set_global_vars.cadded+47−0View file
tools/testing/selftests/bpf/progs/strncmp_bench.cmodified+4−1View file
tools/testing/selftests/bpf/progs/struct_ops_kptr_return.cadded+30−0View file
tools/testing/selftests/bpf/progs/struct_ops_kptr_return_fail__invalid_scalar.cadded+26−0View file
tools/testing/selftests/bpf/progs/struct_ops_kptr_return_fail__local_kptr.cadded+34−0View file
tools/testing/selftests/bpf/progs/struct_ops_kptr_return_fail__nonzero_offset.cadded+25−0View file
tools/testing/selftests/bpf/progs/struct_ops_kptr_return_fail__wrong_type.cadded+30−0View file
tools/testing/selftests/bpf/progs/struct_ops_refcounted.cadded+31−0View file
tools/testing/selftests/bpf/progs/struct_ops_refcounted_fail__global_subprog.cadded+39−0View file
tools/testing/selftests/bpf/progs/struct_ops_refcounted_fail__ref_leak.cadded+22−0View file
tools/testing/selftests/bpf/progs/struct_ops_refcounted_fail__tail_call.cadded+36−0View file
tools/testing/selftests/bpf/progs/changes_pkt_data.c → tools/testing/selftests/bpf/progs/summarization.crenamed+41−2View file
tools/testing/selftests/bpf/progs/changes_pkt_data_freplace.c → tools/testing/selftests/bpf/progs/summarization_freplace.crenamed+16−1View file
tools/testing/selftests/bpf/progs/test_cgroup1_hierarchy.cmodified+2−2View file
tools/testing/selftests/bpf/progs/test_core_reloc_arrays.cmodified+5−0View file
tools/testing/selftests/bpf/progs/test_get_xattr.cmodified+24−4View file
tools/testing/selftests/bpf/progs/test_kernel_flag.cadded+28−0View file
tools/testing/selftests/bpf/progs/test_kfunc_dynptr_param.cmodified+3−3View file
tools/testing/selftests/bpf/progs/test_lookup_key.cmodified+1−1View file
tools/testing/selftests/bpf/progs/test_ptr_untrusted.cmodified+1−1View file
tools/testing/selftests/bpf/progs/test_select_reuseport_kern.cmodified+0−1View file
tools/testing/selftests/bpf/progs/test_set_remove_xattr.cadded+133−0View file
tools/testing/selftests/bpf/progs/test_spin_lock_fail.cmodified+69−0View file
tools/testing/selftests/bpf/progs/test_task_under_cgroup.cmodified+1−1View file
tools/testing/selftests/bpf/progs/test_usdt.cmodified+14−0View file
tools/testing/selftests/bpf/progs/test_verify_pkcs7_sig.cmodified+1−1View file
tools/testing/selftests/bpf/progs/test_xdp_vlan.cmodified+10−10View file
tools/testing/selftests/bpf/progs/verifier_bpf_fastcall.cmodified+48−10View file
tools/testing/selftests/bpf/progs/verifier_gotol.cmodified+1−5View file
tools/testing/selftests/bpf/progs/verifier_iterating_callbacks.cmodified+1−5View file
tools/testing/selftests/bpf/progs/verifier_load_acquire.cadded+218−0View file
tools/testing/selftests/bpf/progs/verifier_may_goto_1.cmodified+32−2View file
tools/testing/selftests/bpf/progs/verifier_precision.cmodified+49−0View file
tools/testing/selftests/bpf/progs/verifier_stack_ptr.cmodified+52−0View file
tools/testing/selftests/bpf/progs/verifier_store_release.cadded+286−0View file
tools/testing/selftests/bpf/progs/xdp_redirect_map.cmodified+88−0View file
tools/testing/selftests/bpf/progs/xdp_redirect_multi_kern.cmodified+29−12View file
tools/testing/selftests/bpf/test_btf.hmodified+6−0View file
tools/testing/selftests/bpf/test_kmods/bpf_testmod.cmodified+108−0View file
tools/testing/selftests/bpf/test_kmods/bpf_testmod.hmodified+6−0View file
tools/testing/selftests/bpf/test_loader.cmodified+29−3View file
tools/testing/selftests/bpf/test_lwt_ip_encap.shdeleted+0−476View before deletion
tools/testing/selftests/bpf/test_lwt_seg6local.shdeleted+0−156View before deletion
tools/testing/selftests/bpf/test_maps.cmodified+5−4View file
tools/testing/selftests/bpf/test_progs.cmodified+43−29View file
tools/testing/selftests/bpf/test_progs.hmodified+8−0View file
tools/testing/selftests/bpf/test_tunnel.shdeleted+0−645View before deletion
tools/testing/selftests/bpf/test_xdp_redirect_multi.shdeleted+0−214View before deletion
tools/testing/selftests/bpf/test_xdp_vlan.shdeleted+0−233View before deletion
tools/testing/selftests/bpf/test_xdp_vlan_mode_generic.shdeleted+0−9View before deletion
tools/testing/selftests/bpf/test_xdp_vlan_mode_native.shdeleted+0−9View before deletion
tools/testing/selftests/bpf/veristat.cmodified+355−12View file
tools/testing/selftests/bpf/with_addr.shdeleted+0−54View before deletion
tools/testing/selftests/bpf/with_tunnels.shdeleted+0−36View before deletion
tools/testing/selftests/bpf/xdp_redirect_multi.cdeleted+0−226View before deletion

Only the first 600 diff lines are shown. Download the complete patch.

Documentation/bpf/bpf_iterators.rst

View file
diff --git a/Documentation/bpf/bpf_iterators.rst b/Documentation/bpf/bpf_iterators.rst
index 0743391..7f514cb 100644
--- a/Documentation/bpf/bpf_iterators.rst
+++ b/Documentation/bpf/bpf_iterators.rst
@@ -86,7 +86,7 @@ following steps:
The following are a few examples of selftest BPF iterator programs:
* `bpf_iter_tcp4.c <https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git/tree/tools/testing/selftests/bpf/progs/bpf_iter_tcp4.c>`_
-* `bpf_iter_task_vma.c <https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git/tree/tools/testing/selftests/bpf/progs/bpf_iter_task_vma.c>`_
+* `bpf_iter_task_vmas.c <https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git/tree/tools/testing/selftests/bpf/progs/bpf_iter_task_vmas.c>`_
* `bpf_iter_task_file.c <https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git/tree/tools/testing/selftests/bpf/progs/bpf_iter_task_file.c>`_
Let us look at ``bpf_iter_task_file.c``, which runs in kernel space:

Documentation/bpf/btf.rst

View file
diff --git a/Documentation/bpf/btf.rst b/Documentation/bpf/btf.rst
index 2478cef..3b60583 100644
--- a/Documentation/bpf/btf.rst
+++ b/Documentation/bpf/btf.rst
@@ -102,7 +102,8 @@ Each type contains the following common data::
* bits 24-28: kind (e.g. int, ptr, array...etc)
* bits 29-30: unused
* bit 31: kind_flag, currently used by
- * struct, union, fwd, enum and enum64.
+ * struct, union, enum, fwd, enum64,
+ * decl_tag and type_tag
*/
__u32 info;
/* "size" is used by INT, ENUM, STRUCT, UNION and ENUM64.
@@ -478,7 +479,7 @@ No additional type data follow ``btf_type``.
``struct btf_type`` encoding requirement:
* ``name_off``: offset to a non-empty string
- * ``info.kind_flag``: 0
+ * ``info.kind_flag``: 0 or 1
* ``info.kind``: BTF_KIND_DECL_TAG
* ``info.vlen``: 0
* ``type``: ``struct``, ``union``, ``func``, ``var`` or ``typedef``
@@ -489,7 +490,6 @@ No additional type data follow ``btf_type``.
__u32 component_idx;
};
-The ``name_off`` encodes btf_decl_tag attribute string.
The ``type`` should be ``struct``, ``union``, ``func``, ``var`` or ``typedef``.
For ``var`` or ``typedef`` type, ``btf_decl_tag.component_idx`` must be ``-1``.
For the other three types, if the btf_decl_tag attribute is
@@ -499,12 +499,21 @@ the attribute is applied to a ``struct``/``union`` member or
a ``func`` argument, and ``btf_decl_tag.component_idx`` should be a
valid index (starting from 0) pointing to a member or an argument.
+If ``info.kind_flag`` is 0, then this is a normal decl tag, and the
+``name_off`` encodes btf_decl_tag attribute string.
+
+If ``info.kind_flag`` is 1, then the decl tag represents an arbitrary
+__attribute__. In this case, ``name_off`` encodes a string
+representing the attribute-list of the attribute specifier. For
+example, for an ``__attribute__((aligned(4)))`` the string's contents
+is ``aligned(4)``.
+
2.2.18 BTF_KIND_TYPE_TAG
~~~~~~~~~~~~~~~~~~~~~~~~
``struct btf_type`` encoding requirement:
* ``name_off``: offset to a non-empty string
- * ``info.kind_flag``: 0
+ * ``info.kind_flag``: 0 or 1
* ``info.kind``: BTF_KIND_TYPE_TAG
* ``info.vlen``: 0
* ``type``: the type with ``btf_type_tag`` attribute
@@ -522,6 +531,14 @@ type_tag, then zero or more const/volatile/restrict/typedef
and finally the base type. The base type is one of
int, ptr, array, struct, union, enum, func_proto and float types.
+Similarly to decl tags, if the ``info.kind_flag`` is 0, then this is a
+normal type tag, and the ``name_off`` encodes btf_type_tag attribute
+string.
+
+If ``info.kind_flag`` is 1, then the type tag represents an arbitrary
+__attribute__, and the ``name_off`` encodes a string representing the
+attribute-list of the attribute specifier.
+
2.2.19 BTF_KIND_ENUM64
~~~~~~~~~~~~~~~~~~~~~~

Documentation/bpf/standardization/instruction-set.rst

View file
diff --git a/Documentation/bpf/standardization/instruction-set.rst b/Documentation/bpf/standardization/instruction-set.rst
index ab820d5..fbe9755 100644
--- a/Documentation/bpf/standardization/instruction-set.rst
+++ b/Documentation/bpf/standardization/instruction-set.rst
@@ -324,34 +324,42 @@ register.
.. table:: Arithmetic instructions
- ===== ===== ======= ==========================================================
+ ===== ===== ======= ===================================================================================
name code offset description
- ===== ===== ======= ==========================================================
+ ===== ===== ======= ===================================================================================
ADD 0x0 0 dst += src
SUB 0x1 0 dst -= src
MUL 0x2 0 dst \*= src
DIV 0x3 0 dst = (src != 0) ? (dst / src) : 0
- SDIV 0x3 1 dst = (src != 0) ? (dst s/ src) : 0
+ SDIV 0x3 1 dst = (src == 0) ? 0 : ((src == -1 && dst == LLONG_MIN) ? LLONG_MIN : (dst s/ src))
OR 0x4 0 dst \|= src
AND 0x5 0 dst &= src
LSH 0x6 0 dst <<= (src & mask)
RSH 0x7 0 dst >>= (src & mask)
NEG 0x8 0 dst = -dst
MOD 0x9 0 dst = (src != 0) ? (dst % src) : dst
- SMOD 0x9 1 dst = (src != 0) ? (dst s% src) : dst
+ SMOD 0x9 1 dst = (src == 0) ? dst : ((src == -1 && dst == LLONG_MIN) ? 0: (dst s% src))
XOR 0xa 0 dst ^= src
MOV 0xb 0 dst = src
MOVSX 0xb 8/16/32 dst = (s8,s16,s32)src
ARSH 0xc 0 :term:`sign extending<Sign Extend>` dst >>= (src & mask)
END 0xd 0 byte swap operations (see `Byte swap instructions`_ below)
- ===== ===== ======= ==========================================================
+ ===== ===== ======= ===================================================================================
Underflow and overflow are allowed during arithmetic operations, meaning
the 64-bit or 32-bit value will wrap. If BPF program execution would
result in division by zero, the destination register is instead set to zero.
+Otherwise, for ``ALU64``, if execution would result in ``LLONG_MIN``
+dividing -1, the desination register is instead set to ``LLONG_MIN``. For
+``ALU``, if execution would result in ``INT_MIN`` dividing -1, the
+desination register is instead set to ``INT_MIN``.
+
If execution would result in modulo by zero, for ``ALU64`` the value of
the destination register is unchanged whereas for ``ALU`` the upper
-32 bits of the destination register are zeroed.
+32 bits of the destination register are zeroed. Otherwise, for ``ALU64``,
+if execution would resuslt in ``LLONG_MIN`` modulo -1, the destination
+register is instead set to 0. For ``ALU``, if execution would result in
+``INT_MIN`` modulo -1, the destination register is instead set to 0.
``{ADD, X, ALU}``, where 'code' = ``ADD``, 'source' = ``X``, and 'class' = ``ALU``, means::

arch/arm64/include/asm/insn.h

View file
diff --git a/arch/arm64/include/asm/insn.h b/arch/arm64/include/asm/insn.h
index e390c43..39577f1 100644
--- a/arch/arm64/include/asm/insn.h
+++ b/arch/arm64/include/asm/insn.h
@@ -188,8 +188,10 @@ enum aarch64_insn_ldst_type {
AARCH64_INSN_LDST_STORE_PAIR_PRE_INDEX,
AARCH64_INSN_LDST_LOAD_PAIR_POST_INDEX,
AARCH64_INSN_LDST_STORE_PAIR_POST_INDEX,
+ AARCH64_INSN_LDST_LOAD_ACQ,
AARCH64_INSN_LDST_LOAD_EX,
AARCH64_INSN_LDST_LOAD_ACQ_EX,
+ AARCH64_INSN_LDST_STORE_REL,
AARCH64_INSN_LDST_STORE_EX,
AARCH64_INSN_LDST_STORE_REL_EX,
AARCH64_INSN_LDST_SIGNED_LOAD_IMM_OFFSET,
@@ -351,8 +353,10 @@ __AARCH64_INSN_FUNCS(ldr_imm, 0x3FC00000, 0x39400000)
__AARCH64_INSN_FUNCS(ldr_lit, 0xBF000000, 0x18000000)
__AARCH64_INSN_FUNCS(ldrsw_lit, 0xFF000000, 0x98000000)
__AARCH64_INSN_FUNCS(exclusive, 0x3F800000, 0x08000000)
-__AARCH64_INSN_FUNCS(load_ex, 0x3F400000, 0x08400000)
-__AARCH64_INSN_FUNCS(store_ex, 0x3F400000, 0x08000000)
+__AARCH64_INSN_FUNCS(load_acq, 0x3FDFFC00, 0x08DFFC00)
+__AARCH64_INSN_FUNCS(store_rel, 0x3FDFFC00, 0x089FFC00)
+__AARCH64_INSN_FUNCS(load_ex, 0x3FC00000, 0x08400000)
+__AARCH64_INSN_FUNCS(store_ex, 0x3FC00000, 0x08000000)
__AARCH64_INSN_FUNCS(mops, 0x3B200C00, 0x19000400)
__AARCH64_INSN_FUNCS(stp, 0x7FC00000, 0x29000000)
__AARCH64_INSN_FUNCS(ldp, 0x7FC00000, 0x29400000)
@@ -602,6 +606,10 @@ u32 aarch64_insn_gen_load_store_pair(enum aarch64_insn_register reg1,
int offset,
enum aarch64_insn_variant variant,
enum aarch64_insn_ldst_type type);
+u32 aarch64_insn_gen_load_acq_store_rel(enum aarch64_insn_register reg,
+ enum aarch64_insn_register base,
+ enum aarch64_insn_size_type size,
+ enum aarch64_insn_ldst_type type);
u32 aarch64_insn_gen_load_store_ex(enum aarch64_insn_register reg,
enum aarch64_insn_register base,
enum aarch64_insn_register state,

arch/arm64/lib/insn.c

View file
diff --git a/arch/arm64/lib/insn.c b/arch/arm64/lib/insn.c
index b008a9b..9bef696 100644
--- a/arch/arm64/lib/insn.c
+++ b/arch/arm64/lib/insn.c
@@ -540,6 +540,35 @@ u32 aarch64_insn_gen_load_store_pair(enum aarch64_insn_register reg1,
offset >> shift);
}
+u32 aarch64_insn_gen_load_acq_store_rel(enum aarch64_insn_register reg,
+ enum aarch64_insn_register base,
+ enum aarch64_insn_size_type size,
+ enum aarch64_insn_ldst_type type)
+{
+ u32 insn;
+
+ switch (type) {
+ case AARCH64_INSN_LDST_LOAD_ACQ:
+ insn = aarch64_insn_get_load_acq_value();
+ break;
+ case AARCH64_INSN_LDST_STORE_REL:
+ insn = aarch64_insn_get_store_rel_value();
+ break;
+ default:
+ pr_err("%s: unknown load-acquire/store-release encoding %d\n",
+ __func__, type);
+ return AARCH64_BREAK_FAULT;
+ }
+
+ insn = aarch64_insn_encode_ldst_size(size, insn);
+
+ insn = aarch64_insn_encode_register(AARCH64_INSN_REGTYPE_RT, insn,
+ reg);
+
+ return aarch64_insn_encode_register(AARCH64_INSN_REGTYPE_RN, insn,
+ base);
+}
+
u32 aarch64_insn_gen_load_store_ex(enum aarch64_insn_register reg,
enum aarch64_insn_register base,
enum aarch64_insn_register state,

arch/arm64/net/bpf_jit.h

View file
diff --git a/arch/arm64/net/bpf_jit.h b/arch/arm64/net/bpf_jit.h
index b22ab2f..a3b0e69 100644
--- a/arch/arm64/net/bpf_jit.h
+++ b/arch/arm64/net/bpf_jit.h
@@ -119,6 +119,26 @@
aarch64_insn_gen_load_store_ex(Rt, Rn, Rs, A64_SIZE(sf), \
AARCH64_INSN_LDST_STORE_REL_EX)
+/* Load-acquire & store-release */
+#define A64_LDAR(Rt, Rn, size) \
+ aarch64_insn_gen_load_acq_store_rel(Rt, Rn, AARCH64_INSN_SIZE_##size, \
+ AARCH64_INSN_LDST_LOAD_ACQ)
+#define A64_STLR(Rt, Rn, size) \
+ aarch64_insn_gen_load_acq_store_rel(Rt, Rn, AARCH64_INSN_SIZE_##size, \
+ AARCH64_INSN_LDST_STORE_REL)
+
+/* Rt = [Rn] (load acquire) */
+#define A64_LDARB(Wt, Xn) A64_LDAR(Wt, Xn, 8)
+#define A64_LDARH(Wt, Xn) A64_LDAR(Wt, Xn, 16)
+#define A64_LDAR32(Wt, Xn) A64_LDAR(Wt, Xn, 32)
+#define A64_LDAR64(Xt, Xn) A64_LDAR(Xt, Xn, 64)
+
+/* [Rn] = Rt (store release) */
+#define A64_STLRB(Wt, Xn) A64_STLR(Wt, Xn, 8)
+#define A64_STLRH(Wt, Xn) A64_STLR(Wt, Xn, 16)
+#define A64_STLR32(Wt, Xn) A64_STLR(Wt, Xn, 32)
+#define A64_STLR64(Xt, Xn) A64_STLR(Xt, Xn, 64)
+
/*
* LSE atomics
*

arch/arm64/net/bpf_jit_comp.c

View file
diff --git a/arch/arm64/net/bpf_jit_comp.c b/arch/arm64/net/bpf_jit_comp.c
index 8446848..70d7c89 100644
--- a/arch/arm64/net/bpf_jit_comp.c
+++ b/arch/arm64/net/bpf_jit_comp.c
@@ -272,7 +272,7 @@ static inline void emit_a64_add_i(const bool is64, const int dst, const int src,
{
if (is_addsub_imm(imm)) {
emit(A64_ADD_I(is64, dst, src, imm), ctx);
- } else if (is_addsub_imm(-imm)) {
+ } else if (is_addsub_imm(-(u32)imm)) {
emit(A64_SUB_I(is64, dst, src, -imm), ctx);
} else {
emit_a64_mov_i(is64, tmp, imm, ctx);
@@ -647,6 +647,81 @@ static int emit_bpf_tail_call(struct jit_ctx *ctx)
return 0;
}
+static int emit_atomic_ld_st(const struct bpf_insn *insn, struct jit_ctx *ctx)
+{
+ const s32 imm = insn->imm;
+ const s16 off = insn->off;
+ const u8 code = insn->code;
+ const bool arena = BPF_MODE(code) == BPF_PROBE_ATOMIC;
+ const u8 arena_vm_base = bpf2a64[ARENA_VM_START];
+ const u8 dst = bpf2a64[insn->dst_reg];
+ const u8 src = bpf2a64[insn->src_reg];
+ const u8 tmp = bpf2a64[TMP_REG_1];
+ u8 reg;
+
+ switch (imm) {
+ case BPF_LOAD_ACQ:
+ reg = src;
+ break;
+ case BPF_STORE_REL:
+ reg = dst;
+ break;
+ default:
+ pr_err_once("unknown atomic load/store op code %02x\n", imm);
+ return -EINVAL;
+ }
+
+ if (off) {
+ emit_a64_add_i(1, tmp, reg, tmp, off, ctx);
+ reg = tmp;
+ }
+ if (arena) {
+ emit(A64_ADD(1, tmp, reg, arena_vm_base), ctx);
+ reg = tmp;
+ }
+
+ switch (imm) {
+ case BPF_LOAD_ACQ:
+ switch (BPF_SIZE(code)) {
+ case BPF_B:
+ emit(A64_LDARB(dst, reg), ctx);
+ break;
+ case BPF_H:
+ emit(A64_LDARH(dst, reg), ctx);
+ break;
+ case BPF_W:
+ emit(A64_LDAR32(dst, reg), ctx);
+ break;
+ case BPF_DW:
+ emit(A64_LDAR64(dst, reg), ctx);
+ break;
+ }
+ break;
+ case BPF_STORE_REL:
+ switch (BPF_SIZE(code)) {
+ case BPF_B:
+ emit(A64_STLRB(src, reg), ctx);
+ break;
+ case BPF_H:
+ emit(A64_STLRH(src, reg), ctx);
+ break;
+ case BPF_W:
+ emit(A64_STLR32(src, reg), ctx);
+ break;
+ case BPF_DW:
+ emit(A64_STLR64(src, reg), ctx);
+ break;
+ }
+ break;
+ default:
+ pr_err_once("unexpected atomic load/store op code %02x\n",
+ imm);
+ return -EINVAL;
+ }
+
+ return 0;
+}
+
#ifdef CONFIG_ARM64_LSE_ATOMICS
static int emit_lse_atomic(const struct bpf_insn *insn, struct jit_ctx *ctx)
{
@@ -1159,7 +1234,7 @@ emit_bswap_uxt:
case BPF_ALU64 | BPF_SUB | BPF_K:
if (is_addsub_imm(imm)) {
emit(A64_SUB_I(is64, dst, dst, imm), ctx);
- } else if (is_addsub_imm(-imm)) {
+ } else if (is_addsub_imm(-(u32)imm)) {
emit(A64_ADD_I(is64, dst, dst, -imm), ctx);
} else {
emit_a64_mov_i(is64, tmp, imm, ctx);
@@ -1330,7 +1405,7 @@ emit_cond_jmp:
case BPF_JMP32 | BPF_JSLE | BPF_K:
if (is_addsub_imm(imm)) {
emit(A64_CMP_I(is64, dst, imm), ctx);
- } else if (is_addsub_imm(-imm)) {
+ } else if (is_addsub_imm(-(u32)imm)) {
emit(A64_CMN_I(is64, dst, -imm), ctx);
} else {
emit_a64_mov_i(is64, tmp, imm, ctx);
@@ -1641,11 +1716,17 @@ emit_cond_jmp:
return ret;
break;
+ case BPF_STX | BPF_ATOMIC | BPF_B:
+ case BPF_STX | BPF_ATOMIC | BPF_H:
case BPF_STX | BPF_ATOMIC | BPF_W:
case BPF_STX | BPF_ATOMIC | BPF_DW:
+ case BPF_STX | BPF_PROBE_ATOMIC | BPF_B:
+ case BPF_STX | BPF_PROBE_ATOMIC | BPF_H:
case BPF_STX | BPF_PROBE_ATOMIC | BPF_W:
case BPF_STX | BPF_PROBE_ATOMIC | BPF_DW:
- if (cpus_have_cap(ARM64_HAS_LSE_ATOMICS))
+ if (bpf_atomic_is_load_store(insn))
+ ret = emit_atomic_ld_st(insn, ctx);
+ else if (cpus_have_cap(ARM64_HAS_LSE_ATOMICS))
ret = emit_lse_atomic(insn, ctx);
else
ret = emit_ll_sc_atomic(insn, ctx);
@@ -2669,7 +2750,8 @@ bool bpf_jit_supports_insn(struct bpf_insn *insn, bool in_arena)
switch (insn->code) {
case BPF_STX | BPF_ATOMIC | BPF_W:
case BPF_STX | BPF_ATOMIC | BPF_DW:
- if (!cpus_have_cap(ARM64_HAS_LSE_ATOMICS))
+ if (!bpf_atomic_is_load_store(insn) &&
+ !cpus_have_cap(ARM64_HAS_LSE_ATOMICS))
return false;
}
return true;

arch/s390/net/bpf_jit_comp.c

View file
diff --git a/arch/s390/net/bpf_jit_comp.c b/arch/s390/net/bpf_jit_comp.c
index 9d440a0..0776dfd 100644
--- a/arch/s390/net/bpf_jit_comp.c
+++ b/arch/s390/net/bpf_jit_comp.c
@@ -2919,10 +2919,16 @@ bool bpf_jit_supports_arena(void)
bool bpf_jit_supports_insn(struct bpf_insn *insn, bool in_arena)
{
- /*
- * Currently the verifier uses this function only to check which
- * atomic stores to arena are supported, and they all are.
- */
+ if (!in_arena)
+ return true;
+ switch (insn->code) {
+ case BPF_STX | BPF_ATOMIC | BPF_B:
+ case BPF_STX | BPF_ATOMIC | BPF_H:
+ case BPF_STX | BPF_ATOMIC | BPF_W:
+ case BPF_STX | BPF_ATOMIC | BPF_DW:
+ if (bpf_atomic_is_load_store(insn))
+ return false;
+ }
return true;
}

arch/x86/net/Makefile

View file
diff --git a/arch/x86/net/Makefile b/arch/x86/net/Makefile
index 383c873..dddbefc 100644
--- a/arch/x86/net/Makefile
+++ b/arch/x86/net/Makefile
@@ -6,5 +6,5 @@
ifeq ($(CONFIG_X86_32),y)
obj-$(CONFIG_BPF_JIT) += bpf_jit_comp32.o
else
- obj-$(CONFIG_BPF_JIT) += bpf_jit_comp.o
+ obj-$(CONFIG_BPF_JIT) += bpf_jit_comp.o bpf_timed_may_goto.o
endif

arch/x86/net/bpf_jit_comp.c

View file
diff --git a/arch/x86/net/bpf_jit_comp.c b/arch/x86/net/bpf_jit_comp.c
index 72776dc..9e5fe2b 100644
--- a/arch/x86/net/bpf_jit_comp.c
+++ b/arch/x86/net/bpf_jit_comp.c
@@ -1250,8 +1250,8 @@ static void emit_st_r12(u8 **pprog, u32 size, u32 dst_reg, int off, int imm)
emit_st_index(pprog, size, dst_reg, X86_REG_R12, off, imm);
}
-static int emit_atomic(u8 **pprog, u8 atomic_op,
- u32 dst_reg, u32 src_reg, s16 off, u8 bpf_size)
+static int emit_atomic_rmw(u8 **pprog, u32 atomic_op,
+ u32 dst_reg, u32 src_reg, s16 off, u8 bpf_size)
{
u8 *prog = *pprog;
@@ -1291,8 +1291,9 @@ static int emit_atomic(u8 **pprog, u8 atomic_op,
return 0;
}
-static int emit_atomic_index(u8 **pprog, u8 atomic_op, u32 size,
- u32 dst_reg, u32 src_reg, u32 index_reg, int off)
+static int emit_atomic_rmw_index(u8 **pprog, u32 atomic_op, u32 size,
+ u32 dst_reg, u32 src_reg, u32 index_reg,
+ int off)
{
u8 *prog = *pprog;
@@ -1305,7 +1306,7 @@ static int emit_atomic_index(u8 **pprog, u8 atomic_op, u32 size,
EMIT1(add_3mod(0x48, dst_reg, src_reg, index_reg));
break;
default:
- pr_err("bpf_jit: 1 and 2 byte atomics are not supported\n");
+ pr_err("bpf_jit: 1- and 2-byte RMW atomics are not supported\n");
return -EFAULT;
}
@@ -1339,6 +1340,49 @@ static int emit_atomic_index(u8 **pprog, u8 atomic_op, u32 size,
return 0;
}
+static int emit_atomic_ld_st(u8 **pprog, u32 atomic_op, u32 dst_reg,
+ u32 src_reg, s16 off, u8 bpf_size)
+{
+ switch (atomic_op) {
+ case BPF_LOAD_ACQ:
+ /* dst_reg = smp_load_acquire(src_reg + off16) */
+ emit_ldx(pprog, bpf_size, dst_reg, src_reg, off);
+ break;
+ case BPF_STORE_REL:
+ /* smp_store_release(dst_reg + off16, src_reg) */
+ emit_stx(pprog, bpf_size, dst_reg, src_reg, off);
+ break;
+ default:
+ pr_err("bpf_jit: unknown atomic load/store opcode %02x\n",
+ atomic_op);
+ return -EFAULT;
+ }
+
+ return 0;
+}
+
+static int emit_atomic_ld_st_index(u8 **pprog, u32 atomic_op, u32 size,
+ u32 dst_reg, u32 src_reg, u32 index_reg,
+ int off)
+{
+ switch (atomic_op) {
+ case BPF_LOAD_ACQ:
+ /* dst_reg = smp_load_acquire(src_reg + idx_reg + off16) */
+ emit_ldx_index(pprog, size, dst_reg, src_reg, index_reg, off);
+ break;
+ case BPF_STORE_REL:
+ /* smp_store_release(dst_reg + idx_reg + off16, src_reg) */
+ emit_stx_index(pprog, size, dst_reg, src_reg, index_reg, off);
+ break;
+ default:
+ pr_err("bpf_jit: unknown atomic load/store opcode %02x\n",
+ atomic_op);
+ return -EFAULT;
+ }
+
+ return 0;
+}
+
#define DONT_CLEAR 1
bool ex_handler_bpf(const struct exception_table_entry *x, struct pt_regs *regs)
@@ -2121,6 +2165,13 @@ populate_extable:
}
break;
+ case BPF_STX | BPF_ATOMIC | BPF_B:
+ case BPF_STX | BPF_ATOMIC | BPF_H:
+ if (!bpf_atomic_is_load_store(insn)) {
+ pr_err("bpf_jit: 1- and 2-byte RMW atomics are not supported\n");
+ return -EFAULT;
+ }
+ fallthrough;
case BPF_STX | BPF_ATOMIC | BPF_W:
case BPF_STX | BPF_ATOMIC | BPF_DW:
if (insn->imm == (BPF_AND | BPF_FETCH) ||
@@ -2156,10 +2207,10 @@ populate_extable:
EMIT2(simple_alu_opcodes[BPF_OP(insn->imm)],
add_2reg(0xC0, AUX_REG, real_src_reg));
/* Attempt to swap in new value */
- err = emit_atomic(&prog, BPF_CMPXCHG,
- real_dst_reg, AUX_REG,
- insn->off,
- BPF_SIZE(insn->code));
+ err = emit_atomic_rmw(&prog, BPF_CMPXCHG,
+ real_dst_reg, AUX_REG,
+ insn->off,
+ BPF_SIZE(insn->code));
if (WARN_ON(err))
return err;
/*
@@ -2174,17 +2225,35 @@ populate_extable:
break;
}
- err = emit_atomic(&prog, insn->imm, dst_reg, src_reg,
- insn->off, BPF_SIZE(insn->code));
+ if (bpf_atomic_is_load_store(insn))
+ err = emit_atomic_ld_st(&prog, insn->imm, dst_reg, src_reg,
+ insn->off, BPF_SIZE(insn->code));
+ else
+ err = emit_atomic_rmw(&prog, insn->imm, dst_reg, src_reg,
+ insn->off, BPF_SIZE(insn->code));
if (err)
return err;
break;
+ case BPF_STX | BPF_PROBE_ATOMIC | BPF_B:
+ case BPF_STX | BPF_PROBE_ATOMIC | BPF_H:
+ if (!bpf_atomic_is_load_store(insn)) {
+ pr_err("bpf_jit: 1- and 2-byte RMW atomics are not supported\n");
+ return -EFAULT;
+ }
+ fallthrough;
case BPF_STX | BPF_PROBE_ATOMIC | BPF_W:
case BPF_STX | BPF_PROBE_ATOMIC | BPF_DW:
start_of_ldx = prog;
- err = emit_atomic_index(&prog, insn->imm, BPF_SIZE(insn->code),
- dst_reg, src_reg, X86_REG_R12, insn->off);
+
+ if (bpf_atomic_is_load_store(insn))
+ err = emit_atomic_ld_st_index(&prog, insn->imm,
+ BPF_SIZE(insn->code), dst_reg,
+ src_reg, X86_REG_R12, insn->off);
+ else
+ err = emit_atomic_rmw_index(&prog, insn->imm, BPF_SIZE(insn->code),
+ dst_reg, src_reg, X86_REG_R12,
+ insn->off);
if (err)
return err;
goto populate_extable;
@@ -3801,3 +3870,8 @@ u64 bpf_arch_uaddress_limit(void)
{
return 0;
}
+
+bool bpf_jit_supports_timed_may_goto(void)
+{
+ return true;
+}

arch/x86/net/bpf_timed_may_goto.S

View file
diff --git a/arch/x86/net/bpf_timed_may_goto.S b/arch/x86/net/bpf_timed_may_goto.S
new file mode 100644
index 0000000..54c690c
--- /dev/null
+++ b/arch/x86/net/bpf_timed_may_goto.S
@@ -0,0 +1,55 @@
+// SPDX-License-Identifier: GPL-2.0
+/* Copyright (c) 2025 Meta Platforms, Inc. and affiliates. */
+
+#include <linux/export.h>
+#include <linux/linkage.h>
+#include <asm/nospec-branch.h>
+

This diff is incomplete. Download the complete patch.

fs/bpf_fs_kfuncs.c

View file

This diff is incomplete. Download the complete patch.

include/linux/bpf-cgroup.h

View file

This diff is incomplete. Download the complete patch.

include/linux/bpf.h

View file

This diff is incomplete. Download the complete patch.

include/linux/bpf_lsm.h

View file

This diff is incomplete. Download the complete patch.

include/linux/bpf_verifier.h

View file

This diff is incomplete. Download the complete patch.

include/linux/btf.h

View file

This diff is incomplete. Download the complete patch.

include/linux/filter.h

View file

This diff is incomplete. Download the complete patch.

include/linux/lsm_hook_defs.h

View file

This diff is incomplete. Download the complete patch.

include/linux/mm.h

View file

This diff is incomplete. Download the complete patch.

include/linux/security.h

View file

This diff is incomplete. Download the complete patch.

include/uapi/linux/bpf.h

View file

This diff is incomplete. Download the complete patch.

include/uapi/linux/btf.h

View file

This diff is incomplete. Download the complete patch.

include/uapi/linux/xattr.h

View file

This diff is incomplete. Download the complete patch.

kernel/bpf/arena.c

View file

This diff is incomplete. Download the complete patch.

kernel/bpf/bpf_cgrp_storage.c

View file

This diff is incomplete. Download the complete patch.

kernel/bpf/bpf_iter.c

View file

This diff is incomplete. Download the complete patch.

kernel/bpf/bpf_lsm.c

View file

This diff is incomplete. Download the complete patch.

kernel/bpf/bpf_struct_ops.c

View file

This diff is incomplete. Download the complete patch.

kernel/bpf/btf.c

View file

This diff is incomplete. Download the complete patch.

kernel/bpf/cgroup.c

View file

This diff is incomplete. Download the complete patch.

kernel/bpf/core.c

View file

This diff is incomplete. Download the complete patch.

kernel/bpf/cpumask.c

View file

This diff is incomplete. Download the complete patch.

kernel/bpf/disasm.c

View file

This diff is incomplete. Download the complete patch.

kernel/bpf/hashtab.c

View file

This diff is incomplete. Download the complete patch.

kernel/bpf/helpers.c

View file

This diff is incomplete. Download the complete patch.

kernel/bpf/preload/bpf_preload_kern.c

View file

This diff is incomplete. Download the complete patch.

kernel/bpf/syscall.c

View file

This diff is incomplete. Download the complete patch.

kernel/bpf/verifier.c

View file

This diff is incomplete. Download the complete patch.

kernel/trace/bpf_trace.c

View file

This diff is incomplete. Download the complete patch.

mm/memory.c

View file

This diff is incomplete. Download the complete patch.

mm/nommu.c

View file

This diff is incomplete. Download the complete patch.

net/core/filter.c

View file

This diff is incomplete. Download the complete patch.

samples/bpf/Makefile

View file

This diff is incomplete. Download the complete patch.

scripts/Makefile.btf

View file

This diff is incomplete. Download the complete patch.

security/security.c

View file

This diff is incomplete. Download the complete patch.

security/selinux/hooks.c

View file

This diff is incomplete. Download the complete patch.

tools/bpf/bpftool/Makefile

View file

This diff is incomplete. Download the complete patch.

tools/bpf/bpftool/btf.c

View file

This diff is incomplete. Download the complete patch.

tools/bpf/bpftool/btf_dumper.c

View file

This diff is incomplete. Download the complete patch.

tools/bpf/bpftool/cgroup.c

View file

This diff is incomplete. Download the complete patch.

tools/bpf/bpftool/common.c

View file

This diff is incomplete. Download the complete patch.

tools/bpf/bpftool/gen.c

View file

This diff is incomplete. Download the complete patch.

tools/bpf/bpftool/jit_disasm.c

View file

This diff is incomplete. Download the complete patch.

tools/bpf/bpftool/link.c

View file

This diff is incomplete. Download the complete patch.

tools/bpf/bpftool/main.c

View file

This diff is incomplete. Download the complete patch.

tools/bpf/bpftool/map.c

View file

This diff is incomplete. Download the complete patch.

tools/bpf/bpftool/map_perf_ring.c

View file

This diff is incomplete. Download the complete patch.

tools/bpf/bpftool/net.c

View file

This diff is incomplete. Download the complete patch.

tools/bpf/bpftool/netlink_dumper.c

View file

This diff is incomplete. Download the complete patch.

tools/bpf/bpftool/prog.c

View file

This diff is incomplete. Download the complete patch.

tools/bpf/bpftool/tracelog.c

View file

This diff is incomplete. Download the complete patch.

tools/bpf/bpftool/xlated_dumper.c

View file

This diff is incomplete. Download the complete patch.

tools/bpf/runqslower/Makefile

View file

This diff is incomplete. Download the complete patch.

tools/include/uapi/linux/bpf.h

View file

This diff is incomplete. Download the complete patch.

tools/include/uapi/linux/btf.h

View file

This diff is incomplete. Download the complete patch.

tools/lib/bpf/bpf.c

View file

This diff is incomplete. Download the complete patch.

tools/lib/bpf/bpf.h

View file

This diff is incomplete. Download the complete patch.

tools/lib/bpf/btf.c

View file

This diff is incomplete. Download the complete patch.

tools/lib/bpf/btf.h

View file

This diff is incomplete. Download the complete patch.

tools/lib/bpf/btf_dump.c

View file

This diff is incomplete. Download the complete patch.

tools/lib/bpf/libbpf.c

View file

This diff is incomplete. Download the complete patch.

tools/lib/bpf/libbpf.h

View file

This diff is incomplete. Download the complete patch.

tools/lib/bpf/libbpf.map

View file

This diff is incomplete. Download the complete patch.

tools/lib/bpf/libbpf_internal.h

View file

This diff is incomplete. Download the complete patch.

tools/lib/bpf/linker.c

View file

This diff is incomplete. Download the complete patch.

tools/lib/bpf/relo_core.c

View file

This diff is incomplete. Download the complete patch.

tools/lib/bpf/str_error.c

View file

This diff is incomplete. Download the complete patch.

tools/lib/bpf/str_error.h

View file

This diff is incomplete. Download the complete patch.

tools/lib/bpf/usdt.bpf.h

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/DENYLIST.aarch64

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/Makefile

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/bpf_arena_spin_lock.h

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/bpf_atomic.h

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/bpf_experimental.h

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/bpf_kfuncs.h

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/cap_helpers.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/cap_helpers.h

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/network_helpers.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/network_helpers.h

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/prog_tests/align.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/prog_tests/arena_atomics.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/prog_tests/arena_spin_lock.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/prog_tests/bloom_filter_map.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/prog_tests/bpf_iter.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/prog_tests/bpf_nf.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/prog_tests/btf.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/prog_tests/btf_dump.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/prog_tests/cgroup_preorder.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/prog_tests/cgroup_v1v2.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/prog_tests/compute_live_registers.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/prog_tests/core_reloc.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/prog_tests/cpumask.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/prog_tests/dynptr.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/prog_tests/fd_array.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/prog_tests/fexit_noreturns.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/prog_tests/fs_kfuncs.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/prog_tests/kernel_flag.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/prog_tests/lwt_ip_encap.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/prog_tests/lwt_seg6local.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/prog_tests/netns_cookie.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/prog_tests/ns_current_pid_tgid.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/prog_tests/prepare.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/prog_tests/pro_epilogue.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/prog_tests/rcu_read_lock.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/prog_tests/read_vsyscall.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/prog_tests/setget_sockopt.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/prog_tests/spin_lock.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/prog_tests/summarization.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/prog_tests/tailcalls.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/prog_tests/tc_links.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/prog_tests/tc_opts.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/prog_tests/test_struct_ops_kptr_return.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/prog_tests/test_struct_ops_refcounted.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/prog_tests/test_tunnel.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/prog_tests/test_veristat.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/prog_tests/test_xdp_veth.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/prog_tests/token.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/prog_tests/usdt.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/prog_tests/verifier.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/prog_tests/xdp_vlan.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/progs/arena_atomics.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/progs/arena_spin_lock.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/progs/bpf_iter_tasks.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/progs/bpf_misc.h

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/progs/bpf_tracing_net.h

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/progs/btf__core_reloc_arrays___err_bad_signed_arr_elem_sz.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/progs/cgroup_preorder.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/progs/compute_live_registers.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/progs/connect4_dropper.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/progs/core_reloc_types.h

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/progs/cpumask_common.h

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/progs/cpumask_failure.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/progs/cpumask_success.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/progs/dynptr_success.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/progs/fexit_noreturns.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/progs/irq.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/progs/iters.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/progs/netns_cookie_prog.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/progs/preempt_lock.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/progs/prepare.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/progs/priv_freplace_prog.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/progs/priv_prog.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/progs/pro_epilogue_with_kfunc.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/progs/rcu_read_lock.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/progs/read_vsyscall.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/progs/set_global_vars.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/progs/strncmp_bench.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/progs/struct_ops_kptr_return.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/progs/struct_ops_kptr_return_fail__invalid_scalar.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/progs/struct_ops_kptr_return_fail__local_kptr.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/progs/struct_ops_kptr_return_fail__nonzero_offset.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/progs/struct_ops_kptr_return_fail__wrong_type.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/progs/struct_ops_refcounted.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/progs/struct_ops_refcounted_fail__global_subprog.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/progs/struct_ops_refcounted_fail__ref_leak.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/progs/struct_ops_refcounted_fail__tail_call.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/progs/summarization.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/progs/summarization_freplace.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/progs/test_cgroup1_hierarchy.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/progs/test_core_reloc_arrays.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/progs/test_get_xattr.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/progs/test_kernel_flag.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/progs/test_kfunc_dynptr_param.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/progs/test_lookup_key.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/progs/test_ptr_untrusted.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/progs/test_select_reuseport_kern.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/progs/test_set_remove_xattr.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/progs/test_spin_lock_fail.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/progs/test_task_under_cgroup.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/progs/test_usdt.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/progs/test_verify_pkcs7_sig.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/progs/test_xdp_vlan.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/progs/verifier_bpf_fastcall.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/progs/verifier_gotol.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/progs/verifier_iterating_callbacks.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/progs/verifier_load_acquire.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/progs/verifier_may_goto_1.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/progs/verifier_precision.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/progs/verifier_stack_ptr.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/progs/verifier_store_release.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/progs/xdp_redirect_map.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/progs/xdp_redirect_multi_kern.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/test_btf.h

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/test_kmods/bpf_testmod.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/test_kmods/bpf_testmod.h

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/test_loader.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/test_lwt_ip_encap.sh

View before deletion

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/test_lwt_seg6local.sh

View before deletion

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/test_maps.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/test_progs.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/test_progs.h

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/test_tunnel.sh

View before deletion

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/test_xdp_redirect_multi.sh

View before deletion

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/test_xdp_vlan.sh

View before deletion

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/test_xdp_vlan_mode_generic.sh

View before deletion

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/test_xdp_vlan_mode_native.sh

View before deletion

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/veristat.c

View file

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/with_addr.sh

View before deletion

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/with_tunnels.sh

View before deletion

This diff is incomplete. Download the complete patch.

tools/testing/selftests/bpf/xdp_redirect_multi.c

View before deletion

This diff is incomplete. Download the complete patch.