summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordlg <dlg@openbsd.org>2010-07-28 06:52:05 +0000
committerdlg <dlg@openbsd.org>2010-07-28 06:52:05 +0000
commit836e28141f097fd7f6dad73a702d776ddf270c83 (patch)
tree6fca4da7fa8a2734c85802879ca2f1dfabab06ba
parentNo need to bzero() malloc'd memory if we used M_ZERO. (diff)
downloadwireguard-openbsd-836e28141f097fd7f6dad73a702d776ddf270c83.tar.xz
wireguard-openbsd-836e28141f097fd7f6dad73a702d776ddf270c83.zip
pfsync_bulk_fail was mucking around with pfsync_softc and sending packets
without holding splsoftnet. this adds the necessary protection. reported by patrick coleman
-rw-r--r--sys/net/if_pfsync.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/net/if_pfsync.c b/sys/net/if_pfsync.c
index 04a1840ee7e..c711d8b04af 100644
--- a/sys/net/if_pfsync.c
+++ b/sys/net/if_pfsync.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_pfsync.c,v 1.153 2010/07/25 23:36:31 jsg Exp $ */
+/* $OpenBSD: if_pfsync.c,v 1.154 2010/07/28 06:52:05 dlg Exp $ */
/*
* Copyright (c) 2002 Michael Shalayeff
@@ -2258,6 +2258,9 @@ void
pfsync_bulk_fail(void *arg)
{
struct pfsync_softc *sc = arg;
+ int s;
+
+ s = splsoftnet();
if (sc->sc_bulk_tries++ < PFSYNC_MAX_BULKTRIES) {
/* Try again */
@@ -2275,6 +2278,8 @@ pfsync_bulk_fail(void *arg)
pfsync_sync_ok = 1;
DPFPRINTF(LOG_ERR, "failed to receive bulk update");
}
+
+ splx(s);
}
void