tracing: Use trace_seq_used() and seq_buf_used() instead of len
authorSteven Rostedt (Red Hat) <rostedt@goodmis.org>
Fri, 14 Nov 2014 20:49:41 +0000 (15:49 -0500)
committerSteven Rostedt <rostedt@goodmis.org>
Thu, 20 Nov 2014 03:01:15 +0000 (22:01 -0500)
commit5ac48378414dccca735897c4d7f4e19987c8977c
tree9cf5c11dddd8081327d7e7f8a68a9e47613adcfa
parent74f06bb72347302a19aac087314388ebd0e4fee9
tracing: Use trace_seq_used() and seq_buf_used() instead of len

As the seq_buf->len will soon be +1 size when there's an overflow, we
must use trace_seq_used() or seq_buf_used() methods to get the real
length. This will prevent buffer overflow issues if just the len
of the seq_buf descriptor is used to copy memory.

Link: http://lkml.kernel.org/r/20141114121911.09ba3d38@gandalf.local.home
Reported-by: Petr Mladek <pmladek@suse.cz>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
include/linux/trace_seq.h
kernel/trace/seq_buf.c
kernel/trace/trace.c
kernel/trace/trace_events.c
kernel/trace/trace_functions_graph.c
kernel/trace/trace_seq.c