]> git.baikalelectronics.ru Git - kernel.git/commit
tracing/histogram: Do not copy the fixed-size char array field over the field size
authorMasami Hiramatsu <mhiramat@kernel.org>
Fri, 12 Nov 2021 16:02:08 +0000 (01:02 +0900)
committerSteven Rostedt (VMware) <rostedt@goodmis.org>
Fri, 12 Nov 2021 20:48:46 +0000 (15:48 -0500)
commit7efd1d9dc9df1b045f5d98396e2cd17b1d453447
treefb646bd1bb322d521f83f081f635e9b4fac7747c
parenta04a17965bff30e0a362e78dc04e2e72d8743b0e
tracing/histogram: Do not copy the fixed-size char array field over the field size

Do not copy the fixed-size char array field of the events over
the field size. The histogram treats char array as a string and
there are 2 types of char array in the event, fixed-size and
dynamic string. The dynamic string (__data_loc) field must be
null terminated, but the fixed-size char array field may not
be null terminated (not a string, but just a data).
In that case, histogram can copy the data after the field.
This uses the original field size for fixed-size char array
field to restrict the histogram not to access over the original
field size.

Link: https://lkml.kernel.org/r/163673292822.195747.3696966210526410250.stgit@devnote2
Fixes: 338cf6857a58 (tracing: Add support for 'field variables')
Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
kernel/trace/trace_events_hist.c