]> git.ipfire.org Git - thirdparty/strongswan.git/commit
ike-sa-manager: Avoid deadlock due to race condition during shutdown
authorTobias Brunner <tobias@strongswan.org>
Mon, 11 Aug 2025 12:24:16 +0000 (14:24 +0200)
committerTobias Brunner <tobias@strongswan.org>
Fri, 22 Aug 2025 13:26:59 +0000 (15:26 +0200)
commitd662a69d9dd2d9cb8816307d30ec052e69102f73
treec7d03f42caefb4f6fb59ad5a1d7c556d3d15adaa
parent3e0123526fc2e0bac52585428f44362934cab8c2
ike-sa-manager: Avoid deadlock due to race condition during shutdown

If an entry is added while we wait for a checked out SA in flush() (e.g.
due to an action performed by that SA), new entries might get inserted
before the one we wait for.  If that was the first entry in the row, we
didn't correctly update the table and the new entries were basically lost
by overwriting the first entry in the row.  As the SA count was still
increased but the new entries couldn't get enumerated, the daemon wasn't
terminated properly but was stuck in the loop in flush().
src/libcharon/sa/ike_sa_manager.c