]> git.baikalelectronics.ru Git - kernel.git/commit
bpf: fix check of allowed specifiers in bpf_trace_printk
authorMartynas Pumputis <m@lambda.lt>
Fri, 23 Nov 2018 16:43:26 +0000 (17:43 +0100)
committerDaniel Borkmann <daniel@iogearbox.net>
Fri, 23 Nov 2018 20:54:14 +0000 (21:54 +0100)
commit81a1f3fba72a4aac547ca28a271d2a4f7f0561bb
treecf6126f29233e979c5cf92c259ad59c315b6318e
parent1d91e49de08ddee33e342f1a992fd50c7cb2611b
bpf: fix check of allowed specifiers in bpf_trace_printk

A format string consisting of "%p" or "%s" followed by an invalid
specifier (e.g. "%p%\n" or "%s%") could pass the check which
would make format_decode (lib/vsprintf.c) to warn.

Fixes: a38b1b4582b2 ("tracing: Allow BPF programs to call bpf_trace_printk()")
Reported-by: syzbot+1ec5c5ec949c4adaa0c4@syzkaller.appspotmail.com
Signed-off-by: Martynas Pumputis <m@lambda.lt>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
kernel/trace/bpf_trace.c