When performing ipsp_ids_free(), grab `ipsec_flows_mtx' mutex(9) before do
authormvs <mvs@openbsd.org>
Sat, 30 Apr 2022 13:28:53 +0000 (13:28 +0000)
committermvs <mvs@openbsd.org>
Sat, 30 Apr 2022 13:28:53 +0000 (13:28 +0000)
commit2af522804e34e651131b12f41358e75900a7af55
tree88aed7acebde9827e1d06a79fe17ecc4e2db7097
parented59e75be739f53d50448a9013dfa6bb55303939
When performing ipsp_ids_free(), grab `ipsec_flows_mtx' mutex(9) before do
`id_refcount' decrement. This should be consistent with `ipsp_ids_gc_list'
list modifications, otherwise concurrent ipsp_ids_insert() could remove
this dying `ids' from the list before if was placed there by
ipsp_ids_free(). This makes atomic operations with `id_refcount' useless.
Also prevent ipsp_ids_lookup() to return dying `ids'.

ok bluhm@
sys/netinet/ip_ipsp.c
sys/netinet/ip_ipsp.h