提交 0eadcc7a 编写于 作者: S Song Liu 提交者: Ingo Molnar

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: N范龙飞 <long7573@126.com>
Signed-off-by: NSong Liu <songliubraving@fb.com>
Acked-by: NMasami Hiramatsu <mhiramat@kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Fixes: e12f03d7 ("perf/core: Implement the 'perf_kprobe' PMU")
Signed-off-by: NIngo Molnar <mingo@kernel.org>
上级 5da13ab8
......@@ -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') {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册