Howard McLauchlan
f0a2aa5a2a
tracing/uprobe: Add support for overlayfs
...
uprobes cannot successfully attach to binaries located in a directory
mounted with overlayfs.
To verify, create directories for mounting overlayfs
(upper,lower,work,merge), move some binary into merge/ and use readelf
to obtain some known instruction of the binary. I used /bin/true and the
entry instruction(0x13b0):
$ mount -t overlay overlay -o lowerdir=lower,upperdir=upper,workdir=work merge
$ cd /sys/kernel/debug/tracing
$ echo 'p:true_entry PATH_TO_MERGE/merge/true:0x13b0' > uprobe_events
$ echo 1 > events/uprobes/true_entry/enable
This returns 'bash: echo: write error: Input/output error' and dmesg
tells us 'event trace: Could not enable event true_entry'
This change makes create_trace_uprobe() look for the real inode of a
dentry. In the case of normal filesystems, this simplifies to just
returning the inode. In the case of overlayfs(and similar fs) we will
obtain the underlying dentry and corresponding inode, upon which uprobes
can successfully register.
Running the example above with the patch applied, we can see that the
uprobe is enabled and will output to trace as expected.
Link: http://lkml.kernel.org/r/20180410231030.2720-1-hmclauchlan@fb.com
Reviewed-by: Josef Bacik <jbacik@fb.com>
Reviewed-by: Masami Hiramatsu <mhiramat@kernel.org>
Reviewed-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
Signed-off-by: Howard McLauchlan <hmclauchlan@fb.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
2018-04-11 11:31:06 -04:00
..
blktrace.c
blktrace: fix trace mutex deadlock
2017-11-27 12:03:58 -07:00
bpf_trace.c
bpf: fix bpf_prog_array_copy_to_user warning from perf event prog query
2018-02-14 08:59:37 -08:00
ftrace.c
ftrace: Drop a VLA in module_exists()
2018-04-06 08:56:48 -04:00
Kconfig
tracing: Add inter-event blurb to HIST_TRIGGERS config option
2018-03-10 16:06:05 -05:00
Makefile
Tracing updates for 4.15:
2017-11-17 14:58:01 -08:00
power-traces.c
License cleanup: add SPDX GPL-2.0 license identifier to files with no license
2017-11-02 11:10:55 +01:00
ring_buffer.c
ring-buffer: Add set/clear_current_oom_origin() during allocations
2018-04-06 08:56:52 -04:00
ring_buffer_benchmark.c
rpm-traces.c
License cleanup: add SPDX GPL-2.0 license identifier to files with no license
2017-11-02 11:10:55 +01:00
trace.c
tracing: Fixup logic inversion on setting trace_global_clock defaults
2018-04-06 08:56:53 -04:00
trace.h
tracing: Rewrite filter logic to be simpler and faster
2018-03-14 12:35:39 -04:00
trace_benchmark.c
trace: Eliminate cond_resched_rcu_qs() in favor of cond_resched()
2017-12-04 10:28:58 -08:00
trace_benchmark.h
License cleanup: add SPDX GPL-2.0 license identifier to files with no license
2017-11-02 11:10:55 +01:00
trace_branch.c
License cleanup: add SPDX GPL-2.0 license identifier to files with no license
2017-11-02 11:10:55 +01:00
trace_clock.c
tracing: Hide global trace clock from lockdep
2018-04-06 08:56:52 -04:00
trace_entries.h
License cleanup: add SPDX GPL-2.0 license identifier to files with no license
2017-11-02 11:10:55 +01:00
trace_event_perf.c
perf/ftrace: Small cleanup
2017-10-16 18:13:28 -04:00
trace_events.c
tracing: Make sure the parsed string always terminates with '\0'
2018-01-23 15:57:28 -05:00
trace_events_filter.c
tracing: Use ARRAY_SIZE() macro instead of open coding it
2018-04-11 11:30:33 -04:00
trace_events_filter_test.h
License cleanup: add SPDX GPL-2.0 license identifier to files with no license
2017-11-02 11:10:55 +01:00
trace_events_hist.c
tracing: Uninitialized variable in create_tracing_map_fields()
2018-04-06 08:56:50 -04:00
trace_events_trigger.c
tracing: Add variable reference handling to hist triggers
2018-03-10 16:05:58 -05:00
trace_export.c
License cleanup: add SPDX GPL-2.0 license identifier to files with no license
2017-11-02 11:10:55 +01:00
trace_functions.c
tracing: Update stack trace skipping for ORC unwinder
2018-01-23 15:57:00 -05:00
trace_functions_graph.c
License cleanup: add SPDX GPL-2.0 license identifier to files with no license
2017-11-02 11:10:55 +01:00
trace_hwlat.c
trace_irqsoff.c
tracing: Add support for preempt and irq enable/disable events
2017-10-10 18:58:43 -04:00
trace_kdb.c
License cleanup: add SPDX GPL-2.0 license identifier to files with no license
2017-11-02 11:10:55 +01:00
trace_kprobe.c
error-injection: Separate error-injection from kprobe
2018-01-12 17:33:38 -08:00
trace_mmiotrace.c
License cleanup: add SPDX GPL-2.0 license identifier to files with no license
2017-11-02 11:10:55 +01:00
trace_nop.c
License cleanup: add SPDX GPL-2.0 license identifier to files with no license
2017-11-02 11:10:55 +01:00
trace_output.c
sched/debug: Rename task-state printing helpers
2017-10-10 11:43:29 +02:00
trace_output.h
License cleanup: add SPDX GPL-2.0 license identifier to files with no license
2017-11-02 11:10:55 +01:00
trace_printk.c
trace_probe.c
trace_probe.h
tracing/kprobe: bpf: Check error injectable event is on function entry
2018-01-12 17:33:37 -08:00
trace_sched_switch.c
License cleanup: add SPDX GPL-2.0 license identifier to files with no license
2017-11-02 11:10:55 +01:00
trace_sched_wakeup.c
Merge branch 'linus' into sched/core, to pick up fixes
2017-11-08 10:17:15 +01:00
trace_selftest.c
Tracing updates for 4.15:
2017-11-17 14:58:01 -08:00
trace_selftest_dynamic.c
ftrace: Mark function tracer test functions noinline/noclone
2018-01-23 15:57:29 -05:00
trace_seq.c
trace_stack.c
tracing: Have stack trace not record if RCU is not watching
2017-12-14 20:48:22 -05:00
trace_stat.c
License cleanup: add SPDX GPL-2.0 license identifier to files with no license
2017-11-02 11:10:55 +01:00
trace_stat.h
License cleanup: add SPDX GPL-2.0 license identifier to files with no license
2017-11-02 11:10:55 +01:00
trace_syscalls.c
Tracing updates for 4.15:
2017-11-17 14:58:01 -08:00
trace_uprobe.c
tracing/uprobe: Add support for overlayfs
2018-04-11 11:31:06 -04:00
tracing_map.c
tracing: Add per-element variable support to tracing_map
2018-03-10 16:05:53 -05:00
tracing_map.h
tracing: Add per-element variable support to tracing_map
2018-03-10 16:05:53 -05:00