From 70eb2f6fb8b5ee08fce4c970a498c0cdc3e69bf3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Mon, 19 Jul 2021 17:17:39 -0400 Subject: [PATCH] Fix: sessiond: notification: missing unlock on client skip MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Skipping a client must be performed by using the dedicated "skip_client" label which will unlock the client's lock before continuing the loop rather than using 'continue' directly. Currently, a client will remain locked when an hidden trigger emits a notification to which it is subscribed. 1458230 Missing unlock May result in deadlock if there is another attempt to acquire the lock. In notification_client_list_send_evaluation: Missing a release of a lock on a path (CWE-667) Reported-by: Coverity Scan Signed-off-by: Jérémie Galarneau Change-Id: I8b69395b91b0ea59ae5e0beadebd9099db623121 --- src/bin/lttng-sessiond/notification-thread-events.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/bin/lttng-sessiond/notification-thread-events.c b/src/bin/lttng-sessiond/notification-thread-events.c index 9e5ec5091..747740233 100644 --- a/src/bin/lttng-sessiond/notification-thread-events.c +++ b/src/bin/lttng-sessiond/notification-thread-events.c @@ -4421,7 +4421,8 @@ int notification_client_list_send_evaluation( * Notifications resulting from an hidden trigger are * only sent to the session daemon. */ - continue; + DBG("Skipping client as the trigger is hidden and the client is not the session daemon"); + goto skip_client; } if (source_object_creds) { -- 2.34.1