netfilter: nft_tunnel: add missing attribute validation for tunnels
authorJakub Kicinski <kuba@kernel.org>
Tue, 3 Mar 2020 05:08:33 +0000 (21:08 -0800)
committerPablo Neira Ayuso <pablo@netfilter.org>
Wed, 4 Mar 2020 01:28:25 +0000 (02:28 +0100)
Add missing attribute validation for tunnel source and
destination ports to the netlink policy.

Fixes: af308b94a2a4 ("netfilter: nf_tables: add tunnel support")
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/netfilter/nft_tunnel.c

index 4c3f2e24c7cba9e19f096d0c429904949c6f93ae..764e88682a81f25c4fb840a700780f65d23aaebb 100644 (file)
@@ -339,6 +339,8 @@ static const struct nla_policy nft_tunnel_key_policy[NFTA_TUNNEL_KEY_MAX + 1] =
        [NFTA_TUNNEL_KEY_FLAGS] = { .type = NLA_U32, },
        [NFTA_TUNNEL_KEY_TOS]   = { .type = NLA_U8, },
        [NFTA_TUNNEL_KEY_TTL]   = { .type = NLA_U8, },
+       [NFTA_TUNNEL_KEY_SPORT] = { .type = NLA_U16, },
+       [NFTA_TUNNEL_KEY_DPORT] = { .type = NLA_U16, },
        [NFTA_TUNNEL_KEY_OPTS]  = { .type = NLA_NESTED, },
 };