* [PATCH 2/6] tracepoint: Check if the probe has been registered
@ 2008-10-10 13:16 Frederic Weisbecker
2008-10-10 14:00 ` Ingo Molnar
0 siblings, 1 reply; 7+ messages in thread
From: Frederic Weisbecker @ 2008-10-10 13:16 UTC (permalink / raw)
To: Ingo Molnar; +Cc: Mathieu Desnoyers, Linux-Kernel, Frederic Weisbecker
If we try to remove a probe that has not been already registered,
the tracepoint_entry_remove_probe() function will dereference a NULL
pointer.
Check the probe before removing it to avoid crashes.
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
---
kernel/tracepoint.c | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/kernel/tracepoint.c b/kernel/tracepoint.c
index f2b7c28..af8c856 100644
--- a/kernel/tracepoint.c
+++ b/kernel/tracepoint.c
@@ -131,6 +131,9 @@ tracepoint_entry_remove_probe(struct tracepoint_entry *entry, void *probe)
old = entry->funcs;
+ if (!old)
+ return NULL;
+
debug_print_probes(entry);
/* (N -> M), (N > 1, M >= 0) probes */
for (nr_probes = 0; old[nr_probes]; nr_probes++) {
@@ -388,6 +391,11 @@ int tracepoint_probe_unregister(const char *name, void *probe)
if (entry->rcu_pending)
rcu_barrier_sched();
old = tracepoint_entry_remove_probe(entry, probe);
+ if (!old) {
+ printk(KERN_WARNING "Warning: Trying to unregister a probe"
+ "that doesn't exist\n");
+ goto end;
+ }
mutex_unlock(&tracepoints_mutex);
tracepoint_update_probes(); /* may update entry */
mutex_lock(&tracepoints_mutex);
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH 2/6] tracepoint: Check if the probe has been registered
2008-10-10 13:16 [PATCH 2/6] tracepoint: Check if the probe has been registered Frederic Weisbecker
@ 2008-10-10 14:00 ` Ingo Molnar
2008-10-10 15:43 ` Mathieu Desnoyers
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Ingo Molnar @ 2008-10-10 14:00 UTC (permalink / raw)
To: Frederic Weisbecker; +Cc: Mathieu Desnoyers, Linux-Kernel, Steven Rostedt
* Frederic Weisbecker <fweisbec@gmail.com> wrote:
> If we try to remove a probe that has not been already registered, the
> tracepoint_entry_remove_probe() function will dereference a NULL
> pointer. Check the probe before removing it to avoid crashes.
>
> Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
> ---
> kernel/tracepoint.c | 8 ++++++++
> 1 files changed, 8 insertions(+), 0 deletions(-)
applied to tip/tracing/tracepoints, thanks Frederic!
Mathieu, Steve, any objections/observations?
Ingo
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 2/6] tracepoint: Check if the probe has been registered
2008-10-10 14:00 ` Ingo Molnar
@ 2008-10-10 15:43 ` Mathieu Desnoyers
2008-10-10 16:53 ` Steven Rostedt
2008-10-13 9:43 ` Frédéric Weisbecker
2 siblings, 0 replies; 7+ messages in thread
From: Mathieu Desnoyers @ 2008-10-10 15:43 UTC (permalink / raw)
To: Ingo Molnar; +Cc: Frederic Weisbecker, Linux-Kernel, Steven Rostedt
* Ingo Molnar (mingo@elte.hu) wrote:
>
> * Frederic Weisbecker <fweisbec@gmail.com> wrote:
>
> > If we try to remove a probe that has not been already registered, the
> > tracepoint_entry_remove_probe() function will dereference a NULL
> > pointer. Check the probe before removing it to avoid crashes.
> >
> > Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
> > ---
> > kernel/tracepoint.c | 8 ++++++++
> > 1 files changed, 8 insertions(+), 0 deletions(-)
>
> applied to tip/tracing/tracepoints, thanks Frederic!
>
> Mathieu, Steve, any objections/observations?
>
Looks good to me. Thanks !
Acked-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
Mathieu
> Ingo
--
Mathieu Desnoyers
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F BA06 3F25 A8FE 3BAE 9A68
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 2/6] tracepoint: Check if the probe has been registered
2008-10-10 14:00 ` Ingo Molnar
2008-10-10 15:43 ` Mathieu Desnoyers
@ 2008-10-10 16:53 ` Steven Rostedt
2008-10-10 16:55 ` Steven Rostedt
2008-10-13 9:43 ` Frédéric Weisbecker
2 siblings, 1 reply; 7+ messages in thread
From: Steven Rostedt @ 2008-10-10 16:53 UTC (permalink / raw)
To: Ingo Molnar; +Cc: Frederic Weisbecker, Mathieu Desnoyers, Linux-Kernel
On Fri, 10 Oct 2008, Ingo Molnar wrote:
>
> * Frederic Weisbecker <fweisbec@gmail.com> wrote:
>
> > If we try to remove a probe that has not been already registered, the
> > tracepoint_entry_remove_probe() function will dereference a NULL
> > pointer. Check the probe before removing it to avoid crashes.
> >
> > Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
> > ---
> > kernel/tracepoint.c | 8 ++++++++
> > 1 files changed, 8 insertions(+), 0 deletions(-)
>
> applied to tip/tracing/tracepoints, thanks Frederic!
>
> Mathieu, Steve, any objections/observations?
Hmm, my email was on the fritz for this one. I'll have to search for it on
a mailing list web site to see the patch.
-- Steve
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 2/6] tracepoint: Check if the probe has been registered
2008-10-10 16:53 ` Steven Rostedt
@ 2008-10-10 16:55 ` Steven Rostedt
0 siblings, 0 replies; 7+ messages in thread
From: Steven Rostedt @ 2008-10-10 16:55 UTC (permalink / raw)
To: Ingo Molnar; +Cc: Frederic Weisbecker, Mathieu Desnoyers, Linux-Kernel
On Fri, 10 Oct 2008, Steven Rostedt wrote:
> >
> > Mathieu, Steve, any objections/observations?
>
> Hmm, my email was on the fritz for this one. I'll have to search for it on
> a mailing list web site to see the patch.
OK, found it at
http://groups.google.com/group/linux.kernel/browse_thread/thread/9519141803211fee/70a273bb6a1ea602?lnk=raot
Looks good for me too.
Acked-by: Steven Rostedt <srostedt@redhat.com>
-- Steve
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 2/6] tracepoint: Check if the probe has been registered
2008-10-10 14:00 ` Ingo Molnar
2008-10-10 15:43 ` Mathieu Desnoyers
2008-10-10 16:53 ` Steven Rostedt
@ 2008-10-13 9:43 ` Frédéric Weisbecker
2008-10-27 16:10 ` Ingo Molnar
2 siblings, 1 reply; 7+ messages in thread
From: Frédéric Weisbecker @ 2008-10-13 9:43 UTC (permalink / raw)
To: Ingo Molnar; +Cc: Mathieu Desnoyers, Linux-Kernel, Steven Rostedt
2008/10/10 Ingo Molnar <mingo@elte.hu>:
> applied to tip/tracing/tracepoints, thanks Frederic!
Hi Ingo.
Are you sure it has been applied? It seems to be lost in the sea :)
Thanks....
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 2/6] tracepoint: Check if the probe has been registered
2008-10-13 9:43 ` Frédéric Weisbecker
@ 2008-10-27 16:10 ` Ingo Molnar
0 siblings, 0 replies; 7+ messages in thread
From: Ingo Molnar @ 2008-10-27 16:10 UTC (permalink / raw)
To: Frédéric Weisbecker
Cc: Mathieu Desnoyers, Linux-Kernel, Steven Rostedt
* Frédéric Weisbecker <fweisbec@gmail.com> wrote:
> 2008/10/10 Ingo Molnar <mingo@elte.hu>:
> > applied to tip/tracing/tracepoints, thanks Frederic!
>
> Hi Ingo.
>
> Are you sure it has been applied? It seems to be lost in the sea :)
>
> Thanks....
should be this one:
f66af45: tracepoint: check if the probe has been registered
Ingo
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2008-10-27 16:11 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-10 13:16 [PATCH 2/6] tracepoint: Check if the probe has been registered Frederic Weisbecker
2008-10-10 14:00 ` Ingo Molnar
2008-10-10 15:43 ` Mathieu Desnoyers
2008-10-10 16:53 ` Steven Rostedt
2008-10-10 16:55 ` Steven Rostedt
2008-10-13 9:43 ` Frédéric Weisbecker
2008-10-27 16:10 ` Ingo Molnar
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox