Re: [PATCH 1/2] perf probe: Only call probe_file__get_events() when fd is valid

2015-11-05 Thread 'Arnaldo Carvalho de Melo'
Em Thu, Nov 05, 2015 at 03:07:23PM +, 平松雅巳 / HIRAMATU,MASAMI escreveu: > From: Arnaldo Carvalho de Melo [mailto:a...@kernel.org] > >Em Thu, Nov 05, 2015 at 01:19:24PM +, Wang Nan escreveu: > >> In system with kprobe enabled but uprobe turned off, 'perf probe -d' > >> causes segfault because

RE: [PATCH 1/2] perf probe: Only call probe_file__get_events() when fd is valid

2015-11-05 Thread 平松雅巳 / HIRAMATU,MASAMI
From: Arnaldo Carvalho de Melo [mailto:a...@kernel.org] >Em Thu, Nov 05, 2015 at 01:19:24PM +, Wang Nan escreveu: >> In system with kprobe enabled but uprobe turned off, 'perf probe -d' >> causes segfault because it calls probe_file__get_events() with a >> negative fd (when deleting uprobe even

Re: [PATCH 1/2] perf probe: Only call probe_file__get_events() when fd is valid

2015-11-05 Thread Arnaldo Carvalho de Melo
Em Thu, Nov 05, 2015 at 01:19:24PM +, Wang Nan escreveu: > In system with kprobe enabled but uprobe turned off, 'perf probe -d' > causes segfault because it calls probe_file__get_events() with a > negative fd (when deleting uprobe events). > > This patch validates fds before calling probe_file

RE: [PATCH 1/2] perf probe: Only call probe_file__get_events() when fd is valid

2015-11-05 Thread 平松雅巳 / HIRAMATU,MASAMI
From: Wang Nan [mailto:wangn...@huawei.com] > >In system with kprobe enabled but uprobe turned off, 'perf probe -d' >causes segfault because it calls probe_file__get_events() with a >negative fd (when deleting uprobe events). Hmm, OK. This may happen if user runs perf probe on the kernel which onl

[PATCH 1/2] perf probe: Only call probe_file__get_events() when fd is valid

2015-11-05 Thread Wang Nan
In system with kprobe enabled but uprobe turned off, 'perf probe -d' causes segfault because it calls probe_file__get_events() with a negative fd (when deleting uprobe events). This patch validates fds before calling probe_file__get_events(). Signed-off-by: Wang Nan Cc: Arnaldo Carvalho de Melo