Luis Chamberlain
f4e8607651
blktrace: ensure our debugfs dir exists
...
[ Upstream commit b431ef837e3374da0db8ff6683170359aaa0859c ]
We make an assumption that a debugfs directory exists, but since
this can fail ensure it exists before allowing blktrace setup to
complete. Otherwise we end up stuffing blktrace files on the debugfs
root directory. In the worst case scenario this *in theory* can create
an eventual panic *iff* in the future a similarly named file is created
prior on the debugfs root directory. This theoretical crash can happen
due to a recursive removal followed by a specific dentry removal.
This doesn't fix any known crash, however I have seen the files
go into the main debugfs root directory in cases where the debugfs
directory was not created due to other internal bugs with blktrace
now fixed.
blktrace is also completely useless without this directory, so
this ensures to userspace we only setup blktrace if the kernel
can stuff files where they are supposed to go into.
debugfs directory creations typically aren't checked for, and we have
maintainers doing sweep removals of these checks, but since we need this
check to ensure proper userspace blktrace functionality we make sure
to annotate the justification for the check.
Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-09-03 11:24:18 +02:00
..
blktrace.c
blktrace: ensure our debugfs dir exists
2020-09-03 11:24:18 +02:00
bpf_trace.c
bpf: fix nested bpf tracepoints with per-cpu data
2019-07-03 13:14:48 +02:00
ftrace.c
tracing: Use trace_sched_process_free() instead of exit() for pid tracing
2020-08-21 11:05:33 +02:00
Kconfig
Stop the ad-hoc games with -Wno-maybe-initialized
2020-05-20 08:18:45 +02:00
Makefile
tracing: Allow gcov profiling on only ftrace subsystem
2018-08-21 09:11:49 -04: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
preemptirq_delay_test.c
tracing: Use trace_clock_local() for looping in preemptirq_delay_test.c
2018-10-17 15:35:33 -04:00
ring_buffer.c
ring-buffer: Zero out time extend if it is nested and not absolute
2020-06-30 23:17:17 -04:00
ring_buffer_benchmark.c
tracing: Add SPDX License format tags to tracing files
2018-08-16 19:08:06 -04:00
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: Add a vmalloc_sync_mappings() for safe measure
2020-05-14 07:57:20 +02:00
trace.h
ftrace: Protect ftrace_graph_hash with ftrace_sync
2020-02-11 04:34:05 -08:00
trace_benchmark.c
rcu: Rename cond_resched_rcu_qs() to cond_resched_tasks_rcu_qs()
2018-05-15 10:27:29 -07:00
trace_benchmark.h
tracing: Fix SPDX format headers to use C++ style comments
2018-08-16 19:08:06 -04:00
trace_branch.c
Revert "x86/uaccess, ftrace: Fix ftrace_likely_update() vs. SMAP"
2019-07-03 13:14:41 +02:00
trace_clock.c
tracing: Add SPDX License format tags to tracing files
2018-08-16 19:08:06 -04:00
trace_entries.h
tracing: Fix SPDX format headers to use C++ style comments
2018-08-16 19:08:06 -04:00
trace_event_perf.c
tracing: Fix race in perf_trace_buf initialization
2019-10-29 09:20:03 +01:00
trace_events.c
tracing: Use trace_sched_process_free() instead of exit() for pid tracing
2020-08-21 11:05:33 +02:00
trace_events_filter.c
tracing: Have error path in predicate_parse() free its allocated memory
2020-08-05 10:05:59 +02:00
trace_events_filter_test.h
tracing: Fix SPDX format headers to use C++ style comments
2018-08-16 19:08:06 -04:00
trace_events_hist.c
tracing: Fix histogram code when expression has same var as value
2020-01-29 16:43:23 +01:00
trace_events_trigger.c
tracing: Fix event trigger to accept redundant spaces
2020-06-30 23:17:17 -04:00
trace_export.c
tracing: Add trigger file for trace_markers tracefs/ftrace/print
2018-05-29 08:28:53 -04:00
trace_functions.c
tracing: Update stack trace skipping for ORC unwinder
2018-01-23 15:57:00 -05:00
trace_functions_graph.c
tracing/fgraph: Fix set_graph_function from showing interrupts
2018-12-08 12:59:07 +01:00
trace_hwlat.c
tracing/hwlat: Honor the tracing_cpumask
2020-08-21 11:05:33 +02:00
trace_irqsoff.c
tracing/fgraph: Fix set_graph_function from showing interrupts
2018-12-08 12:59:07 +01:00
trace_kdb.c
tracing: Silence GCC 9 array bounds warning
2019-06-25 11:35:52 +08:00
trace_kprobe.c
tracing/kprobes: Fix a double initialization typo
2020-05-14 07:57:16 +02:00
trace_kprobe_selftest.c
selftest/ftrace: Move kprobe selftest function to separate compile unit
2018-07-30 18:41:04 -04:00
trace_kprobe_selftest.h
tracing: Fix SPDX format headers to use C++ style comments
2018-08-16 19:08:06 -04: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
tracing: Add SPDX License format tags to tracing files
2018-08-16 19:08:06 -04:00
trace_output.h
tracing: Fix SPDX format headers to use C++ style comments
2018-08-16 19:08:06 -04:00
trace_preemptirq.c
tracing: More reverting of "tracing: Centralize preemptirq tracepoints and unify their usage"
2018-08-10 15:12:00 -04:00
trace_printk.c
tracing: Add SPDX License format tags to tracing files
2018-08-16 19:08:06 -04:00
trace_probe.c
tracing: Add SPDX License format tags to tracing files
2018-08-16 19:08:06 -04:00
trace_probe.h
tracing: Add SPDX License format tags to tracing files
2018-08-16 19:08:06 -04:00
trace_sched_switch.c
tracing: Fix sched switch start/stop refcount racy updates
2020-02-11 04:33:55 -08:00
trace_sched_wakeup.c
kernel/trace: Fix do not unregister tracepoints when register sched_migrate_task fail
2020-01-14 20:06:59 +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
tracing: Add SPDX License format tags to tracing files
2018-08-16 19:08:06 -04:00
trace_stack.c
tracing: Have stack tracer compile when MCOUNT_INSN_SIZE is not defined
2020-01-14 20:06:59 +01:00
trace_stat.c
tracing: Fix very unlikely race of registering two stat tracers
2020-02-24 08:34:39 +01:00
trace_stat.h
tracing: Fix SPDX format headers to use C++ style comments
2018-08-16 19:08:06 -04:00
trace_syscalls.c
Tracing updates for 4.15:
2017-11-17 14:58:01 -08:00
trace_uprobe.c
tracing/uprobes: Fix output for multiple string arguments
2019-02-20 10:25:48 +01:00
tracing_map.c
tracing: Have the histogram compare functions convert to u64 first
2020-01-09 10:19:02 +01:00
tracing_map.h
tracing: Fix SPDX format headers to use C++ style comments
2018-08-16 19:08:06 -04:00