[lttng-dev] [PATCH lttng-tools 2/2] Fix: unbalanced RCU read-side lock in enable event command

Mathieu Desnoyers mathieu.desnoyers at efficios.com
Mon Sep 7 10:36:09 EDT 2015


The event validation fails, an unpaired RCU unlock is performed, thus
underflowing the RCU nesting counter.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers at efficios.com>
---
 src/bin/lttng-sessiond/cmd.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/bin/lttng-sessiond/cmd.c b/src/bin/lttng-sessiond/cmd.c
index 6237d67..ac5b8ec 100644
--- a/src/bin/lttng-sessiond/cmd.c
+++ b/src/bin/lttng-sessiond/cmd.c
@@ -1535,13 +1535,13 @@ static int _cmd_enable_event(struct ltt_session *session,
 
 	DBG("Enable event command for event \'%s\'", event->name);
 
+	rcu_read_lock();
+
 	ret = validate_event_name(event->name);
 	if (ret) {
 		goto error;
 	}
 
-	rcu_read_lock();
-
 	switch (domain->type) {
 	case LTTNG_DOMAIN_KERNEL:
 	{
-- 
2.1.4




More information about the lttng-dev mailing list