]> git.baikalelectronics.ru Git - kernel.git/commit
tracing: probeevent: Correctly update remaining space in dynamic area
authorAndreas Ziegler <andreas.ziegler@fau.de>
Wed, 6 Feb 2019 19:00:13 +0000 (20:00 +0100)
committerSteven Rostedt (VMware) <rostedt@goodmis.org>
Mon, 11 Feb 2019 20:58:30 +0000 (15:58 -0500)
commite11ec76f481401287274406edd9cb127e05c762c
tree5d7e97877a3ebf080f2bff24d16003b3b5ac203d
parent64d1f9e68cff7fc2fb57e77a50c73349298231ba
tracing: probeevent: Correctly update remaining space in dynamic area

Commit c9b28fd5911c ("tracing: probeevent: Return consumed
bytes of dynamic area") improved the string fetching
mechanism by returning the number of required bytes after
copying the argument to the dynamic area. However, this
return value is now only used to increment the pointer
inside the dynamic area but misses updating the 'maxlen'
variable which indicates the remaining space in the dynamic
area.

This means that fetch_store_string() always reads the *total*
size of the dynamic area from the data_loc pointer instead of
the *remaining* size (and passes it along to
strncpy_from_{user,unsafe}) even if we're already about to
copy data into the middle of the dynamic area.

Link: http://lkml.kernel.org/r/20190206190013.16405-1-andreas.ziegler@fau.de
Cc: Ingo Molnar <mingo@redhat.com>
Cc: stable@vger.kernel.org
Fixes: c9b28fd5911c ("tracing: probeevent: Return consumed bytes of dynamic area")
Acked-by: Masami Hiramatsu <mhiramat@kernel.org>
Signed-off-by: Andreas Ziegler <andreas.ziegler@fau.de>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
kernel/trace/trace_probe_tmpl.h