summaryrefslogtreecommitdiff
path: root/sys/net/pf_ioctl.c
diff options
context:
space:
mode:
authormbuhl <mbuhl@cvs.openbsd.org>2022-06-26 11:37:09 +0000
committermbuhl <mbuhl@cvs.openbsd.org>2022-06-26 11:37:09 +0000
commit7bf02fd85a84bca523451f891ba641bce6f3b817 (patch)
treea1bb280ba6fbc04d204d492bd74d05e2164b8e97 /sys/net/pf_ioctl.c
parent80ecf3ca7477e3097f1e0a1f9ab1ce8513e81fb1 (diff)
Allow waiting during ktable allocation in pf_ioctl.
OK bluhm Reported-by: syzbot+50ea4f33ed5dd9264918@syzkaller.appspotmail.com Reported-by: syzbot+df65f8b7ee8c0089e885@syzkaller.appspotmail.com
Diffstat (limited to 'sys/net/pf_ioctl.c')
-rw-r--r--sys/net/pf_ioctl.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/sys/net/pf_ioctl.c b/sys/net/pf_ioctl.c
index c055fc6f0e5..a81d8a7876c 100644
--- a/sys/net/pf_ioctl.c
+++ b/sys/net/pf_ioctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pf_ioctl.c,v 1.381 2022/05/10 23:12:25 sashan Exp $ */
+/* $OpenBSD: pf_ioctl.c,v 1.382 2022/06/26 11:37:08 mbuhl Exp $ */
/*
* Copyright (c) 2001 Daniel Hartmeier
@@ -891,8 +891,8 @@ int
pf_addr_setup(struct pf_ruleset *ruleset, struct pf_addr_wrap *addr,
sa_family_t af)
{
- if (pfi_dynaddr_setup(addr, af) ||
- pf_tbladdr_setup(ruleset, addr) ||
+ if (pfi_dynaddr_setup(addr, af, PR_WAITOK) ||
+ pf_tbladdr_setup(ruleset, addr, PR_WAITOK) ||
pf_rtlabel_add(addr))
return (EINVAL);
@@ -1413,7 +1413,7 @@ pfioctl(dev_t dev, u_long cmd, caddr_t addr, int flags, struct proc *p)
if (rule->overload_tblname[0]) {
if ((rule->overload_tbl = pfr_attach_table(ruleset,
- rule->overload_tblname, 0)) == NULL)
+ rule->overload_tblname, PR_WAITOK)) == NULL)
error = EINVAL;
else
rule->overload_tbl->pfrkt_flags |= PFR_TFLAG_ACTIVE;
@@ -1636,7 +1636,8 @@ pfioctl(dev_t dev, u_long cmd, caddr_t addr, int flags, struct proc *p)
if (newrule->overload_tblname[0]) {
newrule->overload_tbl = pfr_attach_table(
- ruleset, newrule->overload_tblname, 0);
+ ruleset, newrule->overload_tblname,
+ PR_WAITOK);
if (newrule->overload_tbl == NULL)
error = EINVAL;
else