summaryrefslogtreecommitdiff
path: root/net/netfilter
diff options
context:
space:
mode:
authorFlorian Westphal <fw@strlen.de>2020-01-16 10:58:05 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-01-23 10:22:48 +0300
commit9da572424be1b7e3dac69cf27712ee9dc3bac339 (patch)
treecba78ad6b54f17793f02f94fa7f59dff64d70f67 /net/netfilter
parent3d49538869ec7a3434566df64accd6f2d85449e5 (diff)
downloadlinux-9da572424be1b7e3dac69cf27712ee9dc3bac339.tar.xz
netfilter: nft_tunnel: ERSPAN_VERSION must not be null
commit 9ec22d7c6c69146180577f3ad5fdf504beeaee62 upstream. 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: Greg Kroah-Hartman <gregkh@linuxfoundation.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 d89c7c553030..5284fcf16be7 100644
--- a/net/netfilter/nft_tunnel.c
+++ b/net/netfilter/nft_tunnel.c
@@ -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: