]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
bpf: add __printf verification to bpf_verifier_vlog
authorMathieu Malaterre <malat@debian.org>
Wed, 16 May 2018 20:27:41 +0000 (22:27 +0200)
committerDaniel Borkmann <daniel@iogearbox.net>
Wed, 16 May 2018 22:49:17 +0000 (00:49 +0200)
__printf is useful to verify format and arguments. ‘bpf_verifier_vlog’
function is used twice in verifier.c in both cases the caller function
already uses the __printf gcc attribute.

Remove the following warning, triggered with W=1:

  kernel/bpf/verifier.c:176:2: warning: function might be possible candidate for ‘gnu_printf’ format attribute [-Wsuggest-attribute=format]

Signed-off-by: Mathieu Malaterre <malat@debian.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
include/linux/bpf_verifier.h

index 8f70dc181e23495995dcd73bcd6ef414ba30ba34..c286813deaebe48a8f2f92ca10a7e0655eed35b3 100644 (file)
@@ -200,8 +200,8 @@ struct bpf_verifier_env {
        u32 subprog_cnt;
 };
 
-void bpf_verifier_vlog(struct bpf_verifier_log *log, const char *fmt,
-                      va_list args);
+__printf(2, 0) 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, ...);