Fuzz introspector
For issues and ideas: https://github.com/ossf/fuzz-introspector/issues

Project functions overview

The following table shows data about each function in the project. The functions included in this table correspond to all functions that exist in the executables of the fuzzers. As such, there may be functions that are from third-party libraries.

For further technical details on the meaning of columns in the below table, please see the Glossary .

Func name Functions filename Args Function call depth Reached by Fuzzers Runtime reached by Fuzzers Combined reached by Fuzzers Fuzzers runtime hit Func lines hit % I Count BB Count Cyclomatic complexity Functions reached Reached by functions Accumulated cyclomatic complexity Undiscovered complexity

Fuzzer details

Fuzzer: bpf-object-fuzzer

Call tree

The calltree shows the control flow of the fuzzer. This is overlaid with coverage information to display how much of the potential code a fuzzer can reach is in fact covered at runtime. In the following there is a link to a detailed calltree visualisation as well as a bitmap showing a high-level view of the calltree. For further information about these topics please see the glossary for full calltree and calltree overview

Call tree overview bitmap:

The distribution of callsites in terms of coloring is
Color Runtime hitcount Callsite count Percentage
red 0 352 28.1%
gold [1:9] 59 4.71%
yellow [10:29] 53 4.23%
greenyellow [30:49] 13 1.03%
lawngreen 50+ 775 61.9%
All colors 1252 100

Fuzz blockers

The following nodes represent call sites where fuzz blockers occur.

Amount of callsites blocked Calltree index Parent function Callsite Largest blocked function
142 796 create_placeholder_fd call site: 00796 parse_btf_map_def
27 1108 bpf_object__collect_map_relos call site: 01108 bpf_object__find_map_by_name
21 1072 bpf_object__collect_st_ops_relos call site: 01072 resolve_func_ptr
7 643 btf__align_of call site: 00643 determine_ptr_size
6 561 btf__add_var call site: 00561 btf__find_str
5 942 btf__find_by_name call site: 00942 init_arena_map_data
4 43 get_ubuntu_kernel_version call site: 00043 KERNEL_VERSION
4 64 bpf_object__elf_init call site: 00064 pr_warn
4 553 btf_ensure_modifiable call site: 00553 strset__free
4 633 bpf_object__collect_externs call site: 00633 btf_type_by_id
4 779 btf_is_struct call site: 00779 bpf_object__add_map
4 788 create_placeholder_fd call site: 00788 dup_good_fd

Runtime coverage analysis

Covered functions
289
Functions that are reachable but not covered
104
Reachable functions
319
Percentage of reachable functions covered
67.4%
NB: The sum of covered functions and functions that are reachable but not covered need not be equal to Reachable functions . This is because the reachability analysis is an approximation and thus at runtime some functions may be covered that are not included in the reachability analysis. This is a limitation of our static analysis capabilities.
Function name source code lines source lines hit percentage hit

Files reached

filename functions hit
fuzz/bpf-object-fuzzer.c 6
src/libbpf.c 219
src/libbpf_internal.h 14
include/linux/err.h 1
src/libbpf_probes.c 10
src/btf.c 97
src/btf.h 10
src/skel_internal.h 1
src/strset.c 17
src/hashmap.c 6
src/relo_core.c 7
src/usdt.c 2
src/gen_loader.c 1

Analyses and suggestions

Optimal target analysis

Remaining optimal interesting functions

The following table shows a list of functions that are optimal targets. Optimal targets are identified by finding the functions that in combination, yield a high code coverage.

Func name Functions filename Arg count Args Function depth hitcount instr count bb count cyclomatic complexity Reachable functions Incoming references total cyclomatic complexity Unreached complexity
bpf_object__load_skeleton /src/libbpf/src/libbpf.c 1 ['struct bpf_object_skeleton*'] 16 0 14 4 5 539 0 2005 1649
attach_usdt /src/libbpf/src/libbpf.c 3 ['struct bpf_program*', 'long', 'struct bpf_link**'] 9 0 18 3 2 187 0 551 487
bpf_linker__add_buf /src/libbpf/src/linker.c 4 ['struct bpf_linker*', 'void*', 'size_t', 'struct bpf_linker_file_opts*'] 14 0 28 5 6 217 0 795 438
bpf_linker__finalize /src/libbpf/src/linker.c 1 ['struct bpf_linker*'] 11 0 41 9 12 187 0 547 349
btf_dump_dump_type_data /src/libbpf/src/btf_dump.c 7 ['struct btf_dump*', 'char*', 'struct btf_type*', '__u32', 'void*', '__u8', '__u8'] 16 0 67 26 21 115 6 327 260
bpf_tc_hook_destroy /src/libbpf/src/netlink.c 1 ['struct bpf_tc_hook*'] 8 0 15 8 4 48 0 111 106
btf_dump__dump_type /src/libbpf/src/btf_dump.c 2 ['struct btf_dump*', '__u32'] 10 0 13 4 4 92 0 260 81
btf__distill_base /src/libbpf/src/btf.c 3 ['struct btf*', 'struct btf**', 'struct btf**'] 11 0 71 12 24 85 0 217 79
attach_tracing_multi /src/libbpf/src/libbpf.c 3 ['struct bpf_program*', 'long', 'struct bpf_link**'] 14 0 25 6 9 197 0 623 74
attach_kprobe_multi /src/libbpf/src/libbpf.c 3 ['struct bpf_program*', 'long', 'struct bpf_link**'] 6 0 17 4 4 60 0 169 66

