summaryrefslogtreecommitdiffstats
path: root/sys/netinet/ip_ipcomp.c
diff options
context:
space:
mode:
authormpi <mpi@openbsd.org>2016-12-24 11:17:35 +0000
committermpi <mpi@openbsd.org>2016-12-24 11:17:35 +0000
commit855f6737239fe1e8d246f63bfafa52a74ebcd6f6 (patch)
tree9114d69076b7faf78b2da9c178a65ce39741c683 /sys/netinet/ip_ipcomp.c
parentThe unit of the parition offset in disklabel is number of sectors in the (diff)
downloadwireguard-openbsd-855f6737239fe1e8d246f63bfafa52a74ebcd6f6.tar.xz
wireguard-openbsd-855f6737239fe1e8d246f63bfafa52a74ebcd6f6.zip
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_ipcomp.c')
-rw-r--r--sys/netinet/ip_ipcomp.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/sys/netinet/ip_ipcomp.c b/sys/netinet/ip_ipcomp.c
index 237cb8bd809..25d27229524 100644
--- a/sys/netinet/ip_ipcomp.c
+++ b/sys/netinet/ip_ipcomp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_ipcomp.c,v 1.48 2016/09/24 14:51:37 naddy Exp $ */
+/* $OpenBSD: ip_ipcomp.c,v 1.49 2016/12/24 11:17:35 mpi Exp $ */
/*
* Copyright (c) 2001 Jean-Jacques Bernard-Gundol (jj@wabbitt.org)
@@ -554,7 +554,7 @@ ipcomp_output_cb(struct cryptop *crp)
return (EINVAL);
}
- s = splsoftnet();
+ NET_LOCK(s);
tdb = gettdb(tc->tc_rdomain, tc->tc_spi, &tc->tc_dst, tc->tc_proto);
if (tdb == NULL) {
@@ -571,7 +571,7 @@ ipcomp_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);
@@ -588,7 +588,7 @@ ipcomp_output_cb(struct cryptop *crp)
/* Compression was useless, we have lost time. */
crypto_freereq(crp);
error = ipsp_process_done(m, tdb);
- splx(s);
+ NET_UNLOCK(s);
return error;
}
@@ -638,11 +638,11 @@ ipcomp_output_cb(struct cryptop *crp)
crypto_freereq(crp);
error = ipsp_process_done(m, tdb);
- splx(s);
+ NET_UNLOCK(s);
return error;
baddone:
- splx(s);
+ NET_UNLOCK(s);
m_freem(m);