mirror of
https://github.com/torvalds/linux.git
synced 2026-10-07 05:31:08 -04:00
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: 范龙飞 <[email protected]>
Signed-off-by: Song Liu <[email protected]>
Acked-by: Masami Hiramatsu <[email protected]>
Cc: Linus Torvalds <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Fixes: e12f03d703 ("perf/core: Implement the 'perf_kprobe' PMU")
Signed-off-by: Ingo Molnar <[email protected]>
This commit is contained in:
1 parent
5da13ab8b0
commit
0eadcc7a7b
1 file changed
+2
@@ -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') {
|
||||
|
||||
Reference in new issue
Block a user