When tearing down IPsec as part of a (virtual) network stack,
do not try to free the same list twice but free both the acquiring list and the security policy acquiring list. Reviewed by: anchie MFC after: 3 days
This commit is contained in:
parent
5271b37f10
commit
cb7afff0b8
@ -7779,7 +7779,8 @@ void
|
|||||||
key_destroy(void)
|
key_destroy(void)
|
||||||
{
|
{
|
||||||
struct secpolicy *sp, *nextsp;
|
struct secpolicy *sp, *nextsp;
|
||||||
struct secspacq *acq, *nextacq;
|
struct secacq *acq, *nextacq;
|
||||||
|
struct secspacq *spacq, *nextspacq;
|
||||||
struct secashead *sah, *nextsah;
|
struct secashead *sah, *nextsah;
|
||||||
struct secreg *reg;
|
struct secreg *reg;
|
||||||
int i;
|
int i;
|
||||||
@ -7820,7 +7821,7 @@ key_destroy(void)
|
|||||||
REGTREE_UNLOCK();
|
REGTREE_UNLOCK();
|
||||||
|
|
||||||
ACQ_LOCK();
|
ACQ_LOCK();
|
||||||
for (acq = LIST_FIRST(&V_spacqtree); acq != NULL; acq = nextacq) {
|
for (acq = LIST_FIRST(&V_acqtree); acq != NULL; acq = nextacq) {
|
||||||
nextacq = LIST_NEXT(acq, chain);
|
nextacq = LIST_NEXT(acq, chain);
|
||||||
if (__LIST_CHAINED(acq)) {
|
if (__LIST_CHAINED(acq)) {
|
||||||
LIST_REMOVE(acq, chain);
|
LIST_REMOVE(acq, chain);
|
||||||
@ -7830,11 +7831,12 @@ key_destroy(void)
|
|||||||
ACQ_UNLOCK();
|
ACQ_UNLOCK();
|
||||||
|
|
||||||
SPACQ_LOCK();
|
SPACQ_LOCK();
|
||||||
for (acq = LIST_FIRST(&V_spacqtree); acq != NULL; acq = nextacq) {
|
for (spacq = LIST_FIRST(&V_spacqtree); spacq != NULL;
|
||||||
nextacq = LIST_NEXT(acq, chain);
|
spacq = nextspacq) {
|
||||||
if (__LIST_CHAINED(acq)) {
|
nextspacq = LIST_NEXT(spacq, chain);
|
||||||
LIST_REMOVE(acq, chain);
|
if (__LIST_CHAINED(spacq)) {
|
||||||
free(acq, M_IPSEC_SAQ);
|
LIST_REMOVE(spacq, chain);
|
||||||
|
free(spacq, M_IPSEC_SAQ);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
SPACQ_UNLOCK();
|
SPACQ_UNLOCK();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user