Fix: Missing RCU read locks in syscall_list_channel()
[lttng-tools.git] / src / bin / lttng-sessiond / syscall.c
index eb81d67429a2d96ac6b062db40940988ad0dd58c..c38f8910940f0b8bb990034ed4fa0fcef0360fef 100644 (file)
@@ -405,11 +405,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) {
@@ -429,7 +432,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.023672 seconds and 4 git commands to generate.