]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
tests: shell: use-after-free from abort path
authorPablo Neira Ayuso <pablo@netfilter.org>
Fri, 9 Aug 2019 12:49:14 +0000 (14:49 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Sun, 8 Sep 2019 18:32:16 +0000 (20:32 +0200)
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>
tests/shell/testcases/transactions/0050rule_1 [new file with mode: 0755]

diff --git a/tests/shell/testcases/transactions/0050rule_1 b/tests/shell/testcases/transactions/0050rule_1
new file mode 100755 (executable)
index 0000000..89e5f42
--- /dev/null
@@ -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