git: 75599b318433 - main - pf: fix unlocked anchor access in DIOCGETETHRULESET
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 26 Nov 2026 17:16:56 UTC
The branch main has been updated by kp:
URL: https://cgit.FreeBSD.org/src/commit/?id=75599b31843361af4266c739cc73d3eb5824b4be
commit 75599b31843361af4266c739cc73d3eb5824b4be
Author: Kristof Provost <kp@FreeBSD.org>
AuthorDate: 2026-11-25 17:25:16 +0000
Commit: Kristof Provost <kp@FreeBSD.org>
CommitDate: 2026-11-26 17:16:40 +0000
pf: fix unlocked anchor access in DIOCGETETHRULESET
We accessed anchor->name and ruleset->anchor->path outside of the rules lock.
Extend the lock coverage.
Reported by: llm-postcr
Fixes: e732e742b37f ("pf: Initial Ethernet level filtering code")
Sponsored by: Rubicon Communications, LLC ("Netgate")
---
sys/netpfil/pf/pf_ioctl.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/sys/netpfil/pf/pf_ioctl.c b/sys/netpfil/pf/pf_ioctl.c
index 9b692b3954a7..4a38209cfba0 100644
--- a/sys/netpfil/pf/pf_ioctl.c
+++ b/sys/netpfil/pf/pf_ioctl.c
@@ -4645,7 +4645,6 @@ DIOCGETETHRULESETS_error:
}
}
- PF_RULES_RUNLOCK();
if (found) {
nvlist_add_number(nvl, "nr", nr);
nvlist_add_string(nvl, "name", anchor->name);
@@ -4655,8 +4654,10 @@ DIOCGETETHRULESETS_error:
else
nvlist_add_string(nvl, "path", "");
} else {
+ PF_RULES_RUNLOCK();
ERROUT(EBUSY);
}
+ PF_RULES_RUNLOCK();
nvlpacked = nvlist_pack(nvl, &nv->len);
if (nvlpacked == NULL)