Fix: Missing RCU read locks in syscall_list_channel()
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 2 Dec 2014 03:07:03 +0000 (22:07 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 2 Dec 2014 03:07:44 +0000 (22:07 -0500)
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/bin/lttng-sessiond/syscall.c

index b4f2e1eca92f2fb726aa774f8bc94f384bc2f000..14bf6a8ef70b0520d74b4730ae53051b8d1613e8 100644 (file)
@@ -404,11 +404,14 @@ ssize_t syscall_list_channel(struct ltt_kernel_channel *kchan,
                        events = new_events;
                }
 
+               rcu_read_lock();
                ksyscall = lookup_syscall(syscalls_ht, syscall_table[i].name);
                if (ksyscall) {
                        update_event_syscall_bitness(events, i, ksyscall->index);
                        continue;
                }
+               ksyscall = NULL;
+               rcu_read_unlock();
 
                ret = add_syscall_to_ht(syscalls_ht, i, count);
                if (ret < 0) {
@@ -428,7 +431,10 @@ ssize_t syscall_list_channel(struct ltt_kernel_channel *kchan,
        return count;
 
 error:
+       rcu_read_lock();
        destroy_syscall_ht(syscalls_ht);
+       rcu_read_unlock();
+
        free(events);
        return ret;
 }
This page took 0.030379 seconds and 4 git commands to generate.