[sr-dev] [kamailio/kamailio] Possible deadlock bug in the method acquire_spi and release_spi? (Issue #2939)

ryancaicse notifications at github.com
Thu Nov 18 06:31:22 CET 2021


In the method `acquire_spi`, the condition of acquiring and releasing is not aligned. It seems the lock would be acquired but released only when `spi_data->spi_val == initial_val`, Would it lead to missing lock release?
https://github.com/kamailio/kamailio/blob/1ddc27f199061025a6a43da3e8a1388fcaddfe19/src/modules/ims_ipsec_pcscf/spi_gen.c#L83-L85
https://github.com/kamailio/kamailio/blob/1ddc27f199061025a6a43da3e8a1388fcaddfe19/src/modules/ims_ipsec_pcscf/spi_gen.c#L109-L111


In the method `release_spi`, the lock may be re-acquired so missing lock release in the method `acquire_spi` could lead to a deadlock.
https://github.com/kamailio/kamailio/blob/1ddc27f199061025a6a43da3e8a1388fcaddfe19/src/modules/ims_ipsec_pcscf/spi_gen.c#L126-L134

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/2939
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-dev/attachments/20211117/34ed991b/attachment-0001.htm>


More information about the sr-dev mailing list