summaryrefslogtreecommitdiffstats
path: root/sys/contrib
diff options
context:
space:
mode:
authormlaier <mlaier@FreeBSD.org>2007-10-24 20:57:17 +0000
committermlaier <mlaier@FreeBSD.org>2007-10-24 20:57:17 +0000
commit77d2172c998338d1de1e559f342ff5b4d8cc0bab (patch)
treea5d199f487c39bf68da0fb94b683239d8ef7cfa0 /sys/contrib
parent9ce0055163a929a9aac908f13e80540ba46a5250 (diff)
downloadFreeBSD-src-77d2172c998338d1de1e559f342ff5b4d8cc0bab.zip
FreeBSD-src-77d2172c998338d1de1e559f342ff5b4d8cc0bab.tar.gz
Properly drop the pf mutex around all copyout (consistency still protected
by the sx) and avoid a WITNESS panic. Overlooked during last import. Reported and tested by: Max N. Boyarov MFC after: 3 days
Diffstat (limited to 'sys/contrib')
-rw-r--r--sys/contrib/pf/net/pf_if.c8
-rw-r--r--sys/contrib/pf/net/pf_table.c2
2 files changed, 9 insertions, 1 deletions
diff --git a/sys/contrib/pf/net/pf_if.c b/sys/contrib/pf/net/pf_if.c
index 005e1b6..14db9ae 100644
--- a/sys/contrib/pf/net/pf_if.c
+++ b/sys/contrib/pf/net/pf_if.c
@@ -731,6 +731,9 @@ pfi_get_ifaces(const char *name, struct pfi_kif *buf, int *size)
{
struct pfi_kif *p, *nextp;
int s, n = 0;
+#ifdef __FreeBSD__
+ int error;
+#endif
s = splsoftnet();
for (p = RB_MIN(pfi_ifhead, &pfi_ifs); p; p = nextp) {
@@ -741,7 +744,12 @@ pfi_get_ifaces(const char *name, struct pfi_kif *buf, int *size)
if (!p->pfik_tzero)
p->pfik_tzero = time_second;
pfi_kif_ref(p, PFI_KIF_REF_RULE);
+#ifdef __FreeBSD__
+ PF_COPYOUT(p, buf++, sizeof(*buf), error);
+ if (error) {
+#else
if (copyout(p, buf++, sizeof(*buf))) {
+#endif
pfi_kif_unref(p, PFI_KIF_REF_RULE);
splx(s);
return (EFAULT);
diff --git a/sys/contrib/pf/net/pf_table.c b/sys/contrib/pf/net/pf_table.c
index 1cdaa47..977f88c 100644
--- a/sys/contrib/pf/net/pf_table.c
+++ b/sys/contrib/pf/net/pf_table.c
@@ -1171,7 +1171,7 @@ pfr_walktree(struct radix_node *rn, void *arg)
struct pfr_addr ad;
pfr_copyout_addr(&ad, ke);
- if (copyout(&ad, w->pfrw_addr, sizeof(ad)))
+ if (COPYOUT(&ad, w->pfrw_addr, sizeof(ad)))
return (EFAULT);
w->pfrw_addr++;
}
OpenPOWER on IntegriCloud