diff options
author | Alexandr Nedvedicky <sashan@cvs.openbsd.org> | 2022-02-09 11:42:59 +0000 |
---|---|---|
committer | Alexandr Nedvedicky <sashan@cvs.openbsd.org> | 2022-02-09 11:42:59 +0000 |
commit | 53cdb87bf79982196c5d5fccb01b72915f842b5e (patch) | |
tree | 44d29f4b6b34f80031cdb4ab9e575c72dc0b2a2d /sys/net/pf_ioctl.c | |
parent | 9a7f4e6b271f456367cf3e05f26eb7d8f7b45a2a (diff) |
let pfattach() to also initialize pf_default_rule_new to avoid
div-by-zero in pf_purge()
Reported-by: syzbot+e720e3bab51366d7b667@syzkaller.appspotmail.com
OK deraadt@
Diffstat (limited to 'sys/net/pf_ioctl.c')
-rw-r--r-- | sys/net/pf_ioctl.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/net/pf_ioctl.c b/sys/net/pf_ioctl.c index fa2a5dcdb64..124cf7e420a 100644 --- a/sys/net/pf_ioctl.c +++ b/sys/net/pf_ioctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pf_ioctl.c,v 1.371 2022/01/24 22:49:48 bluhm Exp $ */ +/* $OpenBSD: pf_ioctl.c,v 1.372 2022/02/09 11:42:58 sashan Exp $ */ /* * Copyright (c) 2001 Daniel Hartmeier @@ -250,6 +250,8 @@ pfattach(int num) /* XXX do our best to avoid a conflict */ pf_status.hostid = arc4random(); + + pf_default_rule_new = pf_default_rule; } int |