diff options
author | Florian Westphal <fw@strlen.de> | 2024-01-15 14:27:15 +0100 |
---|---|---|
committer | Florian Westphal <fw@strlen.de> | 2024-01-15 18:21:41 +0100 |
commit | b73298405cda74b3a87a1818bb92f53298d34170 (patch) | |
tree | 0e43557cdb9c02265d24a1e2c657dbae87921806 /tests | |
parent | 8a66de2a15943b2fbf960967cdbcbd0a148cb114 (diff) |
rule: fix sym refcount assertion
Scope release must happen last.
afl provided a reproducer where policy is a define, because
scope is released too early we get:
nft: src/rule.c:559: scope_release: Assertion `sym->refcnt == 1' failed.
... because chain->policy is EXPR_SYMBOL.
Fixes: 627c451b2351 ("src: allow variables in the chain priority specification")
Signed-off-by: Florian Westphal <fw@strlen.de>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/shell/testcases/bogons/nft-f/define_policy_assert | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/shell/testcases/bogons/nft-f/define_policy_assert b/tests/shell/testcases/bogons/nft-f/define_policy_assert new file mode 100644 index 00000000..f1e58b55 --- /dev/null +++ b/tests/shell/testcases/bogons/nft-f/define_policy_assert @@ -0,0 +1,3 @@ +chain y x { priority filter +define p = foo +policy $p |