summaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorSong Liu <songliubraving@fb.com>2018-04-09 18:31:30 +0000
committerIngo Molnar <mingo@kernel.org>2018-04-10 07:33:10 +0200
commit0eadcc7a7bc03e991d2da1cf88143fb7cc0342c1 (patch)
treef7fad440d2cb2eef58928c8947717a2e9a6132fa /kernel
parent5da13ab8b0dcaa984c45ae43edf5a4d148603d42 (diff)
downloadlinux-0eadcc7a7bc03e991d2da1cf88143fb7cc0342c1.tar.gz
linux-0eadcc7a7bc03e991d2da1cf88143fb7cc0342c1.tar.bz2
linux-0eadcc7a7bc03e991d2da1cf88143fb7cc0342c1.zip
perf/core: Fix perf_uprobe_init()
Similarly to the uprobe PMU fix in perf_kprobe_init(), fix error handling in perf_uprobe_init() as well. Reported-by: 范龙飞 <long7573@126.com> Signed-off-by: Song Liu <songliubraving@fb.com> Acked-by: Masami Hiramatsu <mhiramat@kernel.org> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Fixes: e12f03d7031a ("perf/core: Implement the 'perf_kprobe' PMU") Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/trace/trace_event_perf.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/kernel/trace/trace_event_perf.c b/kernel/trace/trace_event_perf.c
index 94600f1f7efa..c79193e598f5 100644
--- a/kernel/trace/trace_event_perf.c
+++ b/kernel/trace/trace_event_perf.c
@@ -302,6 +302,8 @@ int perf_uprobe_init(struct perf_event *p_event, bool is_retprobe)
return -ENOMEM;
ret = strncpy_from_user(
path, u64_to_user_ptr(p_event->attr.uprobe_path), PATH_MAX);
+ if (ret == PATH_MAX)
+ return -E2BIG;
if (ret < 0)
goto out;
if (path[0] == '\0') {