diff options
| author | Kristof Provost <kp@FreeBSD.org> | 2026-02-03 12:17:08 +0000 |
|---|---|---|
| committer | Kristof Provost <kp@FreeBSD.org> | 2026-02-03 22:51:28 +0000 |
| commit | fe9e4eb6f38ae004efb576bf44aded08852f9e6b (patch) | |
| tree | 81cdcd20ac2316baf294bd62e26180d955937aa0 /test/ubsan/TestCases | |
| parent | 895e1c6567d9561c86f8d20b47e924911bce989e (diff) | |
In pf_match_rule() we attempt to append matching rules to the end of
'match_rules'. We want to preserve the order to make the multiple
pflog entries easier to understand. So we keep track of the last added
rule item in 'rt'. However, that assumed that 'match_rules' was only
ever added to in that one call to pf_match_rules(). This isn't always
the case, for example if we have match rules in different anchors.
In that case we'd end up using the uninitialised 'rt' variable in the
SLIST_INSERT_AFTER call.
Instead track the match rules and the last matching rule (to enable
easy appending) in the struct pf_test_ctx.
This also allows us to reduce the number of arguments for some
functions, because we passed a ctx to most functions that needed
'match_rules'.
While here also make pf_match_rules() static, because it's only ever
used in pf.c
Add a test case to exercise the relevant code path.
MFC after: 2 weeks
Sponsored by: Rubicon Communications, LLC ("Netgate")
Diffstat (limited to 'test/ubsan/TestCases')
0 files changed, 0 insertions, 0 deletions