Implementing fuzzers that target the above functions will improve reachability such that it becomes:

Functions statically reachable by fuzzers
50.0%
856 / 1719
Cyclomatic complexity statically reachable by fuzzers
75.0%
4595 / 6161

All functions overview

If you implement fuzzers for these functions, the status of all functions in the project will be:

Func name Functions filename Args Function call depth Reached by Fuzzers Runtime reached by Fuzzers Combined reached by Fuzzers Fuzzers runtime hit Func lines hit % I Count BB Count Cyclomatic complexity Functions reached Reached by functions Accumulated cyclomatic complexity Undiscovered complexity

Fuzz driver synthesis

New fuzzers

The below fuzzers are templates and suggestions for how to target the set of optimal functions above

libbpf.c

Target file: /src/libbpf/src/libbpf.c
Target functions: bpf_object__load_skeleton, attach_usdt, attach_tracing_multi, attach_kprobe_multi
#include "ada_fuzz_header.h"

int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
  af_safe_gb_init(data, size);

  /* target bpf_object__load_skeleton */
  structbpf_object_skeleton* new_var0 = calloc(sizeof(structbpf_object_skeleton), 1);
  bpf_object__load_skeleton(new_var0);

  /* target attach_usdt */
  structbpf_program* new_var1 = calloc(sizeof(structbpf_program), 1);
  UNKNOWN_TYPE unknown_2;
  UNKNOWN_TYPE unknown_3;
  attach_usdt(new_var1, unknown_2, unknown_3);

  /* target attach_tracing_multi */
  structbpf_program* new_var22 = calloc(sizeof(structbpf_program), 1);
  UNKNOWN_TYPE unknown_23;
  UNKNOWN_TYPE unknown_24;
  attach_tracing_multi(new_var22, unknown_23, unknown_24);

  /* target attach_kprobe_multi */
  structbpf_program* new_var25 = calloc(sizeof(structbpf_program), 1);
  UNKNOWN_TYPE unknown_26;
  UNKNOWN_TYPE unknown_27;
  attach_kprobe_multi(new_var25, unknown_26, unknown_27);

  af_safe_gb_cleanup();
}

linker.c

Target file: /src/libbpf/src/linker.c
Target functions: bpf_linker__add_buf, bpf_linker__finalize
#include "ada_fuzz_header.h"

int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
  af_safe_gb_init(data, size);

  /* target bpf_linker__add_buf */
  structbpf_linker* new_var4 = calloc(sizeof(structbpf_linker), 1);
  UNKNOWN_TYPE unknown_5;
  UNKNOWN_TYPE unknown_6;
  structbpf_linker_file_opts* new_var7 = calloc(sizeof(structbpf_linker_file_opts), 1);
  bpf_linker__add_buf(new_var4, unknown_5, unknown_6, new_var7);

  /* target bpf_linker__finalize */
  structbpf_linker* new_var8 = calloc(sizeof(structbpf_linker), 1);
  bpf_linker__finalize(new_var8);

  af_safe_gb_cleanup();
}

btf_dump.c

Target file: /src/libbpf/src/btf_dump.c
Target functions: btf_dump_dump_type_data, btf_dump__dump_type
#include "ada_fuzz_header.h"

int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
  af_safe_gb_init(data, size);

  /* target btf_dump_dump_type_data */
  structbtf_dump* new_var9 = calloc(sizeof(structbtf_dump), 1);
  char *new_var10 = ada_safe_get_char_p();
  structbtf_type* new_var11 = calloc(sizeof(structbtf_type), 1);
  UNKNOWN_TYPE unknown_12;
  UNKNOWN_TYPE unknown_13;
  UNKNOWN_TYPE unknown_14;
  UNKNOWN_TYPE unknown_15;
  btf_dump_dump_type_data(new_var9, new_var10, new_var11, unknown_12, unknown_13, unknown_14, unknown_15);

  /* target btf_dump__dump_type */
  structbtf_dump* new_var17 = calloc(sizeof(structbtf_dump), 1);
  UNKNOWN_TYPE unknown_18;
  btf_dump__dump_type(new_var17, unknown_18);

  af_safe_gb_cleanup();
}

netlink.c

Target file: /src/libbpf/src/netlink.c
Target functions: bpf_tc_hook_destroy
#include "ada_fuzz_header.h"

int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
  af_safe_gb_init(data, size);

  /* target bpf_tc_hook_destroy */
  structbpf_tc_hook* new_var16 = calloc(sizeof(structbpf_tc_hook), 1);
  bpf_tc_hook_destroy(new_var16);

  af_safe_gb_cleanup();
}

btf.c

Target file: /src/libbpf/src/btf.c
Target functions: btf__distill_base
#include "ada_fuzz_header.h"

int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
  af_safe_gb_init(data, size);

  /* target btf__distill_base */
  structbtf* new_var19 = calloc(sizeof(structbtf), 1);
  UNKNOWN_TYPE unknown_20;
  UNKNOWN_TYPE unknown_21;
  btf__distill_base(new_var19, unknown_20, unknown_21);

  af_safe_gb_cleanup();
}

Files and Directories in report

This section shows which files and directories are considered in this report. The main reason for showing this is fuzz introspector may include more code in the reasoning than is desired. This section helps identify if too many files/directories are included, e.g. third party code, which may be irrelevant for the threat model. In the event too much is included, fuzz introspector supports a configuration file that can exclude data from the report. See the following link for more information on how to create a config file: link

