linux-stable/kernel/trace
Kalesh Singh 4d8a391e0a tracing/cfi: Fix cmp_entries_* functions signature mismatch
[ Upstream commit 7ce1bb83a1 ]

If CONFIG_CFI_CLANG=y, attempting to read an event histogram will cause
the kernel to panic due to failed CFI check.

    1. echo 'hist:keys=common_pid' >> events/sched/sched_switch/trigger
    2. cat events/sched/sched_switch/hist
    3. kernel panics on attempting to read hist

This happens because the sort() function expects a generic
int (*)(const void *, const void *) pointer for the compare function.
To prevent this CFI failure, change tracing map cmp_entries_* function
signatures to match this.

Also, fix the build error reported by the kernel test robot [1].

[1] https://lore.kernel.org/r/202110141140.zzi4dRh4-lkp@intel.com/

Link: https://lkml.kernel.org/r/20211014045217.3265162-1-kaleshsingh@google.com

Signed-off-by: Kalesh Singh <kaleshsingh@google.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-11-26 11:36:06 +01:00
..
blktrace.c blktrace: Fix uaf in blk_trace access after removing by sysfs 2021-10-06 15:31:15 +02:00
bpf_trace.c tracepoint: Add tracepoint_probe_register_may_exist() for BPF tracing 2021-07-20 16:15:42 +02:00
ftrace.c tracing: Have all levels of checks prevent recursion 2021-10-27 09:53:15 +02:00
Kconfig tracing/kprobes: Do the notrace functions check without kprobes on ftrace 2021-01-19 18:22:35 +01:00
Makefile tracing: Allow gcov profiling on only ftrace subsystem 2018-08-21 09:11:49 -04:00
power-traces.c
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 tracing: Fix bug in rb_per_cpu_empty() that might cause deadloop. 2021-07-28 11:13:50 +02: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
trace.c tracing/histogram: Rename "cpu" to "common_cpu" 2021-08-12 13:19:42 +02:00
trace.h tracing: Have all levels of checks prevent recursion 2021-10-27 09:53:15 +02: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: Do no increment trace_clock_global() by one 2021-06-30 08:48:23 -04:00
trace_entries.h tracing: Set kernel_stack's caller size properly 2020-10-01 13:14:31 +02: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: Do not count ftrace events in top level enable output 2021-02-23 15:00:55 +01: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 / histogram: Fix NULL pointer dereference on strcmp() on NULL event name 2021-08-26 08:36:47 -04: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: Have all levels of checks prevent recursion 2021-10-27 09:53:15 +02: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: Remove WARN_ON in start_thread() 2020-12-08 10:18:55 +01: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/kprobe: Fix kprobe_on_func_entry() modification 2021-09-26 13:39:47 +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
trace_nop.c
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 lockdep: fix order in trace_hardirqs_off_caller() 2020-10-01 13:14:50 +02: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 ftrace: Handle tracing when switching between context 2020-11-10 12:35:58 +01:00
trace_selftest_dynamic.c
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
trace_uprobe.c tracing/uprobes: Fix output for multiple string arguments 2019-02-20 10:25:48 +01:00
tracing_map.c tracing/cfi: Fix cmp_entries_* functions signature mismatch 2021-11-26 11:36:06 +01:00
tracing_map.h tracing: Fix SPDX format headers to use C++ style comments 2018-08-16 19:08:06 -04:00