Skip to contentSkip to conversation

tests: shell: use-after-free from abort path

PATCH New Pablo Neira Ayuso 1 participant 1 message Aug 9, 2019 netfilter

lore
Share & tools
lore

Pablo Neira Ayuso

author maintainer
#0 lore raw

PATCH v2 1/1 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.

---
v2: This one reproduces the crash here.

 tests/shell/testcases/transactions/0050rule_1 | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
 create mode 100755 tests/shell/testcases/transactions/0050rule_1
tests/shell/testcases/transactions/0050rule_1 new file +19 -0
new file mode 100755
index 000000000000..89e5f42fc9f4
@@ -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
Signature · 1 line
2.11.0