Files in report

Source file Reached by Covered by
/src/libbpf/src/features.c [] []
/src/libbpf/src/libbpf.h [] []
/src/libbpf/src/bpf_core_read.h [] []
/src/libbpf/src/bpf_prog_linfo.c [] []
/src/libbpf/include/linux/compiler.h [] []
/src/libbpf/src/zip.c [] []
/src/libbpf/include/uapi/linux/perf_event.h [] []
/src/libbpf/src/libbpf_probes.c ['bpf-object-fuzzer'] ['bpf-object-fuzzer']
/src/libbpf/src/btf.h ['bpf-object-fuzzer'] ['bpf-object-fuzzer']
/src/libbpf/src/hashmap.c ['bpf-object-fuzzer'] ['bpf-object-fuzzer']
/src/libbpf/src/ringbuf.c [] []
/src/libbpf/src/usdt.bpf.h [] []
/src/libbpf/include/uapi/linux/if_link.h [] []
/src/libbpf/src/relo_core.c ['bpf-object-fuzzer'] []
/src/libbpf/include/uapi/linux/pkt_sched.h [] []
/src/libbpf/src/bpf_helpers.h [] []
/src/libbpf/include/linux/overflow.h [] []
/src/libbpf/src/libbpf.c ['bpf-object-fuzzer'] ['bpf-object-fuzzer']
/src/libbpf/src/hashmap.h [] []
/src/libbpf/include/uapi/linux/netlink.h [] []
/src/libbpf/src/linker.c [] []
/src/libbpf/src/libbpf_internal.h ['bpf-object-fuzzer'] ['bpf-object-fuzzer']
/src/libbpf/src/strset.c ['bpf-object-fuzzer'] ['bpf-object-fuzzer']
/src/libbpf/src/nlattr.h [] []
/src/libbpf/src/libbpf_utils.c [] []
/src/libbpf/src/skel_internal.h ['bpf-object-fuzzer'] []
/src/libbpf/include/linux/list.h [] []
/src/libbpf/src/btf.c ['bpf-object-fuzzer'] ['bpf-object-fuzzer']
/src/libbpf/src/usdt.c ['bpf-object-fuzzer'] ['bpf-object-fuzzer']
/src/libbpf/src/nlattr.c [] []
/src/libbpf/include/linux/filter.h [] []
/src/libbpf/include/linux/err.h ['bpf-object-fuzzer'] ['bpf-object-fuzzer']
/src/libbpf/src/bpf_endian.h [] []
/src/libbpf/include/uapi/linux/btf.h [] []
/src/libbpf/src/btf_relocate.c [] []
/src/libbpf/src/btf_iter.c [] []
/src/libbpf/include/linux/kernel.h [] []
/src/libbpf/src/btf_dump.c [] []
/src/libbpf/src/elf.c [] []
/src/libbpf/src/libbpf_common.h [] []
/src/libbpf/include/uapi/linux/bpf_common.h [] []
/src/libbpf/src/bpf_tracing.h [] []
/src/libbpf/src/gen_loader.c ['bpf-object-fuzzer'] ['bpf-object-fuzzer']
/src/libbpf/include/uapi/linux/stddef.h [] []
/src/libbpf/src/netlink.c [] []
/src/libbpf/include/linux/ring_buffer.h [] []
/src/libbpf/fuzz/bpf-object-fuzzer.c ['bpf-object-fuzzer'] ['bpf-object-fuzzer']
/src/libbpf/include/uapi/linux/pkt_cls.h [] []
/src/libbpf/include/uapi/linux/bpf.h [] []
/src/libbpf/src/bpf.c [] []

Directories in report

Directory
/src/libbpf/fuzz/
/src/libbpf/src/
/src/libbpf/include/linux/
/src/libbpf/include/uapi/linux/

Sink analyser for CWEs

This section contains multiple tables, each table contains a list of sink functions/methods found in the project for one of the CWE supported by the sink analyser, together with information like which fuzzers statically reach the sink functions/methods and possible call path to that sink functions/methods if it is not statically reached by any fuzzers. Column 1 is the function/method name of the sink functions/methods found in the project. Column 2 lists all fuzzers (or no fuzzers at all) that have covered that particular function method statically. Column 3 shows a list of possible call paths to reach the specific function/method call if none of the fuzzers cover the target function/method calls. Lastly, column 4 shows possible fuzzer blockers that prevent an existing fuzzer from reaching the target sink functions/methods dynamically.

Sink functions/methods found for CWE787

