From 5a50f165b8ad031682f9dce0938f29a73af4641e Mon Sep 17 00:00:00 2001 From: sashan Date: Sun, 26 Dec 2021 14:04:29 +0000 Subject: [PATCH] DIOCHANGERRULE ioctl must set pointer to ruleset in rule it inserts. Reported-by: syzbot+7718c5f69c595f76b298@syzkaller.appspotmail.com OK bluhm@, OK jmatthew@ --- sys/net/pf_ioctl.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/net/pf_ioctl.c b/sys/net/pf_ioctl.c index 9293253ea2a..a7e6641ae91 100644 --- a/sys/net/pf_ioctl.c +++ b/sys/net/pf_ioctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pf_ioctl.c,v 1.368 2021/12/26 01:00:32 sashan Exp $ */ +/* $OpenBSD: pf_ioctl.c,v 1.369 2021/12/26 14:04:29 sashan Exp $ */ /* * Copyright (c) 2001 Daniel Hartmeier @@ -1646,6 +1646,7 @@ pfioctl(dev_t dev, u_long cmd, caddr_t addr, int flags, struct proc *p) ruleset->rules.active.ptr, oldrule, newrule, entries); ruleset->rules.active.rcount++; + newrule->ruleset = ruleset; } nr = 0; -- 2.20.1