[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20060914153743.GC29906@Krystal>
Date: Thu, 14 Sep 2006 11:37:43 -0400
From: Mathieu Desnoyers <mathieu.desnoyers@...ymtl.ca>
To: "Serge E. Hallyn" <serue@...ibm.com>
Cc: linux-kernel@...r.kernel.org,
Christoph Hellwig <hch@...radead.org>,
Andrew Morton <akpm@...l.org>, Ingo Molnar <mingo@...hat.com>,
Greg Kroah-Hartman <gregkh@...e.de>,
Thomas Gleixner <tglx@...utronix.de>,
Tom Zanussi <zanussi@...ibm.com>, ltt-dev@...fik.org,
Michel Dagenais <michel.dagenais@...ymtl.ca>
Subject: Re: [PATCH 4/11] LTTng-core 0.5.108 : core
* Serge E. Hallyn (serue@...ibm.com) wrote:
> Hi,
>
> I'm wondering why this is safe:
>
> you grab references to the object which may be deleted after
> you drop the transport_list_lock at the top of this block. Since
> a later patch shows the unregister being called right before the
> owning module is unloaded, that seems awefuly dangerous.
>
> Is there some other magic going on making this safe?
>
The ltt_traces_sem mutex is intended to make this safe. However, the transport
separation patch, contributed recently, uses its own transport_list_lock, which
seems to be broken.
I will fix it by using ltt_traces_sem around :
down(<t_traces_sem);
list_for_each_entry(tran, <t_transport_list, node) {
if (!strcmp(tran->name, trace_type)) {
transport = tran;
break;
}
}
if (!transport) {
err = EINVAL;
printk(KERN_ERR "LTT : Transport %s is not present.\n", trace_type);
goto trace_error;
}
if(!try_module_get(transport->owner)) {
err = ENODEV;
printk(KERN_ERR "LTT : Can't lock transport module.\n");
goto trace_error;
}
up(<t_traces_sem);
And change the transport_list_lock for ltt_traces_sem everywhere else.
Thanks for spotting this bug,
Mathieu
OpenPGP public key: http://krystal.dyndns.org:8080/key/compudj.gpg
Key fingerprint: 8CD5 52C3 8E3C 4140 715F BA06 3F25 A8FE 3BAE 9A68
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists