Fix: Missing RCU locks on access to consumerd's channel ht
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 4 Jun 2013 03:19:59 +0000 (23:19 -0400)
committerDavid Goulet <dgoulet@efficios.com>
Tue, 4 Jun 2013 14:42:57 +0000 (10:42 -0400)
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
src/common/consumer.c

index 3709092198e5a9d1fcf6781134ba7e645ce3e202..6fd716bdb4cd34ff881659702ab88518097175b7 100644 (file)
@@ -2716,16 +2716,20 @@ restart:
 
                                                lttng_ht_node_init_u64(&chan->wait_fd_node,
                                                        chan->wait_fd);
+                                               rcu_read_lock();
                                                lttng_ht_add_unique_u64(channel_ht,
                                                                &chan->wait_fd_node);
+                                               rcu_read_unlock();
                                                /* Add channel to the global poll events list */
                                                lttng_poll_add(&events, chan->wait_fd,
                                                                LPOLLIN | LPOLLPRI);
                                                break;
                                        case CONSUMER_CHANNEL_DEL:
                                        {
+                                               rcu_read_lock();
                                                chan = consumer_find_channel(key);
                                                if (!chan) {
+                                                       rcu_read_unlock();
                                                        ERR("UST consumer get channel key %" PRIu64 " not found for del channel", key);
                                                        break;
                                                }
@@ -2741,6 +2745,7 @@ restart:
                                                if (!uatomic_sub_return(&chan->refcount, 1)) {
                                                        consumer_del_channel(chan);
                                                }
+                                               rcu_read_unlock();
                                                goto restart;
                                        }
                                        case CONSUMER_CHANNEL_QUIT:
This page took 0.026665 seconds and 4 git commands to generate.