* [PATCH -tip ] [BUGFIX] tracing/kprobe: Fix NULL pointer deref check
@ 2011-02-14 5:48 Masami Hiramatsu
2011-02-14 13:52 ` [tip:perf/core] " tip-bot for Masami Hiramatsu
0 siblings, 1 reply; 2+ messages in thread
From: Masami Hiramatsu @ 2011-02-14 5:48 UTC (permalink / raw)
To: Arnaldo Carvalho de Melo, Ingo Molnar
Cc: linux-kernel, 2nddept-manager, Masami Hiramatsu, Ingo Molnar,
Peter Zijlstra
Add NULL check for avoiding NULL pointer deref.
This bug has been introduced by
1ff511e35ed87cc2ebade9e678e4a2fe39b6f9c5, which causes
a null pointer dereference bug when kprobe-tracer parses
an argument without type.
Signed-off-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Reported-by: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Peter Zijlstra <peterz@infradead.org>
---
kernel/trace/trace_kprobe.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/kernel/trace/trace_kprobe.c b/kernel/trace/trace_kprobe.c
index ccdc542..8435b43 100644
--- a/kernel/trace/trace_kprobe.c
+++ b/kernel/trace/trace_kprobe.c
@@ -935,7 +935,7 @@ static int parse_probe_arg(char *arg, struct trace_probe *tp,
parg->offset = tp->size;
tp->size += parg->type->size;
ret = __parse_probe_arg(arg, parg->type, &parg->fetch, is_return);
- if (ret >= 0)
+ if (ret >= 0 && t != NULL)
ret = __parse_bitfield_probe_arg(t, parg->type, &parg->fetch);
if (ret >= 0) {
parg->fetch_size.fn = get_fetch_size_function(parg->type,
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [tip:perf/core] tracing/kprobe: Fix NULL pointer deref check
2011-02-14 5:48 [PATCH -tip ] [BUGFIX] tracing/kprobe: Fix NULL pointer deref check Masami Hiramatsu
@ 2011-02-14 13:52 ` tip-bot for Masami Hiramatsu
0 siblings, 0 replies; 2+ messages in thread
From: tip-bot for Masami Hiramatsu @ 2011-02-14 13:52 UTC (permalink / raw)
To: linux-tip-commits
Cc: linux-kernel, acme, hpa, mingo, acme, peterz,
masami.hiramatsu.pt, tglx, mingo
Commit-ID: 0de4b34d466bae571b50f41c7296b85248205e35
Gitweb: http://git.kernel.org/tip/0de4b34d466bae571b50f41c7296b85248205e35
Author: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
AuthorDate: Mon, 14 Feb 2011 14:48:07 +0900
Committer: Ingo Molnar <mingo@elte.hu>
CommitDate: Mon, 14 Feb 2011 12:09:53 +0100
tracing/kprobe: Fix NULL pointer deref check
Add NULL check for avoiding NULL pointer deref.
This bug has been introduced by:
1ff511e35ed8: tracing/kprobes: Add bitfield type
which causes a null pointer dereference bug when kprobe-tracer
parses an argument without type.
Reported-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: 2nddept-manager@sdl.hitachi.co.jp
Cc: Peter Zijlstra <peterz@infradead.org>
LKML-Reference: <20110214054807.8919.69740.stgit@ltc236.sdl.hitachi.co.jp>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Reported-by: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
---
kernel/trace/trace_kprobe.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/kernel/trace/trace_kprobe.c b/kernel/trace/trace_kprobe.c
index ccdc542..8435b43 100644
--- a/kernel/trace/trace_kprobe.c
+++ b/kernel/trace/trace_kprobe.c
@@ -935,7 +935,7 @@ static int parse_probe_arg(char *arg, struct trace_probe *tp,
parg->offset = tp->size;
tp->size += parg->type->size;
ret = __parse_probe_arg(arg, parg->type, &parg->fetch, is_return);
- if (ret >= 0)
+ if (ret >= 0 && t != NULL)
ret = __parse_bitfield_probe_arg(t, parg->type, &parg->fetch);
if (ret >= 0) {
parg->fetch_size.fn = get_fetch_size_function(parg->type,
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-02-14 18:08 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-14 5:48 [PATCH -tip ] [BUGFIX] tracing/kprobe: Fix NULL pointer deref check Masami Hiramatsu
2011-02-14 13:52 ` [tip:perf/core] " tip-bot for Masami Hiramatsu
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.