]> git.baikalelectronics.ru Git - kernel.git/commit
tracing/boot: Fix trace_boot_hist_add_array() to check array is value
authorMasami Hiramatsu <mhiramat@kernel.org>
Thu, 9 Sep 2021 13:36:23 +0000 (22:36 +0900)
committerSteven Rostedt (VMware) <rostedt@goodmis.org>
Thu, 9 Sep 2021 23:14:33 +0000 (19:14 -0400)
commit1bca5df4e7d7b5c84511e70d3c43f9f8b2c05860
tree5ac8abc7d780438928a8ed473a03590944370c02
parentb819c14fd8368b19c2a6b2518ed731b9a2e45a00
tracing/boot: Fix trace_boot_hist_add_array() to check array is value

trace_boot_hist_add_array() uses the combination of
xbc_node_find_child() and xbc_node_get_child() to get the
child node of the key node. But since it missed to check
the child node is data node or not, user can pass the
subkey node for the array node (anode).
To avoid this issue, check the array node is a data node.
Actually, there is xbc_node_find_value(node, key, vnode),
which ensures the @vnode is a value node, so use it in
trace_boot_hist_add_array() to fix this issue.

Link: https://lkml.kernel.org/r/163119458308.161018.1516455973625940212.stgit@devnote2
Fixes: 9ac0f7b11577 ("tracing/boot: Add per-event histogram action options")
Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
kernel/trace/trace_boot.c