From: sashan Date: Fri, 9 Jun 2017 17:43:06 +0000 (+0000) Subject: - pfsync_input() must grab PF_LOCK X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=b7823b909956fee473e1e6ff08e8b31a5be1c040;p=openbsd - pfsync_input() must grab PF_LOCK reported and patch tested by Hrvoje Popovski O.K. bluhm@ --- diff --git a/sys/net/if_pfsync.c b/sys/net/if_pfsync.c index e50576fe32a..bda5a865a42 100644 --- a/sys/net/if_pfsync.c +++ b/sys/net/if_pfsync.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_pfsync.c,v 1.252 2017/05/27 18:33:21 mpi Exp $ */ +/* $OpenBSD: if_pfsync.c,v 1.253 2017/06/09 17:43:06 sashan Exp $ */ /* * Copyright (c) 2002 Michael Shalayeff @@ -657,6 +657,7 @@ pfsync_input(struct mbuf **mp, int *offp, int proto, int af) struct pfsync_header *ph; struct pfsync_subheader subh; int offset, noff, len, count, mlen, flags = 0; + int e; pfsyncstat_inc(pfsyncs_ipackets); @@ -733,8 +734,11 @@ pfsync_input(struct mbuf **mp, int *offp, int proto, int af) return IPPROTO_DONE; } - if (pfsync_acts[subh.action].in(n->m_data + noff, - mlen, count, flags) != 0) + PF_LOCK(); + e = pfsync_acts[subh.action].in(n->m_data + noff, mlen, count, + flags); + PF_UNLOCK(); + if (e != 0) goto done; offset += mlen * count;