1. 13 1月, 2022 3 次提交
  2. 07 1月, 2022 1 次提交
  3. 06 1月, 2022 5 次提交
  4. 29 12月, 2021 3 次提交
  5. 24 12月, 2021 1 次提交
  6. 18 12月, 2021 1 次提交
    • A
      libbpf: Rework feature-probing APIs · 878d8def
      Andrii Nakryiko 提交于
      Create three extensible alternatives to inconsistently named
      feature-probing APIs:
      
        - libbpf_probe_bpf_prog_type() instead of bpf_probe_prog_type();
        - libbpf_probe_bpf_map_type() instead of bpf_probe_map_type();
        - libbpf_probe_bpf_helper() instead of bpf_probe_helper().
      
      Set up return values such that libbpf can report errors (e.g., if some
      combination of input arguments isn't possible to validate, etc), in
      addition to whether the feature is supported (return value 1) or not
      supported (return value 0).
      
      Also schedule deprecation of those three APIs. Also schedule deprecation
      of bpf_probe_large_insn_limit().
      
      Also fix all the existing detection logic for various program and map
      types that never worked:
      
        - BPF_PROG_TYPE_LIRC_MODE2;
        - BPF_PROG_TYPE_TRACING;
        - BPF_PROG_TYPE_LSM;
        - BPF_PROG_TYPE_EXT;
        - BPF_PROG_TYPE_SYSCALL;
        - BPF_PROG_TYPE_STRUCT_OPS;
        - BPF_MAP_TYPE_STRUCT_OPS;
        - BPF_MAP_TYPE_BLOOM_FILTER.
      
      Above prog/map types needed special setups and detection logic to work.
      Subsequent patch adds selftests that will make sure that all the
      detection logic keeps working for all current and future program and map
      types, avoiding otherwise inevitable bit rot.
      
        [0] Closes: https://github.com/libbpf/libbpf/issues/312Signed-off-by: NAndrii Nakryiko <andrii@kernel.org>
      Signed-off-by: NDaniel Borkmann <daniel@iogearbox.net>
      Acked-by: NDave Marchevsky <davemarchevsky@fb.com>
      Cc: Julia Kartseva <hex@fb.com>
      Link: https://lore.kernel.org/bpf/20211217171202.3352835-2-andrii@kernel.org
      878d8def
  7. 17 12月, 2021 1 次提交
  8. 15 12月, 2021 3 次提交
  9. 14 12月, 2021 3 次提交
  10. 13 12月, 2021 1 次提交
    • A
      libbpf: Don't validate TYPE_ID relo's original imm value · 4b443bc1
      Andrii Nakryiko 提交于
      During linking, type IDs in the resulting linked BPF object file can
      change, and so ldimm64 instructions corresponding to
      BPF_CORE_TYPE_ID_TARGET and BPF_CORE_TYPE_ID_LOCAL CO-RE relos can get
      their imm value out of sync with actual CO-RE relocation information
      that's updated by BPF linker properly during linking process.
      
      We could teach BPF linker to adjust such instructions, but it feels
      a bit too much for linker to re-implement good chunk of
      bpf_core_patch_insns logic just for this. This is a redundant safety
      check for TYPE_ID relocations, as the real validation is in matching
      CO-RE specs, so if that works fine, it's very unlikely that there is
      something wrong with the instruction itself.
      
      So, instead, teach libbpf (and kernel) to ignore insn->imm for
      BPF_CORE_TYPE_ID_TARGET and BPF_CORE_TYPE_ID_LOCAL relos.
      Signed-off-by: NAndrii Nakryiko <andrii@kernel.org>
      Signed-off-by: NAlexei Starovoitov <ast@kernel.org>
      Link: https://lore.kernel.org/bpf/20211213010706.100231-1-andrii@kernel.org
      4b443bc1
  11. 12 12月, 2021 1 次提交
    • A
      libbpf: Fix gen_loader assumption on number of programs. · 259172bb
      Alexei Starovoitov 提交于
      libbpf's obj->nr_programs includes static and global functions. That number
      could be higher than the actual number of bpf programs going be loaded by
      gen_loader. Passing larger nr_programs to bpf_gen__init() doesn't hurt. Those
      exra stack slots will stay as zero. bpf_gen__finish() needs to check that
      actual number of progs that gen_loader saw is less than or equal to
      obj->nr_programs.
      
      Fixes: ba05fd36 ("libbpf: Perform map fd cleanup for gen_loader in case of error")
      Signed-off-by: NAlexei Starovoitov <ast@kernel.org>
      259172bb
  12. 11 12月, 2021 10 次提交
  13. 07 12月, 2021 2 次提交
  14. 04 12月, 2021 1 次提交
  15. 03 12月, 2021 4 次提交