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:03 +0000 (22:07 -0500)
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
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;
                }
 
                        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 = 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) {
 
                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:
        return count;
 
 error:
+       rcu_read_lock();
        destroy_syscall_ht(syscalls_ht);
        destroy_syscall_ht(syscalls_ht);
+       rcu_read_unlock();
+
        free(events);
        return ret;
 }
        free(events);
        return ret;
 }
This page took 0.025116 seconds and 4 git commands to generate.