]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit
trace/kprobes: Sanitize derived event names
authorNaveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Fri, 7 Jul 2017 18:57:30 +0000 (00:27 +0530)
committerSteven Rostedt (VMware) <rostedt@goodmis.org>
Sun, 9 Jul 2017 11:45:53 +0000 (07:45 -0400)
commitfca18a47cf3eb8425ec19c2dfc374f3d04f5219f
treeaa754243fd1064a96af411d42354cb985e8bdbfa
parent29b1a8ad7df4528b862a79e3d5fb0936f4d199c7
trace/kprobes: Sanitize derived event names

When we derive event names, convert some expected symbols (such as ':'
used to specify module:name and '.' present in some symbols) into
underscores so that the event name is not rejected.

Before this patch:
    # echo 'p kobject_example:foo_store' > kprobe_events
    trace_kprobe: Failed to allocate trace_probe.(-22)
    -sh: write error: Invalid argument

After this patch:
    # echo 'p kobject_example:foo_store' > kprobe_events
    # cat kprobe_events
    p:kprobes/p_kobject_example_foo_store_0 kobject_example:foo_store

Link: http://lkml.kernel.org/r/66c189e09e71361aba91dd4a5bd146a1b62a7a51.1499453040.git.naveen.n.rao@linux.vnet.ibm.com
Acked-by: Masami Hiramatsu <mhiramat@kernel.org>
Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
kernel/trace/trace_kprobe.c