From: Jérémie Galarneau Date: Tue, 2 Dec 2014 03:07:03 +0000 (-0500) Subject: Fix: Missing RCU read locks in syscall_list_channel() X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=24eb8569dc841f318d7964ca9a0ad0a4f9508a8e;p=lttng-tools.git Fix: Missing RCU read locks in syscall_list_channel() Signed-off-by: Jérémie Galarneau --- diff --git a/src/bin/lttng-sessiond/syscall.c b/src/bin/lttng-sessiond/syscall.c index eb81d6742..c38f89109 100644 --- a/src/bin/lttng-sessiond/syscall.c +++ b/src/bin/lttng-sessiond/syscall.c @@ -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; }