]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blobdiff - include/linux/bpf.h
Merge tag 'mlx5-updates-2017-06-27' of git://git.kernel.org/pub/scm/linux/kernel...
[mirror_ubuntu-artful-kernel.git] / include / linux / bpf.h
index 6bb38d76faf42a18437eb7565380b75a71096f78..deca4e7f28451f95bf566a201271fd94633f42e3 100644 (file)
@@ -46,6 +46,7 @@ struct bpf_map {
        u32 max_entries;
        u32 map_flags;
        u32 pages;
+       u32 id;
        struct user_struct *user;
        const struct bpf_map_ops *ops;
        struct work_struct work;
@@ -148,6 +149,15 @@ enum bpf_reg_type {
 
 struct bpf_prog;
 
+/* The information passed from prog-specific *_is_valid_access
+ * back to the verifier.
+ */
+struct bpf_insn_access_aux {
+       enum bpf_reg_type reg_type;
+       int ctx_field_size;
+       int converted_op_size;
+};
+
 struct bpf_verifier_ops {
        /* return eBPF function prototype for verification */
        const struct bpf_func_proto *(*get_func_proto)(enum bpf_func_id func_id);
@@ -156,7 +166,7 @@ struct bpf_verifier_ops {
         * with 'type' (read or write) is allowed
         */
        bool (*is_valid_access)(int off, int size, enum bpf_access_type type,
-                               enum bpf_reg_type *reg_type);
+                               struct bpf_insn_access_aux *info);
        int (*gen_prologue)(struct bpf_insn *insn, bool direct_write,
                            const struct bpf_prog *prog);
        u32 (*convert_ctx_access)(enum bpf_access_type type,
@@ -171,6 +181,8 @@ struct bpf_prog_aux {
        atomic_t refcnt;
        u32 used_map_cnt;
        u32 max_ctx_offset;
+       u32 stack_depth;
+       u32 id;
        struct latch_tree_node ksym_tnode;
        struct list_head ksym_lnode;
        const struct bpf_verifier_ops *ops;