mirror of
https://github.com/opnsense/src.git
synced 2026-06-09 08:43:19 -04:00
ipsec: Drain async ipsec_offload work when destroying a vnet
Re-apply commite196b12f4d. This was reverted by commit28294dc924because it could trigger a deadlock, but the underlying problem there was fixed in commitf76826b892. Reported by: KASAN Reviewed by: kib Fixes:ef2a572bf6("ipsec_offload: kernel infrastructure") Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D46483
This commit is contained in:
parent
408c909dc6
commit
01f43479b5
2 changed files with 4 additions and 1 deletions
|
|
@ -392,7 +392,7 @@ ipsec_accel_sa_newkey_impl(struct secasvar *sav)
|
|||
|
||||
TASK_INIT(&tq->install_task, 0, ipsec_accel_sa_newkey_act, tq);
|
||||
tq->sav = sav;
|
||||
tq->install_vnet = curthread->td_vnet; /* XXXKIB liveness */
|
||||
tq->install_vnet = curthread->td_vnet;
|
||||
taskqueue_enqueue(ipsec_accel_tq, &tq->install_task);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -8713,6 +8713,9 @@ key_vnet_destroy(void *arg __unused)
|
|||
}
|
||||
SAHTREE_WUNLOCK();
|
||||
|
||||
/* Wait for async work referencing this VNET to finish. */
|
||||
ipsec_accel_sync();
|
||||
|
||||
key_freesah_flushed(&sahdrainq);
|
||||
hashdestroy(V_sphashtbl, M_IPSEC_SP, V_sphash_mask);
|
||||
hashdestroy(V_savhashtbl, M_IPSEC_SA, V_savhash_mask);
|
||||
|
|
|
|||
Loading…
Reference in a new issue