Target sink Reached by fuzzer Function call path Possible branch blockers
calloc ['bpf-object-fuzzer'] N/A
Blocker function Arguments type Return type Constants touched
attach_usdt
in /src/libbpf/src/libbpf.c:13405
['struct bpf_program*', 'long', 'struct bpf_link**'] int []
ring_buffer__new
in /src/libbpf/src/ringbuf.c:189
['int', 'ring_buffer_sample_fn', 'void*', 'struct ring_buffer_opts*'] struct ring_buffer []
user_ring_buffer__new
in /src/libbpf/src/ringbuf.c:517
['int', 'struct user_ring_buffer_opts*'] struct user_ring_buffer []
attach_uprobe_multi
in /src/libbpf/src/libbpf.c:12498
['struct bpf_program*', 'long', 'struct bpf_link**'] int []
btf__parse_elf
in /src/libbpf/src/btf.c:1549
['char*', 'struct btf_ext**'] struct btf []
btf__parse_elf_split
in /src/libbpf/src/btf.c:1554
['char*', 'struct btf*'] struct btf []
bpf_object__load_skeleton
in /src/libbpf/src/libbpf.c:15024
['struct bpf_object_skeleton*'] int []
bpf_object__prepare
in /src/libbpf/src/libbpf.c:9128
['struct bpf_object*'] int []
attach_tracing_multi
in /src/libbpf/src/libbpf.c:12752
['struct bpf_program*', 'long', 'struct bpf_link**'] int []
bpf_program__set_attach_target
in /src/libbpf/src/libbpf.c:14699
['struct bpf_program*', 'int', 'char*'] int []
libbpf_find_vmlinux_btf_id
in /src/libbpf/src/libbpf.c:10611
['char*', 'enum bpf_attach_type'] int []
btf__load_module_btf
in /src/libbpf/src/btf.c:5833
['char*', 'struct btf*'] struct btf []
bpf_prog_linfo__new
in /src/libbpf/src/bpf_prog_linfo.c:100
['struct bpf_prog_info*'] struct bpf_prog_linfo []
btf_dump__new
in /src/libbpf/src/btf_dump.c:149
['struct btf*', 'btf_dump_printf_fn_t', 'void*', 'struct btf_dump_opts*'] struct btf_dump []
hashmap_grow
in /src/libbpf/src/hashmap.c:101
['struct hashmap*'] int []
bpf_object__open
in /src/libbpf/src/libbpf.c:8538
['char*'] struct bpf_object []
init_struct_ops_maps
in /src/libbpf/src/libbpf.c:1392
['struct bpf_object*', 'char*', 'int', 'Elf_Data*'] int []
bpf_object__gen_loader
in /src/libbpf/src/libbpf.c:9670
['struct bpf_object*', 'struct gen_loader_opts*'] int []
bpf_link__open
in /src/libbpf/src/libbpf.c:11393
['char*'] struct bpf_link []
bpf_program__attach_perf_event
in /src/libbpf/src/libbpf.c:11594
['struct bpf_program*', 'int'] struct bpf_link []
bpf_program__attach_kprobe
in /src/libbpf/src/libbpf.c:12007
['struct bpf_program*', 'bool', 'char*'] struct bpf_link []
attach_ksyscall
in /src/libbpf/src/libbpf.c:12420
['struct bpf_program*', 'long', 'struct bpf_link**'] int []
attach_kprobe
in /src/libbpf/src/libbpf.c:12376
['struct bpf_program*', 'long', 'struct bpf_link**'] int []
attach_uprobe
in /src/libbpf/src/libbpf.c:13287
['struct bpf_program*', 'long', 'struct bpf_link**'] int []
bpf_program__attach_uprobe
in /src/libbpf/src/libbpf.c:13342
['struct bpf_program*', 'bool', 'pid_t', 'char*', 'size_t'] struct bpf_link []
attach_tp
in /src/libbpf/src/libbpf.c:13553
['struct bpf_program*', 'long', 'struct bpf_link**'] int []
attach_kprobe_multi
in /src/libbpf/src/libbpf.c:12441
['struct bpf_program*', 'long', 'struct bpf_link**'] int []
attach_kprobe_session
in /src/libbpf/src/libbpf.c:12472
['struct bpf_program*', 'long', 'struct bpf_link**'] int []
attach_raw_tp
in /src/libbpf/src/libbpf.c:13635
['struct bpf_program*', 'long', 'struct bpf_link**'] int []
attach_trace
in /src/libbpf/src/libbpf.c:13713
['struct bpf_program*', 'long', 'struct bpf_link**'] int []
bpf_program__attach_freplace
in /src/libbpf/src/libbpf.c:13880
['struct bpf_program*', 'int', 'char*'] struct bpf_link []
bpf_program__attach_trace_opts
in /src/libbpf/src/libbpf.c:13702
['struct bpf_program*', 'struct bpf_trace_opts*'] struct bpf_link []
attach_lsm
in /src/libbpf/src/libbpf.c:13719
['struct bpf_program*', 'long', 'struct bpf_link**'] int []
bpf_program__attach_cgroup
in /src/libbpf/src/libbpf.c:13759
['struct bpf_program*', 'int'] struct bpf_link []
bpf_program__attach_netns
in /src/libbpf/src/libbpf.c:13765
['struct bpf_program*', 'int'] struct bpf_link []
bpf_program__attach_sockmap
in /src/libbpf/src/libbpf.c:13771
['struct bpf_program*', 'int'] struct bpf_link []
bpf_program__attach_xdp
in /src/libbpf/src/libbpf.c:13777
['struct bpf_program*', 'int'] struct bpf_link []
bpf_program__attach_cgroup_opts
in /src/libbpf/src/libbpf.c:13783
['struct bpf_program*', 'int', 'struct bpf_cgroup_opts*'] struct bpf_link []
bpf_program__attach_tcx
in /src/libbpf/src/libbpf.c:13811
['struct bpf_program*', 'int', 'struct bpf_tcx_opts*'] struct bpf_link []
bpf_program__attach_netkit
in /src/libbpf/src/libbpf.c:13846
['struct bpf_program*', 'int', 'struct bpf_netkit_opts*'] struct bpf_link []
attach_iter
in /src/libbpf/src/libbpf.c:13956
['struct bpf_program*', 'long', 'struct bpf_link**'] int []
bpf_program__attach_netfilter
in /src/libbpf/src/libbpf.c:13962
['struct bpf_program*', 'struct bpf_netfilter_opts*'] struct bpf_link []
bpf_object__attach_skeleton
in /src/libbpf/src/libbpf.c:15050
['struct bpf_object_skeleton*'] int []
perf_buffer__new
in /src/libbpf/src/libbpf.c:14326
['int', 'size_t', 'perf_buffer_sample_fn', 'perf_buffer_lost_fn', 'void*', 'struct perf_buffer_opts*'] struct perf_buffer []
perf_buffer__new_raw
in /src/libbpf/src/libbpf.c:14359
['int', 'size_t', 'struct perf_event_attr*', 'perf_buffer_event_fn', 'void*', 'struct perf_buffer_raw_opts*'] struct perf_buffer []
btf__distill_base
in /src/libbpf/src/btf.c:6124
['struct btf*', 'struct btf**', 'struct btf**'] int []
bpf_linker__new
in /src/libbpf/src/linker.c:227
['char*', 'struct bpf_linker_opts*'] struct bpf_linker []
bpf_linker__new_fd
in /src/libbpf/src/linker.c:269
['int', 'struct bpf_linker_opts*'] struct bpf_linker []
btf__new_empty_opts
in /src/libbpf/src/btf.c:1292
['struct btf_new_opts*'] struct btf []
bpf_linker__add_file
in /src/libbpf/src/linker.c:518
['struct bpf_linker*', 'char*', 'struct bpf_linker_file_opts*'] int []
bpf_linker__add_fd
in /src/libbpf/src/linker.c:541
['struct bpf_linker*', 'int', 'struct bpf_linker_file_opts*'] int []
bpf_linker__add_buf
in /src/libbpf/src/linker.c:561
['struct bpf_linker*', 'void*', 'size_t', 'struct bpf_linker_file_opts*'] int []
btf_new
in /src/libbpf/src/btf.c:1300
['void*', '__u32', 'struct btf*', 'bool'] struct btf []
btf__parse_raw
in /src/libbpf/src/btf.c:1622
['char*'] struct btf []
btf__parse_raw_split
in /src/libbpf/src/btf.c:1627
['char*', 'struct btf*'] struct btf []
libbpf_prepare_prog_load
in /src/libbpf/src/libbpf.c:7835
['struct bpf_program*', 'struct bpf_prog_load_opts*', 'long'] int []
btf__load_from_kernel_by_id
in /src/libbpf/src/btf.c:1973
['__u32'] struct btf []
btf__load_into_kernel
in /src/libbpf/src/btf.c:1773
['struct btf*'] int []
bpf_linker__finalize
in /src/libbpf/src/linker.c:2752
['struct bpf_linker*'] int []
btf__permute
in /src/libbpf/src/btf.c:6269
['struct btf*', '__u32*', '__u32', 'struct btf_permute_opts*'] int []
skel_alloc
in /src/libbpf/src/skel_internal.h:175
['size_t'] void []
btf__add_btf
in /src/libbpf/src/btf.c:2243
['struct btf*', 'struct btf*'] int []
btf__add_str
in /src/libbpf/src/btf.c:2094
['struct btf*', 'char*'] int []
btf__add_fwd
in /src/libbpf/src/btf.c:2901
['struct btf*', 'char*', 'enum btf_fwd_kind'] int []
btf__add_typedef
in /src/libbpf/src/btf.c:2937
['struct btf*', 'char*', 'int'] int []
btf__add_volatile
in /src/libbpf/src/btf.c:2952
['struct btf*', 'int'] int []
btf__add_const
in /src/libbpf/src/btf.c:2964
['struct btf*', 'int'] int []
btf__add_restrict
in /src/libbpf/src/btf.c:2976
['struct btf*', 'int'] int []
btf__add_type_tag
in /src/libbpf/src/btf.c:2989
['struct btf*', 'char*', 'int'] int []
btf__add_type_attr
in /src/libbpf/src/btf.c:3006
['struct btf*', 'char*', 'int'] int []
btf__add_union
in /src/libbpf/src/btf.c:2623
['struct btf*', 'char*', '__u32'] int []
btf__add_enum64
in /src/libbpf/src/btf.c:2831
['struct btf*', 'char*', '__u32', 'bool'] int []
btf__add_decl_attr
in /src/libbpf/src/btf.c:3341
['struct btf*', 'char*', 'int', 'int'] int []
strs_dedup_remap_str_off
in /src/libbpf/src/btf.c:4171
['__u32*', 'void*'] int []
bpf_map__set_value_size
in /src/libbpf/src/libbpf.c:10970
['struct bpf_map*', '__u32'] int []

Sink functions/methods found for CWE416

Target sink Reached by fuzzer Function call path Possible branch blockers
free ['bpf-object-fuzzer'] N/A
Blocker function Arguments type Return type Constants touched
bpf_object__open
in /src/libbpf/src/libbpf.c:8538
['char*'] struct bpf_object []
usdt_manager_free
in /src/libbpf/src/usdt.c:315
['struct usdt_manager*'] void []
attach_usdt
in /src/libbpf/src/libbpf.c:13405
['struct bpf_program*', 'long', 'struct bpf_link**'] int []
bpf_link_usdt_dealloc
in /src/libbpf/src/usdt.c:942
['struct bpf_link*'] void []
ring_buffer__new
in /src/libbpf/src/ringbuf.c:189
['int', 'ring_buffer_sample_fn', 'void*', 'struct ring_buffer_opts*'] struct ring_buffer []
user_ring_buffer__new
in /src/libbpf/src/ringbuf.c:517
['int', 'struct user_ring_buffer_opts*'] struct user_ring_buffer []
attach_uprobe_multi
in /src/libbpf/src/libbpf.c:12498
['struct bpf_program*', 'long', 'struct bpf_link**'] int []
btf__parse_elf
in /src/libbpf/src/btf.c:1549
['char*', 'struct btf_ext**'] struct btf []
btf__parse_elf_split
in /src/libbpf/src/btf.c:1554
['char*', 'struct btf*'] struct btf []
bpf_object__load_skeleton
in /src/libbpf/src/libbpf.c:15024
['struct bpf_object_skeleton*'] int []
bpf_object__prepare
in /src/libbpf/src/libbpf.c:9128
['struct bpf_object*'] int []
attach_tracing_multi
in /src/libbpf/src/libbpf.c:12752
['struct bpf_program*', 'long', 'struct bpf_link**'] int []
bpf_program__set_attach_target
in /src/libbpf/src/libbpf.c:14699
['struct bpf_program*', 'int', 'char*'] int []
libbpf_find_vmlinux_btf_id
in /src/libbpf/src/libbpf.c:10611
['char*', 'enum bpf_attach_type'] int []
btf__load_module_btf
in /src/libbpf/src/btf.c:5833
['char*', 'struct btf*'] struct btf []
bpf_prog_linfo__new
in /src/libbpf/src/bpf_prog_linfo.c:100
['struct bpf_prog_info*'] struct bpf_prog_linfo []
probe_kern_global_data
in /src/libbpf/src/features.c:47
['int'] int []
probe_kern_exp_attach_type
in /src/libbpf/src/features.c:223
['int'] int []
probe_kern_probe_read_kernel
in /src/libbpf/src/features.c:245
['int'] int []
probe_prog_bind_map
in /src/libbpf/src/features.c:265
['int'] int []
probe_perf_link
in /src/libbpf/src/features.c:332
['int'] int []
probe_uprobe_multi_link
in /src/libbpf/src/features.c:362
['int'] int []
probe_kern_bpf_cookie
in /src/libbpf/src/features.c:427
['int'] int []
probe_kern_arg_ctx_tag
in /src/libbpf/src/features.c:454
['int'] int []
probe_ldimm64_full_range_off
in /src/libbpf/src/features.c:509
['int'] int []
bpf_program__clone
in /src/libbpf/src/libbpf.c:9944
['struct bpf_program*', 'struct bpf_prog_load_opts*'] int []
libbpf_probe_bpf_prog_type
in /src/libbpf/src/libbpf_probes.c:205
['enum bpf_prog_type', 'void*'] int []
libbpf_probe_bpf_helper
in /src/libbpf/src/libbpf_probes.c:433
['enum bpf_prog_type', 'enum bpf_func_id', 'void*'] int []
btf_dump__new
in /src/libbpf/src/btf_dump.c:149
['struct btf*', 'btf_dump_printf_fn_t', 'void*', 'struct btf_dump_opts*'] struct btf_dump []
btf_dump__dump_type
in /src/libbpf/src/btf_dump.c:281
['struct btf_dump*', '__u32'] int []
btf_dump__emit_type_decl
in /src/libbpf/src/btf_dump.c:1270
['struct btf_dump*', '__u32', 'struct btf_dump_emit_type_decl_opts*'] int []
btf_dump__dump_type_data
in /src/libbpf/src/btf_dump.c:2581
['struct btf_dump*', '__u32', 'void*', 'size_t', 'struct btf_dump_type_data_opts*'] int []
bpf_xdp_query_id
in /src/libbpf/src/netlink.c:508
['int', 'int', '__u32*'] int []
bpf_xdp_detach
in /src/libbpf/src/netlink.c:341
['int', '__u32', 'struct bpf_xdp_attach_opts*'] int []
bpf_tc_hook_create
in /src/libbpf/src/netlink.c:631
['struct bpf_tc_hook*'] int []
bpf_tc_hook_destroy
in /src/libbpf/src/netlink.c:647
['struct bpf_tc_hook*'] int []
bpf_tc_attach
in /src/libbpf/src/netlink.c:734
['struct bpf_tc_hook*', 'struct bpf_tc_opts*'] int []
bpf_tc_detach
in /src/libbpf/src/netlink.c:869
['struct bpf_tc_hook*', 'struct bpf_tc_opts*'] int []
bpf_tc_query
in /src/libbpf/src/netlink.c:881
['struct bpf_tc_hook*', 'struct bpf_tc_opts*'] int []
hashmap__clear
in /src/libbpf/src/hashmap.c:63
['struct hashmap*'] void []
bpf_linker__finalize
in /src/libbpf/src/linker.c:2752
['struct bpf_linker*'] int []
libbpf_prepare_prog_load
in /src/libbpf/src/libbpf.c:7835
['struct bpf_program*', 'struct bpf_prog_load_opts*', 'long'] int []
bpf_program__attach_freplace
in /src/libbpf/src/libbpf.c:13880
['struct bpf_program*', 'int', 'char*'] struct bpf_link []
bpf_linker__add_file
in /src/libbpf/src/linker.c:518
['struct bpf_linker*', 'char*', 'struct bpf_linker_file_opts*'] int []
bpf_linker__add_fd
in /src/libbpf/src/linker.c:541
['struct bpf_linker*', 'int', 'struct bpf_linker_file_opts*'] int []
bpf_linker__add_buf
in /src/libbpf/src/linker.c:561
['struct bpf_linker*', 'void*', 'size_t', 'struct bpf_linker_file_opts*'] int []
btf__parse_raw
in /src/libbpf/src/btf.c:1622
['char*'] struct btf []
btf__parse_raw_split
in /src/libbpf/src/btf.c:1627
['char*', 'struct btf*'] struct btf []
btf__load_from_kernel_by_id
in /src/libbpf/src/btf.c:1973
['__u32'] struct btf []
bpf_linker__new
in /src/libbpf/src/linker.c:227
['char*', 'struct bpf_linker_opts*'] struct bpf_linker []
bpf_linker__new_fd
in /src/libbpf/src/linker.c:269
['int', 'struct bpf_linker_opts*'] struct bpf_linker []
btf__add_str
in /src/libbpf/src/btf.c:2094
['struct btf*', 'char*'] int []
btf__add_fwd
in /src/libbpf/src/btf.c:2901
['struct btf*', 'char*', 'enum btf_fwd_kind'] int []
btf__add_typedef
in /src/libbpf/src/btf.c:2937
['struct btf*', 'char*', 'int'] int []
btf__add_volatile
in /src/libbpf/src/btf.c:2952
['struct btf*', 'int'] int []
btf__add_const
in /src/libbpf/src/btf.c:2964
['struct btf*', 'int'] int []
btf__add_restrict
in /src/libbpf/src/btf.c:2976
['struct btf*', 'int'] int []
btf__add_type_tag
in /src/libbpf/src/btf.c:2989
['struct btf*', 'char*', 'int'] int []
btf__add_type_attr
in /src/libbpf/src/btf.c:3006
['struct btf*', 'char*', 'int'] int []
btf__add_union
in /src/libbpf/src/btf.c:2623
['struct btf*', 'char*', '__u32'] int []
btf__add_enum64
in /src/libbpf/src/btf.c:2831
['struct btf*', 'char*', '__u32', 'bool'] int []
btf__add_decl_attr
in /src/libbpf/src/btf.c:3341
['struct btf*', 'char*', 'int', 'int'] int []
strs_dedup_remap_str_off
in /src/libbpf/src/btf.c:4171
['__u32*', 'void*'] int []
bpf_map__set_value_size
in /src/libbpf/src/libbpf.c:10970
['struct bpf_map*', '__u32'] int []
hashmap_grow
in /src/libbpf/src/hashmap.c:101
['struct hashmap*'] int []
hashmap_delete
in /src/libbpf/src/hashmap.c:220
['struct hashmap*', 'long', 'long*', 'long*'] bool []
bpf_object_set_feat_cache
in /src/libbpf/src/libbpf.c:5214
['struct bpf_object*', 'struct kern_feature_cache*'] void []
bpf_object__pin
in /src/libbpf/src/libbpf.c:9510
['struct bpf_object*', 'char*'] int []
bpf_link__pin
in /src/libbpf/src/libbpf.c:11427
['struct bpf_link*', 'char*'] int []
bpf_object__unpin
in /src/libbpf/src/libbpf.c:9527
['struct bpf_object*', 'char*'] int []
libbpf_unregister_prog_handler
in /src/libbpf/src/libbpf.c:10241
['int'] int []
libbpf_prog_type_by_name
in /src/libbpf/src/libbpf.c:10368
['char*', 'enum bpf_prog_type*', 'enum bpf_attach_type*'] int []
libbpf_attach_type_by_name
in /src/libbpf/src/libbpf.c:10764
['char*', 'enum bpf_attach_type*'] int []
bpf_link_usdt_detach
in /src/libbpf/src/usdt.c:882
['struct bpf_link*'] int []
bpf_link__open
in /src/libbpf/src/libbpf.c:11393
['char*'] struct bpf_link []
bpf_link_perf_dealloc
in /src/libbpf/src/libbpf.c:11508
['struct bpf_link*'] void []
bpf_program__attach_perf_event
in /src/libbpf/src/libbpf.c:11594
['struct bpf_program*', 'int'] struct bpf_link []
bpf_program__attach_kprobe
in /src/libbpf/src/libbpf.c:12007
['struct bpf_program*', 'bool', 'char*'] struct bpf_link []
attach_ksyscall
in /src/libbpf/src/libbpf.c:12420
['struct bpf_program*', 'long', 'struct bpf_link**'] int []
attach_kprobe
in /src/libbpf/src/libbpf.c:12376
['struct bpf_program*', 'long', 'struct bpf_link**'] int []
attach_uprobe
in /src/libbpf/src/libbpf.c:13287
['struct bpf_program*', 'long', 'struct bpf_link**'] int []
bpf_program__attach_uprobe
in /src/libbpf/src/libbpf.c:13342
['struct bpf_program*', 'bool', 'pid_t', 'char*', 'size_t'] struct bpf_link []
attach_tp
in /src/libbpf/src/libbpf.c:13553
['struct bpf_program*', 'long', 'struct bpf_link**'] int []
attach_kprobe_multi
in /src/libbpf/src/libbpf.c:12441
['struct bpf_program*', 'long', 'struct bpf_link**'] int []
attach_kprobe_session
in /src/libbpf/src/libbpf.c:12472
['struct bpf_program*', 'long', 'struct bpf_link**'] int []
attach_raw_tp
in /src/libbpf/src/libbpf.c:13635
['struct bpf_program*', 'long', 'struct bpf_link**'] int []
attach_trace
in /src/libbpf/src/libbpf.c:13713
['struct bpf_program*', 'long', 'struct bpf_link**'] int []
bpf_program__attach_trace_opts
in /src/libbpf/src/libbpf.c:13702
['struct bpf_program*', 'struct bpf_trace_opts*'] struct bpf_link []
attach_lsm
in /src/libbpf/src/libbpf.c:13719
['struct bpf_program*', 'long', 'struct bpf_link**'] int []
bpf_program__attach_cgroup
in /src/libbpf/src/libbpf.c:13759
['struct bpf_program*', 'int'] struct bpf_link []
bpf_program__attach_netns
in /src/libbpf/src/libbpf.c:13765
['struct bpf_program*', 'int'] struct bpf_link []
bpf_program__attach_sockmap
in /src/libbpf/src/libbpf.c:13771
['struct bpf_program*', 'int'] struct bpf_link []
bpf_program__attach_xdp
in /src/libbpf/src/libbpf.c:13777
['struct bpf_program*', 'int'] struct bpf_link []
bpf_program__attach_cgroup_opts
in /src/libbpf/src/libbpf.c:13783
['struct bpf_program*', 'int', 'struct bpf_cgroup_opts*'] struct bpf_link []
bpf_program__attach_tcx
in /src/libbpf/src/libbpf.c:13811
['struct bpf_program*', 'int', 'struct bpf_tcx_opts*'] struct bpf_link []
bpf_program__attach_netkit
in /src/libbpf/src/libbpf.c:13846
['struct bpf_program*', 'int', 'struct bpf_netkit_opts*'] struct bpf_link []
attach_iter
in /src/libbpf/src/libbpf.c:13956
['struct bpf_program*', 'long', 'struct bpf_link**'] int []
bpf_program__attach_netfilter
in /src/libbpf/src/libbpf.c:13962
['struct bpf_program*', 'struct bpf_netfilter_opts*'] struct bpf_link []
bpf_object__attach_skeleton
in /src/libbpf/src/libbpf.c:15050
['struct bpf_object_skeleton*'] int []
perf_buffer__poll
in /src/libbpf/src/libbpf.c:14594
['struct perf_buffer*', 'int'] int []
perf_buffer__consume_buffer
in /src/libbpf/src/libbpf.c:14665
['struct perf_buffer*', 'size_t'] int []
perf_buffer__consume
in /src/libbpf/src/libbpf.c:14679
['struct perf_buffer*'] int []
perf_buffer__new
in /src/libbpf/src/libbpf.c:14326
['int', 'size_t', 'perf_buffer_sample_fn', 'perf_buffer_lost_fn', 'void*', 'struct perf_buffer_opts*'] struct perf_buffer []
perf_buffer__new_raw
in /src/libbpf/src/libbpf.c:14359
['int', 'size_t', 'struct perf_event_attr*', 'perf_buffer_event_fn', 'void*', 'struct perf_buffer_raw_opts*'] struct perf_buffer []
bpf_map__lookup_elem
in /src/libbpf/src/libbpf.c:11249
['struct bpf_map*', 'void*', 'size_t', 'void*', 'size_t', '__u64'] int []
bpf_map__update_elem
in /src/libbpf/src/libbpf.c:11262
['struct bpf_map*', 'void*', 'size_t', 'void*', 'size_t', '__u64'] int []
bpf_map__delete_elem
in /src/libbpf/src/libbpf.c:11275
['struct bpf_map*', 'void*', 'size_t', '__u64'] int []
bpf_map__lookup_and_delete_elem
in /src/libbpf/src/libbpf.c:11287
['struct bpf_map*', 'void*', 'size_t', 'void*', 'size_t', '__u64'] int []
bpf_map__get_next_key
in /src/libbpf/src/libbpf.c:11300
['struct bpf_map*', 'void*', 'void*', 'size_t'] int []
bpf_object__destroy_subskeleton
in /src/libbpf/src/libbpf.c:15014
['struct bpf_object_subskeleton*'] void []
probe_kern_btf_layout
in /src/libbpf/src/features.c:592
['int'] int []
probe_kern_btf
in /src/libbpf/src/features.c:80
['int'] int []
probe_kern_btf_func
in /src/libbpf/src/features.c:92
['int'] int []
probe_kern_btf_func_global
in /src/libbpf/src/features.c:110
['int'] int []
probe_kern_btf_datasec
in /src/libbpf/src/features.c:128
['int'] int []
probe_kern_btf_qmark_datasec
in /src/libbpf/src/features.c:147
['int'] int []
probe_kern_btf_float
in /src/libbpf/src/features.c:166
['int'] int []
probe_kern_btf_decl_tag
in /src/libbpf/src/features.c:178
['int'] int []
probe_kern_btf_type_tag
in /src/libbpf/src/features.c:195
['int'] int []
probe_module_btf
in /src/libbpf/src/features.c:303
['int'] int []
probe_kern_btf_enum64
in /src/libbpf/src/features.c:443
['int'] int []
libbpf_probe_bpf_map_type
in /src/libbpf/src/libbpf_probes.c:422
['enum bpf_map_type', 'void*'] int []
btf__new_empty_opts
in /src/libbpf/src/btf.c:1292
['struct btf_new_opts*'] struct btf []
btf__load_into_kernel
in /src/libbpf/src/btf.c:1773
['struct btf*'] int []
skel_free
in /src/libbpf/src/skel_internal.h:180
['void*'] void []