summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbluhm <bluhm@openbsd.org>2018-04-24 23:05:09 +0000
committerbluhm <bluhm@openbsd.org>2018-04-24 23:05:09 +0000
commitc3427cc25ac69249a20c64865549a3f80d9c2074 (patch)
tree09593c9c947c40fedc0afa8f3d67a9ec3960b5bb
parentAdd os-test to subdir. (diff)
downloadwireguard-openbsd-c3427cc25ac69249a20c64865549a3f80d9c2074.tar.xz
wireguard-openbsd-c3427cc25ac69249a20c64865549a3f80d9c2074.zip
Use pf_rm_rule() instead of pool_put() to decrement references by
the rule created in pf_rule_copyin(). Plugs a potential kif memory leak in pf(4) ioctl. OK sashan@
-rw-r--r--sys/net/pf_ioctl.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/net/pf_ioctl.c b/sys/net/pf_ioctl.c
index cc1003ecf0a..8e13017eb89 100644
--- a/sys/net/pf_ioctl.c
+++ b/sys/net/pf_ioctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pf_ioctl.c,v 1.333 2018/04/13 14:09:42 mikeb Exp $ */
+/* $OpenBSD: pf_ioctl.c,v 1.334 2018/04/24 23:05:09 bluhm Exp $ */
/*
* Copyright (c) 2001 Daniel Hartmeier
@@ -1415,7 +1415,7 @@ pfioctl(dev_t dev, u_long cmd, caddr_t addr, int flags, struct proc *p)
break;
#endif /* INET6 */
default:
- pool_put(&pf_rule_pl, newrule);
+ pf_rm_rule(NULL, newrule);
error = EAFNOSUPPORT;
PF_UNLOCK();
goto fail;