diff options
author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2018-06-04 13:33:12 -0700 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2018-06-04 13:33:12 -0700 |
commit | c13aca79ff3c4af5fd31a5b2743a90eba6e36a26 (patch) | |
tree | 8f77894f61822d1ae5285c07c801af7c62f71afd /include/linux/bpf_verifier.h | |
parent | 40f7090bb1b4ec327ea1e1402ff5783af5b35195 (diff) | |
parent | 5ca4d1ae9bad0f59bd6f851c39b19f5366953666 (diff) | |
download | kernel_replicant_linux-c13aca79ff3c4af5fd31a5b2743a90eba6e36a26.tar.gz kernel_replicant_linux-c13aca79ff3c4af5fd31a5b2743a90eba6e36a26.tar.bz2 kernel_replicant_linux-c13aca79ff3c4af5fd31a5b2743a90eba6e36a26.zip |
Merge branch 'next' into for-linus
Prepare input updates for 4.18 merge window.
Diffstat (limited to 'include/linux/bpf_verifier.h')
-rw-r--r-- | include/linux/bpf_verifier.h | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/include/linux/bpf_verifier.h b/include/linux/bpf_verifier.h index 6b66cd1aa0b9..7e61c395fddf 100644 --- a/include/linux/bpf_verifier.h +++ b/include/linux/bpf_verifier.h @@ -153,7 +153,7 @@ struct bpf_insn_aux_data { #define BPF_VERIFIER_TMP_LOG_SIZE 1024 -struct bpf_verifer_log { +struct bpf_verifier_log { u32 level; char kbuf[BPF_VERIFIER_TMP_LOG_SIZE]; char __user *ubuf; @@ -161,11 +161,16 @@ struct bpf_verifer_log { u32 len_total; }; -static inline bool bpf_verifier_log_full(const struct bpf_verifer_log *log) +static inline bool bpf_verifier_log_full(const struct bpf_verifier_log *log) { return log->len_used >= log->len_total - 1; } +static inline bool bpf_verifier_log_needed(const struct bpf_verifier_log *log) +{ + return log->level && log->ubuf && !bpf_verifier_log_full(log); +} + #define BPF_MAX_SUBPROGS 256 /* single container for all structs @@ -185,13 +190,15 @@ struct bpf_verifier_env { bool allow_ptr_leaks; bool seen_direct_write; struct bpf_insn_aux_data *insn_aux_data; /* array of per-insn state */ - struct bpf_verifer_log log; + struct bpf_verifier_log log; u32 subprog_starts[BPF_MAX_SUBPROGS]; /* computes the stack depth of each bpf function */ u16 subprog_stack_depth[BPF_MAX_SUBPROGS + 1]; u32 subprog_cnt; }; +void bpf_verifier_vlog(struct bpf_verifier_log *log, const char *fmt, + va_list args); __printf(2, 3) void bpf_verifier_log_write(struct bpf_verifier_env *env, const char *fmt, ...); |