linux_dsm_epyc7002/tools/perf/util
Wang Nan 421fd0845e perf probe: Verify parameters in two functions
On kernel with only one out of CONFIG_KPROBE_EVENTS and
CONFIG_UPROBE_EVENTS enabled, 'perf probe -d' causes a segfault because
perf_del_probe_events() calls probe_file__get_events() with a negative
fd.

This patch fixes it by adding parameter validation at the entry of
probe_file__get_events() and probe_file__get_rawlist(). Since they are
both non-static public functions (in .h file), parameter verifying is
required.

v1 -> v2: Verify fd at the head of probe_file__get_rawlist() instead of
          checking at call site (suggested by Masami and Arnaldo at [1,2]).

[1] http://lkml.kernel.org/r/50399556C9727B4D88A595C8584AAB37526048E3@GSjpTKYDCembx32.service.hitachi.net
[2] http://lkml.kernel.org/r/20151105155830.GV13236@kernel.org

Signed-off-by: Wang Nan <wangnan0@huawei.com>
Acked-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Zefan Li <lizefan@huawei.com>
Cc: pi3orama@163.com
Link: http://lkml.kernel.org/r/1446803415-83382-1-git-send-email-wangnan0@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2015-11-11 18:41:32 -03:00
..
include perf tools: regs_query_register_offset() infrastructure 2015-09-15 09:48:33 -03:00
intel-pt-decoder perf intel-pt: Make logging slightly more efficient 2015-09-28 16:45:26 -03:00
scripting-engines perf scripting python: Allow for max_stack greater than PERF_MAX_STACK_DEPTH 2015-09-28 17:09:12 -03:00
abspath.c
alias.c
annotate.c perf annotate: Support full source file paths for srcline fix 2015-11-11 18:41:30 -03:00
annotate.h perf annotate: Fix sizeof_sym_hist overflow issue 2015-10-05 16:15:38 -03:00
auxtrace.c perf auxtrace: Add option to synthesize branch stacks on samples 2015-09-28 16:53:44 -03:00
auxtrace.h perf auxtrace: Add option to synthesize branch stacks on samples 2015-09-28 16:53:44 -03:00
bitmap.c
bpf-loader.c perf test: Add 'perf test BPF' 2015-11-06 17:50:03 -03:00
bpf-loader.h perf test: Add 'perf test BPF' 2015-11-06 17:50:03 -03:00
Build perf tools: Enable passing bpf object file to --event 2015-10-28 12:48:12 -03:00
build-id.c perf buildid: Introduce sysfs/filename__sprintf_build_id 2015-08-28 14:53:50 -03:00
build-id.h perf buildid: Introduce sysfs/filename__sprintf_build_id 2015-08-28 14:53:50 -03:00
cache.h perf report: Fix some option handling on --stdio 2015-05-14 10:05:22 -03:00
callchain.c perf tools: Defaults to 'caller' callchain order only if --children is enabled 2015-10-22 15:40:11 -03:00
callchain.h perf tools: Improve call graph documents and help messages 2015-10-22 16:23:19 -03:00
cgroup.c perf cgroup: Use atomic.h for refcounting 2015-05-15 16:12:20 -03:00
cgroup.h perf cgroup: Use atomic.h for refcounting 2015-05-15 16:12:20 -03:00
cloexec.c perf bench numa: Fix to show proper convergence stats 2015-06-25 12:28:35 -03:00
cloexec.h perf tools: Fix build errors with mipsel-linux-uclibc compiler 2015-08-05 16:56:16 -03:00
color.c perf tools: Do not include escape sequences in color_vfprintf return 2015-08-05 16:46:06 -03:00
color.h perf tools: Remove trail argument to color vsprintf 2015-08-05 16:44:02 -03:00
comm.c perf comm: Use atomic.h for refcounting 2015-05-27 12:21:43 -03:00
comm.h perf tools: Add facility to export data in database-friendly way 2014-10-29 10:32:49 -02:00
config.c perf tools: Introduce llvm config options 2015-08-07 10:16:59 -03:00
counts.c perf stat: Move perf_counts struct and functions into separate object 2015-08-08 14:16:49 -03:00
counts.h perf stat: Move perf_counts struct and functions into separate object 2015-08-08 14:16:49 -03:00
cpumap.c perf cpu_map: Add cpu_map__empty_new function 2015-10-27 15:05:36 -03:00
cpumap.h perf cpu_map: Add cpu_map__empty_new function 2015-10-27 15:05:36 -03:00
ctype.c
data-convert-bt.c perf data: Fix signedness of value 2015-04-29 10:37:49 -03:00
data-convert-bt.h perf data: Support using -f to override perf.data file ownership for 'convert' 2015-04-02 13:18:52 -03:00
data.c perf util: Replace strerror with strerror_r for thread-safety 2014-08-15 10:58:35 -03:00
data.h
db-export.c perf db-export: Fix thread ref-counting 2015-05-29 12:43:39 -03:00
db-export.h perf db-export: No need to have ->thread twice in struct export_sample 2015-04-02 13:18:43 -03:00
debug.c perf tools: Introduce veprintf 2015-08-06 15:30:38 -03:00
debug.h perf tools: Introduce veprintf 2015-08-06 15:30:38 -03:00
dso.c perf tools: Reference count struct dso 2015-06-08 10:31:40 -03:00
dso.h perf annotate: Reset the dso find_symbol cache when removing symbols 2015-08-24 13:33:14 -03:00
dwarf-aux.c perf probe: Fix to add missed brace around if block 2015-08-13 14:51:26 -03:00
dwarf-aux.h perf probe: Ignore tail calls to probed functions 2015-05-14 10:05:09 -03:00
env.c perf env: Introduce read_cpu_topology_map() method 2015-09-14 12:50:28 -03:00
env.h perf env: Introduce read_cpu_topology_map() method 2015-09-14 12:50:28 -03:00
environment.c perf report: Fix some option handling on --stdio 2015-05-14 10:05:22 -03:00
event.c perf tools: Fix handling read result using a signed variable 2015-10-06 18:04:59 -03:00
event.h perf session: Warn when AUX data has been lost 2015-09-28 16:51:33 -03:00
evlist.c perf tools: Export perf_event_attr__set_max_precise_ip() 2015-10-05 16:16:20 -03:00
evlist.h perf tools: Export perf_event_attr__set_max_precise_ip() 2015-10-05 16:16:20 -03:00
evsel.c perf bpf: Attach eBPF filter to perf event 2015-10-29 17:16:22 -03:00
evsel.h perf bpf: Attach eBPF filter to perf event 2015-10-29 17:16:22 -03:00
exec_cmd.c
exec_cmd.h
find-vdso-map.c perf tools: Build programs to copy 32-bit compatibility 2014-10-29 10:32:48 -02:00
generate-cmdlist.sh
header.c Merge branch 'perf/urgent' into perf/core, to resolve a conflict 2015-09-16 09:19:56 +02:00
header.h perf env: Move perf_env out of header.h and session.c into separate object 2015-09-14 12:50:19 -03:00
help.c perf tools: Use zfree to help detect use after free bugs 2013-12-27 17:08:19 -03:00
help.h
hist.c perf tools: Setup proper width for symbol_iaddr field 2015-10-05 16:33:41 -03:00
hist.h perf tools: Add support for sorting on the iaddr 2015-10-05 16:32:00 -03:00
intel-bts.c perf tools: Fix use of wrong event when processing exit events 2015-09-02 17:46:26 -03:00
intel-bts.h perf tools: Add Intel BTS support 2015-08-21 11:34:10 -03:00
intel-pt.c perf machine: Add method for common kernel_map(FUNCTION) operation 2015-09-30 18:34:29 -03:00
intel-pt.h perf tools: Pass Intel PT information for decoding MTC and CYC 2015-08-24 17:46:43 -03:00
intlist.c
intlist.h
kvm-stat.h perf kvm: Support using -f to override perf.data.guest file ownership 2015-04-02 13:18:47 -03:00
levenshtein.c
levenshtein.h
llvm-utils.c perf tools: Make fetch_kernel_version() publicly available 2015-11-06 15:57:18 -03:00
llvm-utils.h perf tests: Add LLVM test for eBPF on-the-fly compiling 2015-08-07 10:57:24 -03:00
lzma.c perf tools: Add lzma decompression support for kernel module 2015-03-21 14:53:40 -03:00
machine.c perf callchain: Allow for max_stack greater than PERF_MAX_STACK_DEPTH 2015-10-01 09:56:06 -03:00
machine.h perf machine: Add method for common kernel_map(FUNCTION) operation 2015-09-30 18:34:29 -03:00
map.c perf tools: Insert split maps correctly into origin group 2015-11-05 11:39:38 -03:00
map.h perf maps: Introduce maps__find_symbol_by_name() 2015-09-30 18:34:25 -03:00
ordered-events.c perf ordered_events: Clear the progress bar at the end of a flush 2015-08-24 17:16:22 -03:00
ordered-events.h perf ordered_samples: Remove references to perf_{evlist,tool} and machines 2015-03-31 17:52:32 -03:00
pager.c perf report: Fix some option handling on --stdio 2015-05-14 10:05:22 -03:00
parse-branch-options.c perf record: Add ability to sample call branches 2015-10-20 10:30:55 +02:00
parse-branch-options.h perf tools: Move branch option parsing to own file 2015-05-27 21:02:17 -03:00
parse-events.c perf bpf: Improve BPF related error messages 2015-11-06 17:14:20 -03:00
parse-events.h perf tools: Compile scriptlets to BPF objects when passing '.c' to --event 2015-10-29 17:16:23 -03:00
parse-events.l perf tools: Compile scriptlets to BPF objects when passing '.c' to --event 2015-10-29 17:16:23 -03:00
parse-events.y perf tools: Compile scriptlets to BPF objects when passing '.c' to --event 2015-10-29 17:16:23 -03:00
parse-options.c perf tools: Search for more options when passing args to -h 2015-10-27 17:35:58 -03:00
parse-options.h perf tools: Introduce usage_with_options_msg() 2015-10-27 09:28:44 -03:00
parse-regs-options.c perf record: Add ability to name registers to record 2015-08-31 18:01:33 -03:00
parse-regs-options.h perf record: Add ability to name registers to record 2015-08-31 18:01:33 -03:00
path.c
perf_regs.c perf tools: Fix build break on powerpc due to sample_reg_masks 2015-09-30 18:34:27 -03:00
perf_regs.h perf tools: Fix build break on powerpc due to sample_reg_masks 2015-09-30 18:34:27 -03:00
PERF-VERSION-GEN
pmu.c perf list: Honour 'event_glob' whem printing selectable PMUs 2015-10-02 15:28:16 -03:00
pmu.h perf tools: Add perf_pmu__format_bits() 2015-08-06 16:49:01 -03:00
pmu.l
pmu.y
probe-event.c perf probe: Cleanup find_perf_probe_point_from_map to reduce redundancy 2015-11-06 10:47:33 -03:00
probe-event.h perf probe: Export init/exit_probe_symbol_maps() 2015-09-15 09:48:32 -03:00
probe-file.c perf probe: Verify parameters in two functions 2015-11-11 18:41:32 -03:00
probe-file.h perf probe: Print deleted events in cmd_probe() 2015-09-04 12:43:44 -03:00
probe-finder.c perf probe: Improve error message when %return is on inlined function 2015-09-30 18:34:37 -03:00
probe-finder.h perf probe: Introduce probe_conf global configs 2015-05-08 16:26:26 -03:00
pstack.c perf tools: Introduce pstack_peek() 2015-05-05 18:13:22 -03:00
pstack.h perf tools: Introduce pstack_peek() 2015-05-05 18:13:22 -03:00
python-ext-sources perf stat: Move perf_counts struct and functions into separate object 2015-08-08 14:16:49 -03:00
python.c perf python: Support the PERF_RECORD_SWITCH event 2015-10-07 19:41:50 -03:00
quote.c
quote.h
rblist.c
rblist.h
record.c perf tools: Add a helper function to probe whether cpu-wide tracing is possible 2015-08-17 11:08:37 -03:00
run-command.c perf util: Replace strerror with strerror_r for thread-safety 2014-08-15 10:58:35 -03:00
run-command.h
session.c perf session: Add missing newlines to some pr_err() calls 2015-11-11 18:41:31 -03:00
session.h perf top: Register idle thread 2015-10-01 09:54:33 -03:00
setup.py tools lib api: Rename libapikfs.a to libapi.a 2015-02-12 17:55:18 -03:00
sigchain.c
sigchain.h
sort.c perf tools: Introduce hpp_dimension__add_output function 2015-10-06 18:04:59 -03:00
sort.h perf tools: Introduce hpp_dimension__add_output function 2015-10-06 18:04:59 -03:00
srcline.c perf tools: Always use non inlined file name for 'srcfile' sort key 2015-09-02 16:30:46 -03:00
stat-shadow.c perf stat: Move sw clock metrics printout to stat-shadow 2015-11-04 15:11:41 -03:00
stat.c perf cpu_map: Add data arg to cpu_map__build_map callback 2015-10-19 18:04:01 -03:00
stat.h perf stat: Add AGGR_UNSET mode 2015-10-19 18:02:07 -03:00
strbuf.c perf tools: Introduce usage_with_options_msg() 2015-10-27 09:28:44 -03:00
strbuf.h perf tools: Introduce usage_with_options_msg() 2015-10-27 09:28:44 -03:00
strfilter.c perf tools: Add strfilter__string to recover rules string 2015-05-04 12:43:54 -03:00
strfilter.h perf tools: Add strfilter__string to recover rules string 2015-05-04 12:43:54 -03:00
string.c perf tools: Asprintf like functions to format integer filter expression 2015-07-06 10:21:46 -03:00
strlist.c perf strlist: Make parse_list() private 2015-07-20 14:51:07 -03:00
strlist.h perf strlist: Make parse_list() private 2015-07-20 14:51:07 -03:00
svghelper.c perf tools: Add reference counting for cpu_map object 2015-06-25 15:15:50 -03:00
svghelper.h perf timechart: Implement IO mode 2014-07-10 00:22:54 +02:00
symbol-elf.c perf tools: Fix copying of /proc/kcore 2015-09-25 10:45:50 -03:00
symbol-minimal.c perf symbols: Fix type error when reading a build-id 2015-10-28 10:02:00 -03:00
symbol.c perf symbols: Fix endless loop in dso__split_kallsyms_for_kcore 2015-10-28 11:19:30 -03:00
symbol.h perf tools: Add processor socket info to hist_entry and addr_location 2015-09-14 12:50:29 -03:00
target.c perf target: Simplify handling of strerror_r return 2015-03-24 12:08:30 -03:00
target.h
thread_map.c perf/core improvements and fixes: 2015-07-21 07:58:06 +02:00
thread_map.h perf thrad_map: Add comm string into array 2015-06-26 11:07:01 -03:00
thread-stack.c perf tools: Ensure thread-stack is flushed 2015-06-19 16:03:33 -03:00
thread-stack.h perf tools: Ensure thread-stack is flushed 2015-06-19 16:03:33 -03:00
thread.c perf tools: Avoid deadlock when map_groups are broken 2015-08-19 14:15:09 -03:00
thread.h perf tools: Elliminate alignment holes 2015-05-18 10:17:33 -03:00
tool.h perf tools: Add new PERF_RECORD_SWITCH event 2015-07-23 22:51:13 -03:00
top.c
top.h tools: Consolidate types.h 2014-05-01 21:22:39 +02:00
trace-event-info.c tools lib api fs: Move tracing_path interface into api/fs/tracing_path.c 2015-09-04 12:00:45 -03:00
trace-event-parse.c perf tools: Stop reading the kallsyms data from perf.data 2015-07-23 22:51:11 -03:00
trace-event-read.c perf tools: Stop reading the kallsyms data from perf.data 2015-07-23 22:51:11 -03:00
trace-event-scripting.c perf scripting: No need to pass thread twice to the scripting callbacks 2015-04-02 13:18:41 -03:00
trace-event.c perf evsel: Propagate error info from tp_format 2015-09-15 09:48:33 -03:00
trace-event.h perf scripting python: Allow for max_stack greater than PERF_MAX_STACK_DEPTH 2015-09-28 17:09:12 -03:00
tsc.c perf tools: Move rdtsc() function 2014-07-23 11:48:11 -03:00
tsc.h perf tools: Move rdtsc() function 2014-07-23 11:48:11 -03:00
unwind-libdw.c perf callchains: Use thread->mg->machine 2014-10-29 10:32:46 -02:00
unwind-libdw.h perf tools: Add libdw DWARF post unwind support 2014-02-24 09:29:36 -03:00
unwind-libunwind.c perf unwind: Pass symbol source to libunwind 2015-10-29 17:48:38 -03:00
unwind.h perf callchains: Use thread->mg->machine 2014-10-29 10:32:46 -02:00
usage.c perf test: Suppress libtraceevent warnings 2015-10-19 14:58:10 -03:00
util.c perf tools: Make fetch_kernel_version() publicly available 2015-11-06 15:57:18 -03:00
util.h perf bpf: Improve BPF related error messages 2015-11-06 17:14:20 -03:00
values.c perf tools: Use zfree to help detect use after free bugs 2013-12-27 17:08:19 -03:00
values.h tools: Consolidate types.h 2014-05-01 21:22:39 +02:00
vdso.c perf tools: Fix lockup using 32-bit compat vdso 2015-07-07 11:05:08 -03:00
vdso.h perf machine: Fix up vdso methods names 2015-05-29 12:43:44 -03:00
wrapper.c
xyarray.c perf tools: Introduce xyarray__reset function 2015-06-16 10:34:39 -03:00
xyarray.h perf tools: Introduce xyarray__reset function 2015-06-16 10:34:39 -03:00
zlib.c perf tools: Add gzip decompression support for kernel module 2014-11-05 10:11:26 -03:00