git: fab0d0ed67f9 - main - pf: don't forget to CURVNET_RESTORE()
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 25 Nov 2026 16:08:04 UTC
The branch main has been updated by kp:
URL: https://cgit.FreeBSD.org/src/commit/?id=fab0d0ed67f9c533022641852992515fbc151e4e
commit fab0d0ed67f9c533022641852992515fbc151e4e
Author: Kristof Provost <kp@FreeBSD.org>
AuthorDate: 2026-11-24 13:09:36 +0000
Commit: Kristof Provost <kp@FreeBSD.org>
CommitDate: 2026-11-25 16:05:18 +0000
pf: don't forget to CURVNET_RESTORE()
Reported by: llm-postcr
Fixes: 96c545176df7 ("pf: don't allow any ioctl calls until we're fully initialised")
Sponsored by: Rubicon Communications, LLC ("Netgate")
---
sys/netpfil/pf/pf_ioctl.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/sys/netpfil/pf/pf_ioctl.c b/sys/netpfil/pf/pf_ioctl.c
index 985b482c0314..d4f8f1bd36d0 100644
--- a/sys/netpfil/pf/pf_ioctl.c
+++ b/sys/netpfil/pf/pf_ioctl.c
@@ -4174,8 +4174,10 @@ pfioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flags, struct thread *td
CURVNET_SET(TD_TO_VNET(td));
/* Don't allow ioctl calls until we're fully initialised. */
- if (V_pf_vnet_active == 0)
- return (EBUSY);
+ if (V_pf_vnet_active == 0) {
+ error = EBUSY;
+ goto fail;
+ }
switch (cmd) {
#ifdef COMPAT_FREEBSD14