summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsashan <sashan@openbsd.org>2019-11-26 18:50:29 +0000
committersashan <sashan@openbsd.org>2019-11-26 18:50:29 +0000
commitf6949e646d06fd938b13a9999ec975b927addbe9 (patch)
tree74ec48e34345536d7b602d400404f2bb014d6899
parentFix a panic string that had the wrong function name and an improperly (diff)
downloadwireguard-openbsd-f6949e646d06fd938b13a9999ec975b927addbe9.tar.xz
wireguard-openbsd-f6949e646d06fd938b13a9999ec975b927addbe9.zip
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@
-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;
}