All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Ahern <dsahern@gmail.com>
To: acme@ghostprotocols.net, linux-kernel@vger.kernel.org
Cc: David Ahern <dsahern@gmail.com>,
	Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com>,
	Dongsoo Nathaniel Kim <dongsoo.kim@gmail.com>
Subject: [PATCH] perf kvm: fix segfault by initializing file_name to NULL
Date: Wed, 27 Feb 2013 20:29:57 -0700	[thread overview]
Message-ID: <1362022197-38929-1-git-send-email-dsahern@gmail.com> (raw)

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


             reply	other threads:[~2013-02-28  3:30 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-28  3:29 David Ahern [this message]
2013-02-28  4:31 ` [PATCH] perf kvm: fix segfault by initializing file_name to NULL 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1362022197-38929-1-git-send-email-dsahern@gmail.com \
    --to=dsahern@gmail.com \
    --cc=acme@ghostprotocols.net \
    --cc=dongsoo.kim@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=xiaoguangrong@linux.vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.