From 150c54ffa2dd2891e3320ac2b5387aaa541086eb 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 b4f2e1eca..14bf6a8ef 100644 --- a/src/bin/lttng-sessiond/syscall.c +++ b/src/bin/lttng-sessiond/syscall.c @@ -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; } -- 2.34.1