summaryrefslogtreecommitdiff
path: root/sys/netinet/ip_esp.c
diff options
context:
space:
mode:
authorMartin Pieuchot <mpi@cvs.openbsd.org>2016-12-24 11:17:36 +0000
committerMartin Pieuchot <mpi@cvs.openbsd.org>2016-12-24 11:17:36 +0000
commit338b3dc588ccd179241962498cd83d2ae20b95fe (patch)
tree81a32f32e776f8612e4b9fa9155850fe64030357 /sys/netinet/ip_esp.c
parentd88cc81bd2e0c007eaf6bd7c04639a09d3f7854c (diff)
Grab the NET_LOCK() before calling ipsp_process_done() as it ends up
in ip_output(). Found the hardway by and ok kettenis@
Diffstat (limited to 'sys/netinet/ip_esp.c')
-rw-r--r--sys/netinet/ip_esp.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/netinet/ip_esp.c b/sys/netinet/ip_esp.c
index 176a0f03012..44919020b7f 100644
--- a/sys/netinet/ip_esp.c
+++ b/sys/netinet/ip_esp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_esp.c,v 1.141 2016/09/19 18:09:22 tedu Exp $ */
+/* $OpenBSD: ip_esp.c,v 1.142 2016/12/24 11:17:35 mpi Exp $ */
/*
* The authors of this code are John Ioannidis (ji@tla.org),
* Angelos D. Keromytis (kermit@csd.uch.gr) and
@@ -1064,7 +1064,7 @@ esp_output_cb(struct cryptop *crp)
}
- s = splsoftnet();
+ NET_LOCK(s);
tdb = gettdb(tc->tc_rdomain, tc->tc_spi, &tc->tc_dst, tc->tc_proto);
if (tdb == NULL) {
@@ -1081,7 +1081,7 @@ esp_output_cb(struct cryptop *crp)
/* Reset the session ID */
if (tdb->tdb_cryptoid != 0)
tdb->tdb_cryptoid = crp->crp_sid;
- splx(s);
+ NET_UNLOCK(s);
return crypto_dispatch(crp);
}
free(tc, M_XDATA, 0);
@@ -1098,11 +1098,11 @@ esp_output_cb(struct cryptop *crp)
/* Call the IPsec input callback. */
error = ipsp_process_done(m, tdb);
- splx(s);
+ NET_UNLOCK(s);
return error;
baddone:
- splx(s);
+ NET_UNLOCK(s);
m_freem(m);