Fix: sessiond: notification: use after free of trigger object
[lttng-tools.git] / src / bin / lttng-sessiond / notification-thread-internal.h
index eb23d1f78fa2df8d106cdb9fe4caddf1177bb90d..38d968a4dbd685996ff0d1da92c5a383bccf1125 100644 (file)
@@ -75,6 +75,17 @@ struct channel_info {
        struct rcu_head rcu_node;
 };
 
        struct rcu_head rcu_node;
 };
 
+/*
+ * Facilities to carry the different notifications type in the action
+ * processing code path.
+ */
+struct lttng_event_notifier_notification {
+       uint64_t tracer_token;
+       enum lttng_domain_type type;
+       size_t capture_buf_size;
+       char *capture_buffer;
+};
+
 struct notification_client_list_element {
        struct notification_client *client;
        struct cds_list_head node;
 struct notification_client_list_element {
        struct notification_client *client;
        struct cds_list_head node;
@@ -102,8 +113,9 @@ struct notification_client_list_element {
 struct notification_client_list {
        pthread_mutex_t lock;
        struct urcu_ref ref;
 struct notification_client_list {
        pthread_mutex_t lock;
        struct urcu_ref ref;
-       const struct lttng_trigger *trigger;
-       struct cds_list_head list;
+       struct lttng_condition *condition;
+       struct cds_list_head triggers_list;
+       struct cds_list_head clients_list;
        /* Weak reference to container. */
        struct cds_lfht *notification_trigger_clients_ht;
        struct cds_lfht_node notification_trigger_clients_ht_node;
        /* Weak reference to container. */
        struct cds_lfht *notification_trigger_clients_ht;
        struct cds_lfht_node notification_trigger_clients_ht_node;
@@ -239,4 +251,18 @@ int notification_thread_client_communication_update(
                notification_client_id id,
                enum client_transmission_status transmission_status);
 
                notification_client_id id,
                enum client_transmission_status transmission_status);
 
+/*
+ * Takes ownership of the payload if present.
+ */
+LTTNG_HIDDEN
+struct lttng_event_notifier_notification *lttng_event_notifier_notification_create(
+               uint64_t tracer_token,
+               enum lttng_domain_type domain,
+               char *payload,
+               size_t payload_size);
+
+LTTNG_HIDDEN
+void lttng_event_notifier_notification_destroy(
+               struct lttng_event_notifier_notification *event_notifier_notification);
+
 #endif /* NOTIFICATION_THREAD_INTERNAL_H */
 #endif /* NOTIFICATION_THREAD_INTERNAL_H */
This page took 0.023633 seconds and 4 git commands to generate.