summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2019-08-09 14:49:14 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2019-09-08 20:32:16 +0200
commit0459d27570aa074910308e3bb367fee6a687f594 (patch)
tree0fd4960f7b8cc522432bd8e9620bdd0ee5e0ea83 /tests
parentcec665f34a91600550dbd14655b25ed2cc317233 (diff)
tests: shell: use-after-free from abort path
Rule that fails to be added while holding a bound set triggers user-after-free from the abort path. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'tests')
-rwxr-xr-xtests/shell/testcases/transactions/0050rule_119
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/shell/testcases/transactions/0050rule_1 b/tests/shell/testcases/transactions/0050rule_1
new file mode 100755
index 00000000..89e5f42f
--- /dev/null
+++ b/tests/shell/testcases/transactions/0050rule_1
@@ -0,0 +1,19 @@
+#!/bin/bash
+
+set -e
+
+RULESET="table inet filter {
+ flowtable ftable {
+ hook ingress priority 0; devices = { eno1, eno0, x };
+ }
+
+chain forward {
+ type filter hook forward priority 0; policy drop;
+
+ ip protocol { tcp, udp } ct mark and 1 == 1 counter flow add @ftable
+ ip6 nexthdr { tcp, udp } ct mark and 2 == 2 counter flow add @ftable
+ ct mark and 30 == 30 ct state established,related log prefix \"nftables accept: \" level info accept
+ }
+}"
+
+$NFT -f - <<< "$RULESET" >/dev/null || exit 0