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

Jérémie Galarneau jeremie.galarneau at efficios.com
Tue Sep 8 08:25:12 EDT 2015


Good catch, thanks!

Jérémie

On Mon, Sep 7, 2015 at 10:36 AM, Mathieu Desnoyers
<mathieu.desnoyers at efficios.com> wrote:
> 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
>



-- 
Jérémie Galarneau
EfficiOS Inc.
http://www.efficios.com



More information about the lttng-dev mailing list