]> Git Repo - linux.git/blobdiff - tools/lib/bpf/bpf.h
bpf: prevent out of bounds speculation on pointer arithmetic
[linux.git] / tools / lib / bpf / bpf.h
index 60392b70587ca1645479c319dd8552e179153e2f..8f09de482839e289ff1b203d105eae26b52d2de6 100644 (file)
@@ -82,6 +82,9 @@ struct bpf_load_program_attr {
        __u32 func_info_rec_size;
        const void *func_info;
        __u32 func_info_cnt;
+       __u32 line_info_rec_size;
+       const void *line_info;
+       __u32 line_info_cnt;
 };
 
 /* Flags to direct loading requirements */
@@ -118,6 +121,25 @@ LIBBPF_API int bpf_prog_attach(int prog_fd, int attachable_fd,
 LIBBPF_API int bpf_prog_detach(int attachable_fd, enum bpf_attach_type type);
 LIBBPF_API int bpf_prog_detach2(int prog_fd, int attachable_fd,
                                enum bpf_attach_type type);
+
+struct bpf_prog_test_run_attr {
+       int prog_fd;
+       int repeat;
+       const void *data_in;
+       __u32 data_size_in;
+       void *data_out;      /* optional */
+       __u32 data_size_out; /* in: max length of data_out
+                             * out: length of data_out */
+       __u32 retval;        /* out: return code of the BPF program */
+       __u32 duration;      /* out: average per repetition in ns */
+};
+
+LIBBPF_API int bpf_prog_test_run_xattr(struct bpf_prog_test_run_attr *test_attr);
+
+/*
+ * bpf_prog_test_run does not check that data_out is large enough. Consider
+ * using bpf_prog_test_run_xattr instead.
+ */
 LIBBPF_API int bpf_prog_test_run(int prog_fd, int repeat, void *data,
                                 __u32 size, void *data_out, __u32 *size_out,
                                 __u32 *retval, __u32 *duration);
This page took 0.046537 seconds and 4 git commands to generate.