trap-manager: Prevent deadlock when installing trap policies
authorTobias Brunner <tobias@strongswan.org>
Thu, 7 Nov 2013 08:50:12 +0000 (09:50 +0100)
committerTobias Brunner <tobias@strongswan.org>
Thu, 21 Nov 2013 10:12:59 +0000 (11:12 +0100)
commitbb492d80b55b9f8c1761beb5c93978298cf19f84
treea296795861358cdb8add82184da2c57103a900e6
parent906a4fd16b91a44d8222522d9a2a3589e478a393
trap-manager: Prevent deadlock when installing trap policies

Because the write lock was held while calling add_policies() on
child_sa_t, which finishes with a call to child_state_change() on bus_t,
a deadlock would ensue if CHILD_SAs are concurrently being established,
which also causes a call to child_state_change() that will require
the read lock in trap_manager_t.

No locks are now being held while creating the CHILD_SA and installing the
trap policies.
src/libcharon/sa/trap_manager.c