acrn-kernel/kernel/trace
Brian Foster 1dd387668d tracing: Zero the pipe cpumask on alloc to avoid spurious -EBUSY
commit 3d07fa1dd1 upstream.

The pipe cpumask used to serialize opens between the main and percpu
trace pipes is not zeroed or initialized. This can result in
spurious -EBUSY returns if underlying memory is not fully zeroed.
This has been observed by immediate failure to read the main
trace_pipe file on an otherwise newly booted and idle system:

 # cat /sys/kernel/debug/tracing/trace_pipe
 cat: /sys/kernel/debug/tracing/trace_pipe: Device or resource busy

Zero the allocation of pipe_cpumask to avoid the problem.

Link: https://lore.kernel.org/linux-trace-kernel/20230831125500.986862-1-bfoster@redhat.com

Cc: stable@vger.kernel.org
Fixes: c2489bb7e6 ("tracing: Introduce pipe_cpumask to avoid race on trace_pipes")
Reviewed-by: Zheng Yejian <zhengyejian1@huawei.com>
Reviewed-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-09-13 09:43:05 +02:00
..
rv
Kconfig
Makefile
blktrace.c
bpf_trace.c bpf: Clear the probe_addr for uprobe 2023-09-13 09:42:30 +02:00
bpf_trace.h
error_report-traces.c
fgraph.c
fprobe.c fprobe: Ensure running fprobe_exit_handler() finished before calling rethook_free() 2023-07-23 13:49:46 +02:00
ftrace.c ftrace: Fix possible warning on checking all pages used in ftrace_process_locs() 2023-07-23 13:49:44 +02:00
ftrace_internal.h
kprobe_event_gen_test.c tracing: Fix wrong return in kprobe_event_gen_test.c 2023-04-06 12:10:41 +02:00
pid_list.c
pid_list.h
power-traces.c
preemptirq_delay_test.c
rethook.c fprobe: Ensure running fprobe_exit_handler() finished before calling rethook_free() 2023-07-23 13:49:46 +02:00
ring_buffer.c ring-buffer: Do not swap cpu_buffer during resize process 2023-08-23 17:52:27 +02:00
ring_buffer_benchmark.c
rpm-traces.c
synth_event_gen_test.c
trace.c tracing: Zero the pipe cpumask on alloc to avoid spurious -EBUSY 2023-09-13 09:43:05 +02:00
trace.h tracing: Introduce pipe_cpumask to avoid race on trace_pipes 2023-09-13 09:42:25 +02:00
trace_benchmark.c
trace_benchmark.h
trace_boot.c
trace_branch.c
trace_clock.c
trace_dynevent.c
trace_dynevent.h
trace_entries.h
trace_eprobe.c kernel/trace: Fix cleanup logic of enable_trace_eprobe 2023-07-23 13:49:24 +02:00
trace_event_perf.c
trace_events.c tracing: Fix warning in trace_buffered_event_disable() 2023-08-03 10:24:07 +02:00
trace_events_filter.c
trace_events_filter_test.h
trace_events_hist.c tracing: Allow synthetic events to pass around stacktraces 2023-08-03 10:23:55 +02:00
trace_events_inject.c
trace_events_synth.c tracing: Fix trace_event_raw_event_synth() if else statement 2023-08-03 10:24:17 +02:00
trace_events_trigger.c
trace_events_user.c tracing/user_events: Fix struct arg size match check 2023-07-23 13:49:47 +02:00
trace_export.c
trace_functions.c
trace_functions_graph.c
trace_hwlat.c tracing: Remove extra space at the end of hwlat_detector/mode 2023-09-13 09:42:57 +02:00
trace_irqsoff.c tracing: Fix memleak due to race between current_tracer and trace 2023-08-30 16:11:00 +02:00
trace_kdb.c
trace_kprobe.c
trace_kprobe_selftest.c
trace_kprobe_selftest.h
trace_mmiotrace.c
trace_nop.c
trace_osnoise.c tracing/timerlat: Always wakeup the timerlat thread 2023-06-09 10:34:24 +02:00
trace_output.c
trace_output.h
trace_preemptirq.c
trace_printk.c
trace_probe.c Revert "tracing: Add "(fault)" name injection to kernel probes" 2023-08-03 10:23:55 +02:00
trace_probe.h tracing/probes: Add symstr type for dynamic events 2023-08-03 10:23:54 +02:00
trace_probe_kernel.h tracing/probes: Fix to record 0-length data_loc in fetch_store_string*() if fails 2023-08-03 10:23:55 +02:00
trace_probe_tmpl.h tracing/probes: Fix to record 0-length data_loc in fetch_store_string*() if fails 2023-08-03 10:23:55 +02:00
trace_recursion_record.c
trace_sched_switch.c
trace_sched_wakeup.c tracing: Fix memleak due to race between current_tracer and trace 2023-08-30 16:11:00 +02:00
trace_selftest.c
trace_selftest_dynamic.c
trace_seq.c
trace_stack.c
trace_stat.c
trace_stat.h
trace_synth.h tracing: Allow synthetic events to pass around stacktraces 2023-08-03 10:23:55 +02:00
trace_syscalls.c
trace_uprobe.c bpf: Clear the probe_addr for uprobe 2023-09-13 09:42:30 +02:00
tracing_map.c
tracing_map.h