Fix: unbalanced RCU read-side lock in enable event command
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH 2/2 Fix: unbalanced RCU read-side lock in enable event command
The event validation fails, an unpaired RCU unlock is performed, thus underflowing the RCU nesting counter.
--- src/bin/lttng-sessiond/cmd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
src/bin/lttng-sessiond/cmd.c +2 -2
@@ -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 : {
Signature · 1 line
2.1.4
Jérémie Galarneau
AppliedRe: [PATCH lttng-tools 1/2] Add rcu_read_ongoing() assertions around process_client_msg
In reply to a message not in the archiveMerged, thanks!
Jérémie
Quoted 34 lines · Mathieu Desnoyers
process_client_msgensures that RCU read-side lock should not be held when calling it. Validate this usingrcu_read_ongoing()at the entry and exit points of this function. This allows us to catch unbalanced RCU read-side lock within commands quickly.Signed-off-by Mathieu Desnoyers <[email protected]>--- src/bin/lttng-sessiond/main.c | 3 +++ 1 file changed, 3 insertions(+)src/bin/lttng-sessiond/main.c +3
-1@@ -2972,6 +2972,8 @@ static int process_client_msg(struct command_ctx *cmd_ctx, int sock,DBG ("Processing client command %d" , cmd_ctx->lsm->cmd_type); +assert (!rcu_read_ongoing ()); + *sock_error =0 ;switch (cmd_ctx->lsm->cmd_type) {@@ -4059,6 +4061,7 @@ setup_error:session_unlock_list (); } init_setup_error: +assert (!rcu_read_ongoing ());return ret; } --2.1.4
Signature · 8 lines
Jérémie Galarneau EfficiOS Inc. http://www.efficios.com _______________________________________________ lttng-dev mailing list [email protected] http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
A message that is not in the archive (sent off-list or not yet received): [email protected]
Good catch, thanks!
Jérémie
Quoted 31 lines · Mathieu Desnoyers
The event validation fails, an unpaired RCU unlock is performed, thus underflowing the RCU nesting counter.
Signed-off-by Mathieu Desnoyers <[email protected]>--- src/bin/lttng-sessiond/cmd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)src/bin/lttng-sessiond/cmd.c +2
-3@@ -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
Signature · 8 lines
Jérémie Galarneau EfficiOS Inc. http://www.efficios.com _______________________________________________ lttng-dev mailing list [email protected] http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev