summaryrefslogtreecommitdiff
path: root/sys/net/pf_ioctl.c
diff options
context:
space:
mode:
authorAlexandr Nedvedicky <sashan@cvs.openbsd.org>2019-11-26 18:50:30 +0000
committerAlexandr Nedvedicky <sashan@cvs.openbsd.org>2019-11-26 18:50:30 +0000
commit67d88486a45869c3772f421bf999ea8597afacaf (patch)
treec0ecdf929ed7f1b5e86c3609b4fde16f182b41d3 /sys/net/pf_ioctl.c
parent3b034832b0c86d8efc7cafb75a1dd7e1f41ecc12 (diff)
fix kernel crash in pf_ioctl with WITH_PF_LOCK and NET_TASKQ > 1
the problem was introduced with a "mechanical" patch, which replaced all "breaks;" with "PF_UNLOCK(); break;" This is wrong for case of DIOCGETRULESETS. issue analyzed and patch created by Joerg Goltermann <jg@osn.de> OK tb@
Diffstat (limited to 'sys/net/pf_ioctl.c')
-rw-r--r--sys/net/pf_ioctl.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/sys/net/pf_ioctl.c b/sys/net/pf_ioctl.c
index e126a28d687..df798cd4205 100644
--- a/sys/net/pf_ioctl.c
+++ b/sys/net/pf_ioctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pf_ioctl.c,v 1.345 2019/11/17 08:25:05 otto Exp $ */
+/* $OpenBSD: pf_ioctl.c,v 1.346 2019/11/26 18:50:29 sashan Exp $ */
/*
* Copyright (c) 2001 Daniel Hartmeier
@@ -1980,7 +1980,6 @@ pfioctl(dev_t dev, u_long cmd, caddr_t addr, int flags, struct proc *p)
if (anchor->parent == NULL && nr++ == pr->nr) {
strlcpy(pr->name, anchor->name,
sizeof(pr->name));
- PF_UNLOCK();
break;
}
} else {
@@ -1989,13 +1988,12 @@ pfioctl(dev_t dev, u_long cmd, caddr_t addr, int flags, struct proc *p)
if (nr++ == pr->nr) {
strlcpy(pr->name, anchor->name,
sizeof(pr->name));
- PF_UNLOCK();
break;
}
}
+ PF_UNLOCK();
if (!pr->name[0])
error = EBUSY;
- PF_UNLOCK();
break;
}