]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
vici: Make threads handling requests get canceled explicitly
authorTobias Brunner <tobias@strongswan.org>
Tue, 13 May 2025 14:47:13 +0000 (16:47 +0200)
committerTobias Brunner <tobias@strongswan.org>
Mon, 19 May 2025 15:20:59 +0000 (17:20 +0200)
Threads initiating SAs can get stuck on the semaphore in
wait_for_listener() during shutdown if the corresponding job is never
executed.  A particular case when this can happen is if more initiations
are triggered than worker threads are available.  This causes a (known)
deadlock as no workers are free anymore to process jobs (for inbound
messages or timeouts etc.), including the one to initiate an SA.
This change at least allows a proper shutdown.

src/libcharon/plugins/vici/vici_socket.c

index 156f0c89dc42be0216eff43d8fce344d68032240..1016633ab6108e40c555ce2c1517d4311b928236 100644 (file)
@@ -563,8 +563,8 @@ CALLBACK(on_read, bool,
                                        .id = entry->id,
                                );
                                lib->processor->queue_job(lib->processor,
-                                                       (job_t*)callback_job_create(process_queue,
-                                                                                                               sel, free, NULL));
+                                                       (job_t*)callback_job_create(process_queue, sel,
+                                                                                       free, callback_job_cancel_thread));
                                entry->has_processor = TRUE;
                        }
                }