Blob Blame History Raw
From: Florian Westphal <fw@strlen.de>
Date: Thu, 16 Jan 2020 08:58:05 +0100
Subject: netfilter: nft_tunnel: ERSPAN_VERSION must not be null
Patch-mainline: v5.5-rc7
Git-commit: 9ec22d7c6c69146180577f3ad5fdf504beeaee62
References: bsc#1154353

Fixes: af308b94a2a4a5 ("netfilter: nf_tables: add tunnel support")
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Acked-by: Thomas Bogendoerfer <tbogendoerfer@suse.de>
---
 net/netfilter/nft_tunnel.c |    3 +++
 1 file changed, 3 insertions(+)

--- a/net/netfilter/nft_tunnel.c
+++ b/net/netfilter/nft_tunnel.c
@@ -266,6 +266,9 @@ static int nft_tunnel_obj_erspan_init(co
 	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: