mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 02:30:34 +02: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: 范龙飞 <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: e12f03d703 ("perf/core: Implement the 'perf_kprobe' PMU")
Signed-off-by: Ingo Molnar <mingo@kernel.org>
			
			
This commit is contained in:
		
							parent
							
								
									5da13ab8b0
								
							
						
					
					
						commit
						0eadcc7a7b
					
				
					 1 changed files with 2 additions and 0 deletions
				
			
		| 
						 | 
					@ -302,6 +302,8 @@ int perf_uprobe_init(struct perf_event *p_event, bool is_retprobe)
 | 
				
			||||||
		return -ENOMEM;
 | 
							return -ENOMEM;
 | 
				
			||||||
	ret = strncpy_from_user(
 | 
						ret = strncpy_from_user(
 | 
				
			||||||
		path, u64_to_user_ptr(p_event->attr.uprobe_path), PATH_MAX);
 | 
							path, u64_to_user_ptr(p_event->attr.uprobe_path), PATH_MAX);
 | 
				
			||||||
 | 
						if (ret == PATH_MAX)
 | 
				
			||||||
 | 
							return -E2BIG;
 | 
				
			||||||
	if (ret < 0)
 | 
						if (ret < 0)
 | 
				
			||||||
		goto out;
 | 
							goto out;
 | 
				
			||||||
	if (path[0] == '\0') {
 | 
						if (path[0] == '\0') {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue