All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] perf kvm: fix segfault by initializing file_name to NULL
@ 2013-02-28  3:29 David Ahern
  2013-02-28  4:31 ` Xiao Guangrong
  0 siblings, 1 reply; 5+ messages in thread
From: David Ahern @ 2013-02-28  3:29 UTC (permalink / raw)
  To: acme, linux-kernel; +Cc: David Ahern, Xiao Guangrong, Dongsoo Nathaniel Kim

Dongsoo reported that perf-kvm was segfaulting. The bug was introduced by
commit 3786063 which moved file_name from struct perf_kvm which was
initialized on the stack to an uninitialized stack variable. Fix by
initializing.

Needs to be applied to 3.7 and 3.8 as well.

Signed-off-by: David Ahern <dsahern@gmail.com>
Cc: Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com>
Cc: Dongsoo Nathaniel Kim <dongsoo.kim@gmail.com>
---
 tools/perf/builtin-kvm.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/builtin-kvm.c b/tools/perf/builtin-kvm.c
index ca3f80e..e55701d 100644
--- a/tools/perf/builtin-kvm.c
+++ b/tools/perf/builtin-kvm.c
@@ -973,7 +973,7 @@ __cmd_buildid_list(const char *file_name, int argc, const char **argv)
 
 int cmd_kvm(int argc, const char **argv, const char *prefix __maybe_unused)
 {
-	const char *file_name;
+	const char *file_name = NULL;
 
 	const struct option kvm_options[] = {
 		OPT_STRING('i', "input", &file_name, "file",
-- 
1.7.10.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] perf kvm: fix segfault by initializing file_name to NULL
  2013-02-28  3:29 [PATCH] perf kvm: fix segfault by initializing file_name to NULL David Ahern
@ 2013-02-28  4:31 ` Xiao Guangrong
  2013-02-28  4:43   ` David Ahern
  0 siblings, 1 reply; 5+ messages in thread
From: Xiao Guangrong @ 2013-02-28  4:31 UTC (permalink / raw)
  To: David Ahern; +Cc: acme, linux-kernel, Dongsoo Nathaniel Kim


On 02/28/2013 11:29 AM, David Ahern wrote:
> Dongsoo reported that perf-kvm was segfaulting. The bug was introduced by
> commit 3786063 which moved file_name from struct perf_kvm which was
> initialized on the stack to an uninitialized stack variable. Fix by
> initializing.
> 
> Needs to be applied to 3.7 and 3.8 as well.

David, The bug has already been fixed by by Arnaldo, see:
http://git.kernel.org/?p=virt/kvm/kvm.git;a=commit;h=20914ce5b9e1ef4a35f1f09a2c9c8fb8eb1c4d86


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] perf kvm: fix segfault by initializing file_name to NULL
  2013-02-28  4:31 ` Xiao Guangrong
@ 2013-02-28  4:43   ` David Ahern
  2013-02-28 14:24     ` Arnaldo Carvalho de Melo
  0 siblings, 1 reply; 5+ messages in thread
From: David Ahern @ 2013-02-28  4:43 UTC (permalink / raw)
  To: Xiao Guangrong; +Cc: acme, linux-kernel, Dongsoo Nathaniel Kim

On 2/27/13 9:31 PM, Xiao Guangrong wrote:
>
> On 02/28/2013 11:29 AM, David Ahern wrote:
>> Dongsoo reported that perf-kvm was segfaulting. The bug was introduced by
>> commit 3786063 which moved file_name from struct perf_kvm which was
>> initialized on the stack to an uninitialized stack variable. Fix by
>> initializing.
>>
>> Needs to be applied to 3.7 and 3.8 as well.
>
> David, The bug has already been fixed by by Arnaldo, see:
> http://git.kernel.org/?p=virt/kvm/kvm.git;a=commit;h=20914ce5b9e1ef4a35f1f09a2c9c8fb8eb1c4d86
>

very odd. Arnaldo's latest perf/urgent has the problem -- and no 
initialized variable. Seems to have been dropped somewhere.

David

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] perf kvm: fix segfault by initializing file_name to NULL
  2013-02-28  4:43   ` David Ahern
@ 2013-02-28 14:24     ` Arnaldo Carvalho de Melo
  2013-02-28 15:19       ` David Ahern
  0 siblings, 1 reply; 5+ messages in thread
From: Arnaldo Carvalho de Melo @ 2013-02-28 14:24 UTC (permalink / raw)
  To: David Ahern; +Cc: Xiao Guangrong, linux-kernel, Dongsoo Nathaniel Kim

Em Wed, Feb 27, 2013 at 09:43:31PM -0700, David Ahern escreveu:
> On 2/27/13 9:31 PM, Xiao Guangrong wrote:
> >On 02/28/2013 11:29 AM, David Ahern wrote:
> >>Dongsoo reported that perf-kvm was segfaulting. The bug was introduced by
> >>commit 3786063 which moved file_name from struct perf_kvm which was
> >>initialized on the stack to an uninitialized stack variable. Fix by
> >>initializing.

> >>Needs to be applied to 3.7 and 3.8 as well.

> >David, The bug has already been fixed by by Arnaldo, see:
> >http://git.kernel.org/?p=virt/kvm/kvm.git;a=commit;h=20914ce5b9e1ef4a35f1f09a2c9c8fb8eb1c4d86

> very odd. Arnaldo's latest perf/urgent has the problem -- and no
> initialized variable. Seems to have been dropped somewhere.

Just fast forwarded my perf/urgent to tip/perf/urgent, checked and the
fix is there as pointed out by Xiao.

- Arnaldo

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] perf kvm: fix segfault by initializing file_name to NULL
  2013-02-28 14:24     ` Arnaldo Carvalho de Melo
@ 2013-02-28 15:19       ` David Ahern
  0 siblings, 0 replies; 5+ messages in thread
From: David Ahern @ 2013-02-28 15:19 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Xiao Guangrong, linux-kernel, Dongsoo Nathaniel Kim

On 2/28/13 7:24 AM, Arnaldo Carvalho de Melo wrote:
> Just fast forwarded my perf/urgent to tip/perf/urgent, checked and the
> fix is there as pointed out by Xiao.

hmm.... hanging out in your perf/core branch rather than perf/urgent.

David

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-02-28 15:19 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-28  3:29 [PATCH] perf kvm: fix segfault by initializing file_name to NULL David Ahern
2013-02-28  4:31 ` Xiao Guangrong
2013-02-28  4:43   ` David Ahern
2013-02-28 14:24     ` Arnaldo Carvalho de Melo
2013-02-28 15:19       ` David Ahern

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.