path: root/tests/shell
diff options
authorFlorian Westphal <>2018-05-29 16:16:44 +0200
committerFlorian Westphal <>2018-06-07 14:38:01 +0200
commitccd0125b242e923fce98d9321a69695bb74fb193 (patch)
treed3255d45600aabfc7c2513dc395d1cb445886aca /tests/shell
parent40fb9d6f6bea86b812314b3c879746d957fbb769 (diff)
tests: shell: add crash reproducer
Two reports point to a crash in nft when 'flush' is provided on existing ruleset. In that case, nft will crash with a null-ptr dereference. "evaluate: do not inconditionally update cache from flush command" causes the commit to fail due to a cache inconsistency, we then trip over NULL location->indesc. Cause of 2nd bug not known yet, not sure how to fix cache issue either, so only adding reproducer so this can be fixed later. Without erec bug, the (errnoeous) error message would be Could not process rule: File exists Reported-by: Oleksandr Natalenko <> Reported-by: Timothy Redaelli <> Signed-off-by: Florian Westphal <>
Diffstat (limited to 'tests/shell')
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/shell/testcases/cache/0001_cache_handling_0 b/tests/shell/testcases/cache/0001_cache_handling_0
index 20c19117..77afdf8d 100755
--- a/tests/shell/testcases/cache/0001_cache_handling_0
+++ b/tests/shell/testcases/cache/0001_cache_handling_0
@@ -16,6 +16,10 @@ table inet test {
set -e
$NFT -f - <<< $RULESET
+echo "$RULESET" >> "$TMP"
+$NFT "flush ruleset;include \"$TMP\""
+rm -f "$TMP"
rule_handle=$($NFT list ruleset -a | awk '/saddr/{print $NF}')
$NFT delete rule inet test test handle $rule_handle
$NFT delete set inet test test