summaryrefslogtreecommitdiffstats
path: root/net/netfilter
diff options
context:
space:
mode:
authorFlorian Westphal <fw@strlen.de>2020-01-16 08:58:05 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-02-05 14:43:47 +0000
commit9f19727f16fa96fa2b61b134e3a4be48d3128076 (patch)
tree1d7325f1108c39705fa632f5111e71903d402470 /net/netfilter
parentffd89a6c2daace7a9e33adb665f8f1bb8e44c7e3 (diff)
downloadlinux-stable-9f19727f16fa96fa2b61b134e3a4be48d3128076.tar.gz
linux-stable-9f19727f16fa96fa2b61b134e3a4be48d3128076.tar.bz2
linux-stable-9f19727f16fa96fa2b61b134e3a4be48d3128076.zip
netfilter: nft_tunnel: ERSPAN_VERSION must not be null
[ Upstream commit 9ec22d7c6c69146180577f3ad5fdf504beeaee62 ] 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> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'net/netfilter')
-rw-r--r--net/netfilter/nft_tunnel.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/net/netfilter/nft_tunnel.c b/net/netfilter/nft_tunnel.c
index 09441bbb0166..e5444f3ff43f 100644
--- a/net/netfilter/nft_tunnel.c
+++ b/net/netfilter/nft_tunnel.c
@@ -235,6 +235,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: