[Bug 297678] pf: page fault in pf_step_into_anchor()
- In reply to: bugzilla-noreply_a_freebsd.org: "[Bug 297678] pf: page fault in pf_step_into_anchor()"
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 26 Aug 2026 08:06:41 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=297678
--- Comment #2 from Kristof Provost <kp@freebsd.org> ---
(In reply to Kristof Provost from comment #1)
Only I can't see a scenario where match_rules is non-empty when we enter
pf_test_rule(), so that doesn't quite work either.
Let's add some assertions to the above and see if that triggers anything on
your setup:
diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c
index 7dc9d59e8300..4b19aae63cde 100644
--- a/sys/netpfil/pf/pf.c
+++ b/sys/netpfil/pf/pf.c
@@ -6272,9 +6272,10 @@ pf_match_rule(struct pf_test_ctx *ctx, struct
pf_kruleset *ruleset)
}
ri->r = r;
- if (SLIST_EMPTY(ctx->match_rules)) {
+ if (SLIST_EMPTY(ctx->match_rules) ||
ctx->last_match_rule == NULL) {
SLIST_INSERT_HEAD(ctx->match_rules, ri,
entry);
} else {
+ MPASS(ctx->last_match_rule != NULL);
SLIST_INSERT_AFTER(ctx->last_match_rule, ri, entry);
}
ctx->last_match_rule = ri;
@@ -6365,6 +6366,9 @@ pf_test_rule(struct pf_krule **rm, struct pf_kstate **sm,
ctx.reason = *reason;
ctx.match_rules = match_rules;
+ /* XXX If we're not empty we need to set last_match_rule too! */
+ MPASS(SLIST_EMPTY(match_rules));
+
pf_addrcpy(&pd->nsaddr, pd->src, pd->af);
pf_addrcpy(&pd->ndaddr, pd->dst, pd->af);
--
You are receiving this mail because:
You are the assignee for the bug.