Skip to contentSkip to conversation

netfilter: nft_tunnel: ERSPAN_VERSION must not be null

PATCH Applied Florian Westphal 2 participants 2 messages Jan 16, 2020

Subsystems (2)
lore
Share & tools
lore

Florian Westphal

author maintainer
#0 lore raw

PATCH 1/1 netfilter: nft_tunnel: ERSPAN_VERSION must not be null

Fixes af308b94a2a4a5 ("netfilter: nf_tables: add tunnel support")

---

net/netfilter/nft_tunnel.c +3 -0
index d89c7c553030..5284fcf16be7 100644
@@ -266,6 +266,9 @@ static int nft_tunnel_obj_erspan_init(const struct nlattr *attr,
 	if (err < 0)
 		return err;
 
+	if (!tb[NFTA_TUNNEL_KEY_ERSPAN_VERSION])
+		 return -EINVAL;
+
 	version = ntohl(nla_get_be32(tb[NFTA_TUNNEL_KEY_ERSPAN_VERSION]));
 	switch (version) {
 	case ERSPAN_VERSION:
Signature · 1 line
2.24.1