Skip to content

Commit 0eadcc7

Browse files
liu-song-6ingomolnar
authored andcommitted
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: e12f03d ("perf/core: Implement the 'perf_kprobe' PMU") Signed-off-by: Ingo Molnar <mingo@kernel.org>
1 parent 5da13ab commit 0eadcc7

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎kernel/trace/trace_event_perf.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,8 @@ int perf_uprobe_init(struct perf_event *p_event, bool is_retprobe)
302302
return -ENOMEM;
303303
ret = strncpy_from_user(
304304
path, u64_to_user_ptr(p_event->attr.uprobe_path), PATH_MAX);
305+
if (ret == PATH_MAX)
306+
return -E2BIG;
305307
if (ret < 0)
306308
goto out;
307309
if (path[0] == '\0') {

0 commit comments

Comments
 (0)