From 24eb8569dc841f318d7964ca9a0ad0a4f9508a8e Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Mon, 1 Dec 2014 22:07:03 -0500 Subject: [PATCH] Fix: Missing RCU read locks in syscall_list_channel() MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérémie Galarneau --- src/bin/lttng-sessiond/syscall.c | 6 ++++++ 1 file changed, 6 insertions(+) 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; } -- 2.34.1