diff --git a/net/netfilter/nft_tunnel.c b/net/netfilter/nft_tunnel.c index 09441bbb0166f764afac70f60434e71412bb53f1..e5444f3ff43fc8a2adad17ef130537895e60d85d 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: